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
- 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 field compilation to allow fields with similar looking names and different casing.
1.20.0 - 2019-06-12
- 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 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
- Sets now support a
(go.type = "slice")
annotation to be generated as slices rather than maps.
1.18.0 - 2019-03-28
Ptr
methods for primititve typedefs.
1.17.0 - 2019-03-15
- Imports in generated code are now always named imports.
1.16.1 - 2019-01-23
- 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
- Expose Thrift file names, package prefix, and Thrift root directory to plugins.
- plugin: Library version matching was dropped.
1.15.0 - 2019-01-14
- Generated
Get*
andIsSet*
methods on structs are now nil-safe.
1.14.0 - 2018-10-18
- Structs now include
IsSet*
methods for fields that can be nil.
1.13.1 - 2018-10-04
- 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
- 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
orzapcore.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
andUnmarshalText
now round-trips, even if the enum value is unrecognized.
- 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
- 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.
- gen:
NewGenerator
is now usable from other packages.
1.11.0 - 2018-03-27
- Plugins now have access to service and function annotations.
1.10.0 - 2018-01-11
- 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
- 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
- Plugins: Annotations declared on user-defined types are now exposed on
TypeReference
.
- 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
- 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
- Structs now include getter functions for primitive types.
- Fields of generated struct types are now tagged with easyjson-compatible
required
tags.
- Fixed code generation bug for default values of fields with a
typedef
type.
1.5.0 - 2017-08-03
- Code generated by ThriftRW now conforms to https://golang.org/s/generatedcode.
- Removed gomock and testify from Glide imports to test imports.
1.4.0 - 2017-07-21
- 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
- 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.
- Plugins: Template output is now compliant with gofmt.
1.2.0 - 2017-04-17
- The Thrift IDL is now embedded withing the generated package. It is accessible via the package global ThriftModule.
1.1.0 - 2017-03-23
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.
- Handle
nil
values in generatedString()
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
- Field names
ToWire
,FromWire
,String
, and for exceptionsError
are now reserved. Override the names of these fields in the generated code with thego.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
- 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 withFunction.Name
may be used to build the names of theArgs
,Result
, andHelper
types for a function.
- 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
, andHelper
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
toService.ThriftName
since it contains the name of the service as it appeared in the Thrift file. - Plugins: Constructors for
Plugin
andServiceGenerator
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
var
s which might be modified by user code.
- Plugins: Removed
Service.Directory
andService.ImportPath
because these are now same as the corresponding module.
0.4.0 - 2016-11-01
- 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.
- Breaking: The
compile
API now exposes annotations made while referencing native Thrift types. This changes theTypeSpec
s for primitive types from values to types. - The
compile
API now also exposes annotations fortypedef
declarations. - Generate args structs and helpers for oneway functions.
- Breaking: Remove the
--yarpc
flag. Install the ThriftRW YARPC plugin fromgo.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc
and use--plugin=yarpc
instead.
0.3.2 - 2016-10-05
- 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
- Fix missing canonical import path to
go.uber.org/thriftrw
.
0.3.0 - 2016-09-29
- 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 theplugin.TypeReference
,plugin.Service
, andplugin.Module
structs was renamed toImportPath
.
0.2.1 - 2016-09-27
- Plugin templates: Imports in generated code are now always qualified if the package name doesn't match the base name.
- 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 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.
- Breaking: The
String()
method forenum
types now returns the name of the item as specified in the Thrift file.
- Breaking: Fixed a bug where all-caps attributes that are not known abbreviations were changed to PascalCase.
- Initial release.