Remote packages are now called "generated SDKs". See the documentation for more information.
We're excited to share an update to the Buf Schema Registry remote generation alpha - namely, that the alpha is ending, and we're approaching v1! Today, we're launching the release candidate for what we now call remote plugins and remote packages.
One of the greatest challenges with Protobuf code generation is the complexity of working with protoc
and plugins. Time and time again, we've heard that developers want the benefits of code generation, but struggle with the complex web of different compiler and plugin versions, and the varying runtime needs that plugins have across different languages. Managing and maintaining a stable environment locally on a single machine is hard enough.
Every organization and open-source project develops homegrown Protobuf tooling in an effort to maintain consistent output across developers. A handful of organizations might get a workable solution, but these remain brittle and difficult to maintain over time.
At Buf, we believe code generation is a key building block and the Protobuf ecosystem deserves a proper solution. With remote plugins, you no longer have to concern yourself with maintaining, downloading, or running plugins on your local machine. Using a plugin is as simple as referencing it in your buf.gen.yaml
:
version: v1
plugins:
# Use protoc-gen-go at v1.28.1
- plugin: buf.build/protocolbuffers/go:v1.28.1
out: gen/go
# Use the latest version of protoc-gen-go-grpc
- plugin: buf.build/grpc/go
out: gen/go
Just invoke buf generate
and you're done - no maintaining these plugins, no worrying about how to download or install them, just generate your stubs and get back to solving your real problems.
Protobuf is a fantastic way to programmatically define your APIs and generate away a lot of the common work we perform as software engineers to communicate across our services. Here at Buf, we believe the eventual promise of Protobuf is for us to stop publishing English-language API specs, and instead move to generated SDKs that we all consume.
Remote packages is the movement towards this promise. With remote packages, Buf will take your modules and Protobuf plugins, add a little elbow grease, and generate full-serve packages for you to consume just like any third-party library in your native programming language. This means you don't have to worry about Protobuf code generation at all - you can push modules to the BSR and install code stubs generated from those modules using dependency management tools like npm
and go
.
Go
# Get the Connect client and server packages for the
# buf.build/connectrpc/eliza module
$ go get buf.build/gen/go/connectrpc/eliza/connectrpc/go
NPM
# Install the Connect client packages for the
# buf.build/connectrpc/eliza module
$ npm config set @buf:registry https://buf.build/gen/npm/v1
$ npm install @buf/connectrpc_eliza.bufbuild_connect-web
The response to the remote generation alpha has been phenomenal and usage has exploded:
buf generate
requests that use remote plugins. Y'all generate a lot of stuff!When we launched the remote generation alpha about a year ago, we never would have expected this type of adoption. It's great to see people recognize the benefits of consistent code generation - whether using remote plugins with buf.gen.yaml
, or fetching generated SDKs with popular package managers like Go and NPM.
We've talked to many of you to gather feedback. Some of what we've learned:
After a ton of work by the Buf team, we're ready to present our new remote plugins and remote packages experience that address all of these concerns and more. Some highlights:
Check out the full docs for additional details on remote plugins and remote packages.
Obviously, all of this is a major change, and not everything is compatible with the remote generation alpha. However, do not worry - we're keeping the remote generation alpha working until April 30, 2023 to give you time to migrate. For more details, see the documentation on migration to remote plugins and migration to remote packages.
We've covered many of the plugins the Protobuf community uses day-to-day, but if there's another plugin you think we should maintain and host, file an issue for us on github.com/bufbuild/plugins, we'd love to hear from you!
Our goal is to help move the Protobuf community forward for everyone, and we'll continue to do everything we can to help you. Again, thank you so much for all the support you've given us - it means a lot.
For any questions or concerns don't hesitate to reach out to us on Slack - we'd love to hear from you!