Skip to content

v1.18.0

Latest

Choose a tag to compare

@jhump jhump released this 20 Jan 22:06
19645dd

This is expected to be the final release of this module with a v1.x version. (All subsequent releases are expected to be v2.x.)

The main change here is to insulate users from any future backwards-incompatible changes in bufbuild/protocompile. Previous releases (between 1.15 and 1.17, inclusive) depended on this module, but it hasn't yet released a stable v1.0 version, so it has occasionally been a turbulent dependency. More breaking changes are expected since it is expected to get a totally new compiler and API before it reaches v1.0. So anyone still using v1 of this repo should update to this new release before then to avoid being broken when that happens.

"github.com/jhump/protoreflect/desc/builder"

Changes/fixes:

  • If resolving custom options and extensions resulted in a generated extension description created by the older v1 of protoc-gen-go, a nil-dereference panic could occur. This has been fixed. Instead, the legacy extension that would otherwise have caused a panic will now either be ignored or, if BuilderOptions.RequireInterpretedOptions is set to true, result in an error that not all options could be interpreted.
    • The older v1 has import path "github.com/golang/protobuf/protoc-gen-go". It was replaced in 2020 by the v2, which is at path "google.golang.org/protobuf/cmd/protoc-gen-go".

"github.com/jhump/protoreflect/desc/protoparse"

Changes/fixes:

  • The internal compiler no longer comes from a separate Go module. Instead, this module now contains a fork of bufbuild/protocompile, which will maintain stability even when the upstream repo diverges with unstable/breaking changes. The only user-visible changes would be related to Editions support, thanks to unreleased changes in upstream that were included in this repo's fork. (See more below.)

Additions:

  • This adds a field named AllowExperimentalEditions to the protoparse.Parser struct. When set to true, the parser will accept and return descriptors for files that use Edition 2024 (the only experimental edition at this time). It is experimental because it does not implement all of the rules and semantics of Edition 2024. But it does provide the ability to parse and compile files that include new language features in Edition 2024, such as visibility modifiers (export and local) as well as the option import modifier.

"github.com/jhump/protoreflect/desc/protoprint"

Changes/fixes:

  • If resolving custom options and extensions resulted in a generated extension description created by the older v1 of protoc-gen-go, a nil-dereference panic could occur. This has been fixed. Instead, the legacy extension that would otherwise have caused a panic is ignored and will not be included in the printed output (since it would result in an invalid source file that could not be compiled).