Skip to content

Commit

Permalink
add caveat about the V1 protobuf API
Browse files Browse the repository at this point in the history
  • Loading branch information
jhump committed Aug 1, 2022
1 parent 25e6f5d commit 73d52db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ RPC services.

[![GoDoc](https://godoc.org/github.com/jhump/protoreflect?status.svg)](https://godoc.org/github.com/jhump/protoreflect)

----

### ⚠️ Note

This repo was built to work with the original "V1" API of the Protobuf runtime for Go: `github.com/golang/protobuf`.

Since the creation of this repo, a new runtime for Go has been release, a "V2" of the API in `google.golang.org/protobuf`. Most protobuf users have likely upgraded to that newer runtime and thus likely encounter some interop issues using this repo. In the meantime, you can often work around these issues using the [`proto.MessageV1`](https://pkg.go.dev/github.com/golang/protobuf/proto#MessageV1) and [`proto.MessageV2`](https://pkg.go.dev/github.com/golang/protobuf/proto#MessageV2) converter functions (both are defined in the V1 `proto` package).

We eventually want this repo to have much better interop with the V2 API. Here are the current goals:
1. _By EOY 2022_: Update the `desc.Descriptor` type in this repo to be a _wrapper_ around the `protoreflect.Descriptor` types in the V2 API. Also provide simple conversion functions to go from one to the other. This will likely resolve most of the issues that people encounter.
2. _H1 2023_: Create a new V2 of this whole repo. The V2 protobuf API now includes support for [descriptors](https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect) and [dynamic messages](https://pkg.go.dev/google.golang.org/protobuf/types/dynamicpb), and it also exposes numerous low-level aspects like the [binary wire format](https://pkg.go.dev/google.golang.org/protobuf/encoding/protowire). So a _lot_ of what's in this repo is no longer necessary. But some features still are, such as the `desc/builder`, `desc/protoprint`, `dynamic/grpcdynamic`, `dynamic/msgregistry`, and `grpcreflect` packages. These will remain in the V2 form of the repo (though possibly rearranged a little). Noticeably absent from the list above is `desc/protoparse`, whose V2 API will be in a brand new module named `protocompile`. It will be a much improved API, provide better performance, and directly use the reflection APIs in the v2 Protobuf runtime.

----
## Descriptors: The Language Model of Protocol Buffers

Expand Down

0 comments on commit 73d52db

Please sign in to comment.