Description
What is happening with Rust implementation
In summary, protoc-gen-ts continues to generate TypeScript code from proto files. However, there has been a shift from TypeScript to Rust in the project. This change is explained in more detail in the accompanying issue for the switch, citing reasons for the transition.
Implementation of protoc-gen-ts in JavaScript
- javascript was hard to maintain and test due to slowness of tsc
- the
typescript
package a peer dependency of protoc-gen-ts which broke the plugin if a wrong version was used. See npm package needs publishing to include fix for typescript >= 5 #225 It fails on Windows #86 - generation speed of protoc-gen-ts was affected by NodeJS runtime performance.
- depending on the typescript ast limited us is number of ways
- it was impossible to get concurrency into the plugin.
- javascript implementation did not pass the protobuf conformance tests.
- typescript wasn't truly type safe
Implementation of protoc-gen-ts in Rust
- concurrency built into the plugin
- utilizing swc/ast APIs instead of tsc/ast APIs.
- blazingly fast and easy to test
- successfully passes conformance tests
- truly type safe
- capable of emitting both JS and TS thanks to swc.
- eliminated whole class of issues that caused by NodeJS
Note
the plugin written is javascript is still the latest version published in npm, and it will stay that way for a while to avoid breaking people's code.
you can try out the protoc-gen-ts written in rust by running npm install @thesayyn/protoc-gen-ts@0.0.0-7a6a547
Caution
However, the protoc-gen-ts using Rust as its programming language should not affect the users, they will continue installing the plugin protoc-gen-ts
.
But beware that protoc-gen-ts switching to Rust changed the emitted code in number of ways, please try the new plugin and report the issues back.