What does HackerNews think of ts-proto?

An idiomatic protobuf generator for TypeScript

Language: TypeScript

#43 in TypeScript
Re libraries incompatible with certain typescript versions - e.g. protobufjs fix - it’s been my experience that you want to try and only use compilers specific to each library and compile libraries separately. It’s unfortunate but the JS community often tries to run all JS for a project through the same single compiler tool chain, using one global version of the compiler instead of relying on and effectively linking the JS output for each library. Unless you routinely rewrite third-party libraries to match your toolchain’s expectations, you’re going to have a hard time doing that.

For a library that generates code, that’s a special case, as the code it generates must target a particular language version. You have three choices: 1. Upstream a fix as you propose; 2. Side-by-side install both TS 4.6 and TS 4.7 using workspaces or sub-projects and have some of your code compile with 4.6 and then link the results or 3. Find a replacement that is updated to 4.7. For example, https://github.com/stephenh/ts-proto has 4.7 support listed in its readme.

Curious to see their typescript implementation and how it compares with https://github.com/stephenh/ts-proto which works great for grpc-web.
> older features of typescript [...] protobufjs generated typescript

FWIW I have a used-in-production project that generates idiomatic TypeScript types for protobuf:

https://github.com/stephenh/ts-proto

As a disclaimer, it assumes you use Twirp for any RPC impls, merely b/c that is what we used, and so it needs a config flag to turn that off + also eventual support for canonical GRPC-style RPC.

And also the docs/install/setup all need polished, but feel free to file issues / PRs if you try it.