So stoked for the types returned by refine()!!! I was trying to write a small library to auto-generate form UI’s from zod schemas, which would be a massive time saver at work. So many internal forms.
But the types were really annoying to work with around .refine(). This’ll make life so much easier for zod-adjacent generics
Meta should also be helpful. I have done the same (form generation from Zod) but had to have weird flags to get more functionality from what Zod V3 has.
So many exciting things here, and my congratulations go out to the team!
However, I can't help but think that @zod/mini is a pointless waste of time. It's literally just an exact copy of Valibot which has 7.5k stars on its own. Why not just tell people to use that instead of making an entirely separate sub-library that they have to maintain?
39
u/chamomile-crumbs Apr 11 '25
So stoked for the types returned by refine()!!! I was trying to write a small library to auto-generate form UI’s from zod schemas, which would be a massive time saver at work. So many internal forms.
But the types were really annoying to work with around .refine(). This’ll make life so much easier for zod-adjacent generics
22
u/CupCakeArmy Apr 11 '25
So many sensible and nice features, this is awesome. No bs or unnecessary stuff
8
u/josh-ig Apr 12 '25
Nice update. Excited to see performance gains and JSON Schema support.
Typebox is still my personal go-to but Zod is everywhere these days it’s nice to see these updates.
3
u/floriandotorg Apr 12 '25
Wow, I’m impressed!
This fixes literally every minor gripe that I had with zod. Can’t wait to switch.
The only thing: Why does the pretty printer not give you the value that caused the error? Would be so helpful.
2
u/sickcodebruh420 Apr 12 '25
Every single item on this list is a banger. Update of the Year contender.
8
u/jessepence Apr 11 '25
So many exciting things here, and my congratulations go out to the team!
However, I can't help but think that
@zod/miniis a pointless waste of time. It's literally just an exact copy of Valibot which has 7.5k stars on its own. Why not just tell people to use that instead of making an entirely separate sub-library that they have to maintain?1
u/cstst Apr 12 '25
This is an amazing update. Very excited to test it out!
1
u/BCsabaDiy Apr 12 '25
Wow!
1
u/supersnorkel Apr 12 '25
Amazing!
1
u/rs_0 Apr 12 '25
Still can't abort further validation when the first error is encountered
1
u/hans_l Apr 12 '25
Is there any benchmark comparisons with AJV? Zod 3 was really far behind.
1
u/Alternative_Bake_823 Apr 13 '25
I try to use zod4 with shadcn use form. But I have error zod catch error in console and don't mark on form
1
u/getflashboard May 07 '25
Can't wait to use it!