1. Fancy combo of build and compile time generics generated all of our libraries
2. Tooling ran over return values from the generic definitions and created the schema
I rewrote it and now everything is defined in JSON files and those JSON files are ran through a code generator that creates our exported libraries, and we still generate the schema based on the TS exports.
Having everything defined in JSON then allowed us to write tooling on top of the JSON to make changes to our libraries.
Protobuf v3 is horrible, had to start using it recently. The type system is so anemic, it is a joke how hard it is to model things in it.
JSON schema is more powerful than TS, and TS is orders of magnitude more powerful than what can be expressed in PB.
The original generics code was super cool, and obscenely succinct, but it wasn't amenable to being auto generated.
1. Fancy combo of build and compile time generics generated all of our libraries 2. Tooling ran over return values from the generic definitions and created the schema
I rewrote it and now everything is defined in JSON files and those JSON files are ran through a code generator that creates our exported libraries, and we still generate the schema based on the TS exports.
Having everything defined in JSON then allowed us to write tooling on top of the JSON to make changes to our libraries.
Protobuf v3 is horrible, had to start using it recently. The type system is so anemic, it is a joke how hard it is to model things in it.
JSON schema is more powerful than TS, and TS is orders of magnitude more powerful than what can be expressed in PB.
The original generics code was super cool, and obscenely succinct, but it wasn't amenable to being auto generated.