4 ms·
I’m interested in these “gRPC but we care about devs outside of Google” kind of libraries! I see you’re working on generating idiomatic Typescript from Proto3
by jitl 4y ago
I’m interested in these “gRPC but we care about devs outside of Google” kind of libraries!
I see you’re working on generating idiomatic Typescript from Proto3 - but have you thought about generating Proto3 from Typescript? At Notion we have 1000s of lines of TS types and many TB of JSON stored in those shapes already. Rewriting all that to Protobuf by hand is kinda a non-starter. So we need to go the other direction at least initially.
I started on a Typescript type -> Proto3 compiler that’s very much still in the “toy” stage. I’m also working on compiling Typescript typed to Thrift, JSOMSchema and Python; I plan to experiment with Kotlin as well after the Proto3 target is a little less janky.
My work in progres branch is here, in case this is useful or you want to collaborate!
Proto3 compiler: https://github.com/justjake/ts-simple-type/blob/jake--compilers-as-features/src/compile-to/proto3.ts https://github.com/justjake/ts-simple-type/blob/jake--compil...
Example input and output: https://github.com/justjake/ts-simple-type/blob/jake--compilers-as-features/test/snapshots/compiler.spec.ts.md#compile-toproto3-compile-testts-to-proto3 https://github.com/justjake/ts-simple-type/blob/jake--compil...