v0.10.0
This release marks significant progress in implementing Protobuf Editions. Editions are not yet generally supported because there are a couple of remaining checks that need to be done. Until then, users can opt-in to using Editions source files with this compiler using the editionstesting.AllowEditions
function.
This release also includes some backwards-incompatible changes, though they likely will not have any impact on most users. They are changes to interfaces that are compatible for users/callers of the interface, but incompatible for any code outside of this repo that implemented those interfaces.
What's Changed
Bugfixes
- In the recently added
options.StripSourceRetentionOptionsFromFile
, clear options if no fields remain and also clear source code info, in #251 - This repo previously allowed some sources that
protoc
would reject, due to incomplete validation of options. These checks were added in #264:- Non-lite files may not import lite files. (A lite file is one that uses option
optimize_for=LITE_RUNTIME
.) - Extensions in a lite file may not extend messages in a non-lite file.
- Field options
lazy
andunverified_lazy
can only be set to true for message fields. - Field option
jstype
can only be customized for 64-bit integer fields (int64
,uint64
,sint64
,fixed64
, andsfixed64
).
- Non-lite files may not import lite files. (A lite file is one that uses option
Enhancements
- Editions-related updated:
- Update descriptor implementations to work with Editions files, in #260, #261, and #270
- Add more internal compiler support for Editions, in #264
- Provide an exported function for users to opt-in to using Editions, in #267. Note that this capability is temporary and will be removed once Editions support is complete (since opt-in won't be necessary and Editions support will be generally available).
- Support and enforce extension declarations, in #263
Other Changes
- Remove feature related to "canonical bytes", in #261
- This is a backwards-incompatible change, but only impacts a likely-unused feature. The method
linker.Result.CanonicalProto()
has been removed. This feature was too complicated to continue supporting in the face of changes to interpreting options that needed to be implemented for Editions. (The feature was ultimately never used for its original intended purpose, so is likely not used at all.)
- This is a backwards-incompatible change, but only impacts a likely-unused feature. The method
- Add support for iterating option nodes in the
ast
sub-package via newast.NodeWithOptions
interface, in #263- This is a backwards-incompatible change, but only impacts code that implements some of this repo's interfaces, not any code that merely uses those interfaces.
- This adds a new
RangeOptions
function to several sub-interfaces ofast.Node
, so they also are now sub-interfaces ofast.NodeWtihOptions
. The interfaces changed areast.FileDeclNode
,ast.MessageDeclNode
,ast.FieldDeclNode
,ast.OneofDeclNode
,ast.RPCDeclNode
, andast.EnumValueDeclNode
. - This also adds a method,
ExtensionsNode
, to theparser.Result
interface, and expands the return types of three methods (OneofNode
,EnumNode
, andServiceNode
) fromast.Node
toast.NodeWithOptions
.
Full Changelog: v0.9.0...v0.10.0