Should TypeScript support runtime types instead of relying on Zod?

2 pointsposted 6 hours ago
by emykhailenko

1 Comments

emykhailenko

6 hours ago

I recently noticed how much code is spent simply producing an enormous amount of Zod schemas and unit tests around them. Yeah, I know someone will say that people don't read code anymore anyway. But I do. I still like code, and I still have doubts about the quality of coding agents, but that's another topic ;)

Long story short, I experimented with the TypeScript compiler and built a small playground showing how I imagine runtime types could work in TypeScript.

https://nola.sh/playground/?example=types