Skip to content

v2.0.0-beta.2

Pre-release
Pre-release
Compare
Choose a tag to compare
@jhump jhump released this 14 Sep 01:41
· 1 commit to main since this release
d7318a2

This is a pre-release for an upcoming v2.0.0 of this module.

Once we have more test coverage we'll create a proper release candidate, but for now we're considering this a "beta" of the next iteration of this repo.

(Note: there was also a v2.0.0-beta.1 tag, but it should be ignored, hence there being no release information associated with it.)

What's Changed?

A lot has changed!

This version finally drops the use of the old "v1 API" of the Protobuf Runtime for Go (github.com/golang/protobuf) and instead is built on the current "v2 API": google.golang.org/protobuf.

The v2 API introduced support for descriptors, reflection, and dynamic messages into the core runtime. That means several packages from v1 of this repo no longer exist.

Removed Packages

These packages were marked deprecated in v1.17.0. They have all been dropped for v2. See the list below for suitable replacements:

Renamed/Moved Packages

The other functionality in v1 of this module, the stuff that is retained in v2, has been moved around. Because the desc and dynamic directories were removed (since they were home to now-removed packages), most other packages have been shuffled around a little:

New Packages

  • github.com/jhump/protoreflect/v2/protodescs
    This package provides a few random helpers for working with descriptors and descriptor protos.

  • github.com/jhump/protoreflect/v2/protomessage
    This package provides some helpers for working with proto messages.

  • github.com/jhump/protoreflect/v2/protoresolve
    This package provides numerous nominal interface types for kinds of "resolvers". Resolvers are types that can answer queries about descriptors. This package also provides a *Registry type, which builds on the standard API's *protoregistry.Files and *protoregistry.Types types and provides new functionality:

    • It is thread-safe and can be used from multiple goroutines.
    • It can track the original descriptor proto from which a descriptor was built. This allows more convenient and efficient access than have to re-construct the descriptor proto (via the standard runtime's protodesc package).
    • It is a single value that can be used to query for descriptors as well as extension and message types. (The type implementations provided are all dynamic types.)

    This package has the broadest new API and is the most likely to potentially change between this beta and a final v2.0.0 release.

  • github.com/jhump/protoreflect/v2/sourceloc
    This package provides several helpers for working with instances of protoreflect.SourceLocation and protoreflect.SourcePath.