> Not sure why this doesn't seem to be a common practice TBH, might be missing something.
Yeah... I've been deep in this problem space myself. The two big points of friction are:
1. Requiring a build-step to generate runtime code from the TS types
2. TS doesn't officially support compiler transforms that do it
Yeah... I've been deep in this problem space myself. The two big points of friction are: 1. Requiring a build-step to generate runtime code from the TS types 2. TS doesn't officially support compiler transforms that do it
That said, the two most promising approaches I've found so far: 1. https://github.com/GoogleFeud/ts-runtime-checks -- it does exactly what you describe 2. https://arktype.io/ -- a very interesting take on the Zod model, but feels like writing native Typescript
Congrats on the launch, really exciting to see a way to get capabilities into the JS ecosystem!