πŸŽ‰
Connect-Swift has launched!You'll actually want to use Protobuf on iOS - generate idiomatic, modern Swift client APIs.
Get Started
Jan 4, 2023
4 min read

Protobuf-ES has reached version 1.0

Back in October, we announced the release of Protobuf-ES, an idiomatic Protocol Buffers library for TypeScript and JavaScript with full support for the ECMAScript standard.

Now, as we enter the new year, we are pleased to announce that Protobuf-ES has officially reached the v1.0 milestone!

Background

Protobuf-ES is a complete implementation of Protocol Buffers in TypeScript, suitable for web browsers and Node.js. Its goal is to serve as a modern Protobuf implementation for the JavaScript ecosystem.

A few of the features that set Protobuf-ES apart:

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 (.ts), JavaScript files (.js), and TypeScript declaration files (d.ts).

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 .js orΒ .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.

The plugin capabilities of Protobuf-ES are the first of their kind in the JavaScript / Protobuf ecosystem. The built-in 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-Web’s protoc-gen-connect-web.

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.

Alternatives

Although there are a number of alternatives to Protobuf-ES, none of them offer the same comprehensive suite of features:

Feature / Generatorprotobuf.jsts-protoprotobuf-tsprotoc-gen-tsProtobuf-ES
Standard pluginβŒβœ…βœ…βœ…βœ…
Conformance testsβŒβŒβœ…βŒβœ…
Fully tree-shakeableβŒβœ…βœ…βŒβœ…
Actively maintainedβŒβœ…βœ…βœ…βœ…
Vanilla JavaScript supportβœ…βŒβœ…βŒβœ…
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.

Community support

We would like to thank the community for the strong support we've received β€” Protobuf-ES is currently getting over 10K weekly downloads on NPM! All of the feedback and contributions have been extremely valuable. Our early adopters played a big role in helping us iron out the kinks and stabilize a product that we believe will become foundational for JavaScript and TypeScript development.

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! πŸŽ‰

Talk to our team about making your Protocol Buffers workflow easier.
Request a demo