Skip to content

v0.10.0

Compare
Choose a tag to compare
@jhump jhump released this 08 Apr 13:49
· 137 commits to main since this release
a556a4b

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 and unverified_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, and sfixed64).

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.)
  • Add support for iterating option nodes in the ast sub-package via new ast.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 of ast.Node, so they also are now sub-interfaces of ast.NodeWtihOptions. The interfaces changed are ast.FileDeclNode, ast.MessageDeclNode, ast.FieldDeclNode, ast.OneofDeclNode, ast.RPCDeclNode, and ast.EnumValueDeclNode.
    • This also adds a method, ExtensionsNode, to the parser.Result interface, and expands the return types of three methods (OneofNode, EnumNode, and ServiceNode) from ast.Node to ast.NodeWithOptions.

Full Changelog: v0.9.0...v0.10.0