Protobuf-ES has reached version 1.0
Now, as we enter the new year, we are pleased to announce that Protobuf-ES has officially reached the v1.0 milestone!
A few of the features that set Protobuf-ES apart:
- ECMAScript module support
- First-class TypeScript support
- Generation of much smaller bundles
- Implementation of all proto3 features, including the canonical JSON format
- Implementation of all proto2 features, except for extensions and the text format
- Compatibility coverage via the Protocol Buffers conformance tests
- Descriptor and reflection support
After our October announcement, we invested time to polish the library and ensure everything was ready for v1.0. We fixed a few bugs, beefed up the documentation, and made some minor improvements behind the scenes. As we launch v1.0, the code and the APIs are stable - we take SemVer very seriously, and the burden for stability is on us, not on users.
Did you know?
One of the most intriguing features of Protobuf-ES is its comprehensive plugin framework which allows users to write their own code generator plugins for Protobuf to output TypeScript files (
.js), and TypeScript declaration files (
Generator functions can be specified for any of the 3 targets. Only the TypeScript generator is required, and the plugin framework can automatically transpile generated TypeScript files into the desired outputs if the
.d.ts generators are not provided. Additionally, these functions are able to retrieve any custom options specified in Protobuf files when generating code. More details on writing plugins can be found in the docs.
protoc-gen-es plugin is a complete decoupling of Protobuf message types from RPC types. Stated differently,
protoc-gen-es is a foundational plugin that can be used either standalone or in conjunction with other plugins that generate RPC types, such as Connect-ES’
To explore a few concrete examples, consider the official
protoc-gen-es plugin and an example of using the framework to create a Twirp plugin in the Protobuf-ES repo. Both provide a great starting point for understanding how these components fit together.
The framework is a powerful tool for users to create their own plugins and generate different kinds of outputs from Protobuf files. To get started writing your own plugin, visit the documentation.
Although there are a number of alternatives to Protobuf-ES, none of them offer the same comprehensive suite of features:
|Feature / Generator||protobuf.js||ts-proto||protobuf-ts||protoc-gen-ts||Protobuf-ES|
|Fast code generation||✅||✅||❌||❌||✅|
If you are currently using one of these and would like to give Protobuf-ES a try, please see our migration guide for some helpful tips.
Upgrade or try Protobuf-ES now
If you're a current Protobuf-ES user, we recommend upgrading now. If you haven't tried it yet, you can get started by visiting the Protobuf-ES repo (and docs), or by downloading it directly from NPM. For any questions or concerns, don't hesitate to reach out to us on Slack - we’re happy to help.
Again, a big thank you to all our contributors, and here's to a great 2023! 🎉