Zod v4 Beta
v4.zod.dev
Zod v4 Beta
1–10 of 48 posts
Re: Zod v4 Beta
#2Re: Zod v4 Beta
#3So, when I saw this post and read the first few paragraphs, I was filled with dread for having to do yet another major dependency update. Reading of all the improvements- surly the ‘breaking changes’ list must be massive.
Having read the full article, it seems like the breaking changes have been kept within reason. One major improvement that stands out to me is the improved Recursive types support, but there is certainly any number of improvements for others to be excited about.
The thing I enjoyed most is that excitement of the Arthur really shines throughout the whole article. I’m so thankful this library exists and is being lovingly maintained by someone who is genuinely interested in it.
Re: Zod v4 Beta
#4That said, we are slowly phasing out our React frontend for one of our apps page by page and replacing it with what we use over the rest of apps: Phoenix + Liveview. The changeset system for validations has proven itself time and time again to both be fast but also to handle many of the curly validation problems we might have. It also has barely changed since its release.
If you have a disciplined frontend team then you might be able to make it work. They have to be able to ignore the latest shiny thing that has come along, but if you don't then you'll have a team that is busy constantly upgrading to the latest shiny library rather than getting anything done.
Re: Zod v4 Beta
#5Re: Zod v4 Beta
#6Re: Zod v4 Beta
#7Re: Zod v4 Beta
#8v3 didn't last four years. Can we expect much different from v4?
If you're migrating your zod 3 code, I'd migrate to something more stable and long-lived than v4 is likely to be -- unless you want to be going through it all again in a few years (and yet again a few years after that, etc).
I don't blame the maintainers (I assume they don't have a fat support and maintenance contract)
But developers need to go in with their eyes open when it comes to adopting these throw-away libraries and frameworks.
Re: Zod v4 Beta
#9> Zod v3.0 was released in May 2021... v3 didn't last four years. Can we expect much different from v4? If you're migrating your zod 3 code, I'd migrate to something more stable and long-lived than v4 is likely to be -- unless you want to be going through it all again in a few years (and yet again a few years after that, etc). I don't blame the maintainers (I assume they don't have a fat support and maintenance contr…
For contrast: My entire company is less than 4 years old and any code from 6 months ago feels old because things (in a business requirements sense) change so fast. Zod lasting 3 years is fine.
Although I do wish v4 came a little sooner because we just started using Zod a few months ago.
Re: Zod v4 Beta
#10This is awesome, bundle size has been my number one issue preventing me from trying out Zod as v3 shipped with validations that were unnecessary for frontend use but weren't able to be treeshaken.