Skip to content

Latest commit

 

History

History
342 lines (289 loc) · 13.3 KB

CHANGELOG.md

File metadata and controls

342 lines (289 loc) · 13.3 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

  • No changes yet.

1.20.2 - 2019-10-17

Fixed

  • Added canonical import path directive to avoid checking out ThriftRW at the wrong import path.
  • Package names are now normalized before Go files are generated.

1.20.1 - 2019-07-30

Fixed

  • Fixed field compilation to allow fields with similar looking names and different casing.

1.20.0 - 2019-06-12

Changed

  • ThriftRW now generates non-plugin code into a single file.
  • Module data is now provided to ThriftRW plugins when the Module does not contain a service.

1.19.1 - 2019-05-16

Fixed

  • Fixed a bug that caused invalid code to be generated if two slices of the same type with different go.type annotations were encountered in the same Thrift file.

1.19.0 - 2019-04-26

Added

  • Sets now support a (go.type = "slice") annotation to be generated as slices rather than maps.

1.18.0 - 2019-03-28

Added

  • Ptr methods for primititve typedefs.

1.17.0 - 2019-03-15

Changed

  • Imports in generated code are now always named imports.

1.16.1 - 2019-01-23

Fixed

  • Bump API Version for ThriftRW plugins because the previous release contained a significant change to the ThriftRW Plugin API.

1.16.0 - 2019-01-22

Added

  • Expose Thrift file names, package prefix, and Thrift root directory to plugins.

Fixed

  • plugin: Library version matching was dropped.

1.15.0 - 2019-01-14

Changed

  • GeneratedGet* and IsSet* methods on structs are now nil-safe.

1.14.0 - 2018-10-18

Added

  • Structs now include IsSet* methods for fields that can be nil.

1.13.1 - 2018-10-04

Fixed

  • gen/plugin: Fixed a bug where typedefs of structs were mishandled; while they should have been pointers, they were generated without * and failed to compile.
  • gen/zap: Fixed a bug where logging nil structs would panic.

1.13.0 - 2018-09-10

Added

  • gen: Added support for a go.label annotation that allows overriding the user-readable string names of enum items and struct fields. This has no effect on the names of the generated Go entities.
  • Generated types now implement zapcore.ObjectMarshaler or zapcore.ArrayMarshaler where appropriate. This should lead to much faster logging of these objects.
  • Added go.nolog annotation for struct fields: Those with this annotation will not be included in Zap logging.
  • gen/enum: MarshalText and UnmarshalText now round-trips, even if the enum value is unrecognized.

Fixed

  • ThriftRW now does a bounds-check on field identifiers rather than silently truncating them.
  • gen: Equals methods on generated structs no longer panic if either value is nil.
  • gen: Fixed a bug where *_Values functions for empty enums would not be generated.
  • gen: Fixed infinite loop in generated Equals methods of specific typedefs.

1.12.0 - 2018-06-25

Added

  • gen: Added ThriftPackageImporter to control import path resolution Thrift files.
  • Structs now include getter functions for all fields. This improves Apache Thrift compatibility.
  • Enums now implement encoding.TextMarshaler.

Changed

  • gen: NewGenerator is now usable from other packages.

1.11.0 - 2018-03-27

Added

  • Plugins now have access to service and function annotations.

1.10.0 - 2018-01-11

Removed

  • Removed version check. Version checks would force code regeneration after installing backward-compatible versions of ThriftRW. This change relaxes that requirement.

1.9.0 - 2017-12-12

Added

  • Adds support for EnvelopeAgnosticProtocol. This upcast for protocol.Binary can decode both enveloped or not-enveloped requests and respond in kind, by exploiting the non-overlapping grammars of these message types.
  • Generated enum types now include a Ptr() method.

1.8.0 - 2017-09-29

Added

  • Plugins: Annotations declared on user-defined types are now exposed on TypeReference.

Changed

  • Optional fields of generated structs now enable the omitempty JSON option if the field holds a list, set, or map.

1.7.0 - 2017-09-12

Added

  • AST: Parts of the AST now support parsing docstrings in the /** ... */ style.
  • Docstrings on types in the Thrift file are now included in the generated code.

1.6.0 - 2017-08-28

Added

  • Structs now include getter functions for primitive types.
  • Fields of generated struct types are now tagged with easyjson-compatible required tags.

Fixed

  • Fixed code generation bug for default values of fields with a typedef type.

1.5.0 - 2017-08-03

Added

Fixed

  • Removed gomock and testify from Glide imports to test imports.

1.4.0 - 2017-07-21

Added

  • Added support for go.tag annotations on struct fields. Corresponding fields of the generated Go structs will be tagged with these values.
  • AST: Added a LineNumber function to get the line on which an AST Node was defined.

1.3.0 - 2017-07-05

Added

  • Plugins: Added support for overriding the communication channels used by plugins.
  • Enums now implement the encoding.TextUnmarshaler interface. This allows retrieving enum values by name and integrates better with other encoding formats.
  • Enums now have a <EnumName>_Values() function which returns all known values for that enum.

Fixed

  • Plugins: Template output is now compliant with gofmt.

1.2.0 - 2017-04-17

Added

  • The Thrift IDL is now embedded withing the generated package. It is accessible via the package global ThriftModule.

1.1.0 - 2017-03-23

Added

  • Equals() methods are now generated for all custom types.
  • Added flags --no-types, --no-constants, --no-service-helpers.
  • AST: All type references and complex constant values now record the line numbers on which they were specified.
  • AST: Added a Node interface to unify different AST object types.
  • AST: Added Walk to traverse the AST using a Visitor.

Fixed

  • Handle nil values in generated String() methods.
  • Plugins: Fail code generation if communication with a plugin fails to disconnect properly.
  • Fixed conflicts in helper functions when imported types had names similar to locally defined types.

1.0.0 - 2016-11-14

Changed

  • Field names ToWire, FromWire, String, and for exceptions Error are now reserved. Override the names of these fields in the generated code with the go.name annotation.
  • Plugins: The version of ThriftRW used to compile the plugin is now matched against the version actually generating code.

0.5.0 - 2016-11-10

Added

  • A go.name annotation may now be specified to override the names of entities in the generated Go code. The annotation is supported for struct, union, and exception types, and their fields, enum types and enum items, and parameters of functions.
  • Plugins: Added a new Service.Name field which contains the name of field normalized per Go naming conventions. This, along with Function.Name may be used to build the names of the Args, Result, and Helper types for a function.

Changed

  • Breaking: Generated enums now have first-class JSON support. Enums are (un)marshalled from/to strings if possible with fallback to integer for unrecognized values.
  • Breaking: Args, Result, and Helper types for service functions are now generated in the same package as the user-defined types. These types are now named similarly to $service_$function_Args where $service and $function are the names of the Thrift service and function normalized based on Go naming conventions.
  • Code generation will abort if struct fields, after conversion to Go style names, are not unique in the structure.
  • Plugins: Renamed Service.Name to Service.ThriftName since it contains the name of the service as it appeared in the Thrift file.
  • Plugins: Constructors for Plugin and ServiceGenerator clients and handlers are now exposed in the same package as the interfaces.
  • Non-primitive types constants are now inlined in the generated Go code instead of being referenced in an effort to reduce the impact of user errors on the generated code. This is because non-primitive constants were previously implemented as global vars which might be modified by user code.

Removed

  • Plugins: Removed Service.Directory and Service.ImportPath because these are now same as the corresponding module.

0.4.0 - 2016-11-01

Added

  • Expose whether a function is oneway to plugins.
  • Expose the version of the library under go.uber.org/thriftrw/version.Version.
  • Generated code will test for version compatibility with the current version of ThriftRW during initialization.

Changed

  • Breaking: The compile API now exposes annotations made while referencing native Thrift types. This changes the TypeSpecs for primitive types from values to types.
  • The compile API now also exposes annotations for typedef declarations.
  • Generate args structs and helpers for oneway functions.

Removed

  • Breaking: Remove the --yarpc flag. Install the ThriftRW YARPC plugin from go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc and use --plugin=yarpc instead.

0.3.2 - 2016-10-05

Fixed

  • Fix import paths for code generated using --yarpc. Note that this flag will be removed in a future version.

0.3.1 - 2016-09-30

Fixed

  • Fix missing canonical import path to go.uber.org/thriftrw.

0.3.0 - 2016-09-29

Changed

  • Breaking: Renamed project to go.uber.org/thriftrw.
  • Breaking: Keywords reserved by Apache Thrift are now disallowed as identifiers in Thrift files.
  • Breaking: The Package field of the plugin.TypeReference, plugin.Service, and plugin.Module structs was renamed to ImportPath.

0.2.1 - 2016-09-27

Added

  • Plugin templates: Imports in generated code are now always qualified if the package name doesn't match the base name.

Fixed

  • Plugin templates: Fixed a bug where imports in templates would use the base name of the package even if it had a hyphen in it if it wasn't available on the GOPATH.

0.2.0 - 2016-09-09

Added

  • Added a -v/--version flag.

  • Added a plugin system.

    ThriftRW now provides a plugin system to allow customizing code generation. Initially, only the generated code for service declarations is customizable. Check the documentation for more details.

Changed

  • Breaking: The String() method for enum types now returns the name of the item as specified in the Thrift file.

Fixed

  • Breaking: Fixed a bug where all-caps attributes that are not known abbreviations were changed to PascalCase.

0.1.0 - 2016-08-31

Added

  • Initial release.