3 ms·
> The main downside I see is that its runtime code size footprint is much larger than Zod. Yes, it unfortunately really does bloat your bundle a lot, which is
by worble 1y ago
> The main downside I see is that its runtime code size footprint is much larger than Zod.
Yes, it unfortunately really does bloat your bundle a lot, which is a big reason I personally chose to go with Valibot instead (it also helps that it's a lot closer to zods API so it's easier to pickup).
Thanks for linking that issue, I'll definitely revisit it if they can get the size down.
- notpushkin 1y agoPersonally, I find Zod’s API extremely intimidating. Anything more resembling TypeScript is way better. ArkType is neat, but ideally we’d have something like: export reflect type User = { id: number; username: string; // ... }; Edit: just remembered about this one: https://github.com/GoogleFeud/ts-runtime-checks https://github.com/GoogleFeud/ts-runtime-checks
- ChocolateGod 1y agoIt's not perfect and doesn't cover all of zods functionality (iirc coercion) but I've used https://www.npmjs.com/package/ts-to-zod https://www.npmjs.com/package/ts-to-zod before to generate zod schemas directly from types.
- crabmusket 1y agoThis is why I like libraries like typia or typebox-codegen; I'd prefer to write TypeScript and generate the validation, rather than write a DSL.