News for hackers. Stuff that matters.
Re:Zod 4 by neilpa on Monday May 19, 2025 @11:39AM (#44030995)
We're currently evaluating both Zod and ArkType as a replacement for earlier JSON schema validations. The thing I can't get over with Zod is the syntax is _so_ different from defining TS types.

Are there reasons to go with Zod over ArkType?

Re:Zod 4 by satvikpendem on Monday May 19, 2025 @11:58AM (#44031212)
We also chose ArkType after evaluating Zod, Valibot, and Effect Schema, among others. It seemed to have the best developer experience while also being much faster. It also supports the Standard Schema project which I believe Effect Schema does not fully support.
Re:Zod 4 by bjacobso on Monday May 19, 2025 @12:16PM (#44031411)
I believe Effect Schema fully supports Standard Schema, the issue is that it supports much more than Standard Schema, so not all schemas will work and thus provide compile time errors.
Re:Zod 4 by satvikpendem on Monday May 19, 2025 @12:21PM (#44031457)
Yes that's correct, it's more powerful but we wanted to maintain full compatibility just for the future as well. But if you're all in on the Effect ecosystem, it's quite nice.
Re:Zod 4 by sesm on Monday May 19, 2025 @12:24PM (#44031490)
Does ArkType support generating data from schema?
Re:Zod 4 by mapcars on Monday May 19, 2025 @01:35PM (#44032409)
Could you elaborate on how exactly do you use these? I was assuming its for some kind of contract testing, but there are mentions of bundle size, is it used on fetching data to fail early if the format is wrong, something like that?
Re:Zod 4 by CharlieDigital on Monday May 19, 2025 @11:44AM (#44031049)
You might like Typia better.

I recently put together a deck for this after some investigation: https://docs.google.com/presentation/d/1fToIKvR7dyvQS1AAtp4Y...

Re:Zod 4 by fkyoureadthedoc on Monday May 19, 2025 @11:49AM (#44031099)
On the ArkType website they talk about speed and DX, but no mention of bundle size. I assume, and maybe this is an unfair assumption, that's because it's bad. I haven't come across ArkType until just now, but I was just checking out Valibot today because it's got a small bundle size.
Re:Zod 4 by colinmcd on Monday May 19, 2025 @02:31PM (#44033122)
These numbers don't reflect anything useful. This is the total size of the code in the package, most of which will be tree-shaken. In Zod's case, the package now contains three independent sub-libraries. I recommend plugging a script into bundlejs.com[0] to see bundle size numbers for a particular script

[0] https://bundlejs.com

Re:Zod 4 by petesergeant on Monday May 19, 2025 @11:54AM (#44031154)
Everyone else is using Zod so the LLMs understand it well, there’s a big ecosystem, it’s unlikely to disappear overnight, and new hires may well already use it. It’s the boring solution.