Protobuf-ES: Protocol Buffers TypeScript/JavaScript runtime
I&#x27;m seeing  a lot of comments here along the lines of &quot;why even bother with protobuf (just use JSON, you fools!), and gRPC is a pain anyway!&quot;  There are two very very critical things to know if you find  yourself thinking either of those two things:<p>1. To me the compression that protobuf offers, while cool, is not what I find most important about it (or, rather, is not the feature that I like the most).  What is the most important (for me) is that the sterilization _forces your server and client to have a typed API contract_.  This is a pretty big deal.  Imagine you&#x27;re in a situation where you spent months laboring over your OpenAPI config, just to later realize that<p>&gt; _oops! my OpenAPI config doesn&#x27;t actually represent what my server is actually doing, and now my OpenAPI generated user documentation is wrong, and my TypeScript types I generated from the OpenAPI config are wrong too, which means I&#x27;ll get runtime `TypeError`s on the frontend.<p>This is a pretty common situation for people to find themselves in, and it&#x27;s a tough spot to be in because... well... you can&#x27;t ever escape.  Because no one is really reliably generating actual running servers from OpenAPI configs, you hit this situation reallllly fast.  Protobuf, on the other hand, is legitimately a spec-first workflow (by force -&gt; which to me is a very good thing).  Take a look at Postman&#x27;s state of the API report, and you&#x27;ll see that even their customers are only doing spec-first 10% of the time (and, this is supposed to be the cream of the crop in cutting-edge spec-first development).  Why? Because it&#x27;s really really really hard to do in practice.  But protobuf makes it easy.  That&#x27;s a big deal.<p>2. gRPC and protobuf are not as deeply tied as you might think.  You can use protobuf without gRPC at all, and in fact a lot of people are doing this.  You can even do it over WebSockets, or anything else.  Unfortunately, because the two technologies are often mentioned in the same breath we tend to deeply associate them.  Years ago I had a project I needed to pick a wire compression thing for (it was just for fun) and since I was tired of always just using messagepack over and over again, I evaluated other options.  I picked FlatBuffers in the end, but I wish I could go back in time and ask my past self why I didn&#x27;t pick Protocol Buffers instead.  I KNOW I remember looking into protobuf, but I think I just assumed that in order to do protobuf well you had to also use gRPC and since I wasn&#x27;t up for learning gRPC, I gave up on protobuf.  That&#x27;s the beauty of what tools like Protobuf-ES are changing -&gt; they&#x27;re making protobuf accessible to everyone.<p>..and besides, there are other things that protobuf unlocks(namely the &quot;reflection&quot; API (very much like GraphQL&#x27;s introspection API if you&#x27;re familiar with that), but also things like documentation generation and enforcement of backwards-compatible changes) but the above are the two most appreciated by me.