3 ms·
It’s pretty rad how flexible template literal types are, but I can’t imagine wanting this kind of shenanigans hanging out in a production app slowing down compi
by jitl 2y ago
It’s pretty rad how flexible template literal types are, but I can’t imagine wanting this kind of shenanigans hanging out in a production app slowing down compile times. I prefer to define types in TypeScript and generate proto from that, since the TypeScript type system is so much more powerful than the Protobuf system. Types are much more composable in TS.
- tantalor 2y agoWhat do you use to go from ts->pb?
- deleted 2y ago[deleted]
- jitl 2y agoI have an old public version here: https://github.com/justjake/ts-simple-type/blob/main/src/compile-to/proto3.ts https://github.com/justjake/ts-simple-type/blob/main/src/com... Ultimately i decided ts-simple-type is too difficult to maintain, so now I just use the TypeScript compiler API directly to introspect types and emit stuff, but most of that code is private to Notion Labs Inc
- h1fra 2y agoCan you run Doom in a Typescript string template?