[HN Gopher] Zod v4 Beta
       ___________________________________________________________________
        
       Zod v4 Beta
        
       Author : mycroft_4221
       Score  : 72 points
       Date   : 2025-04-12 21:03 UTC (1 hours ago)
        
 (HTM) web link (v4.zod.dev)
 (TXT) w3m dump (v4.zod.dev)
        
       | aleksiy123 wrote:
       | All I can say is looks really good.
        
       | move-on-by wrote:
       | I only use Zod in a single library, so my experience with it is
       | pretty minimal. One thing I have really enjoyed with it is the
       | low maintenance.
       | 
       | So, 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.
        
       | Rodeoclash wrote:
       | We stuck with Yup and ignored Joi, Zod and god knows what else
       | has come down the pipeline since. Rather than wasting time
       | upgrading, we've instead built useful features.
       | 
       | That 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.
        
       | mary-ext wrote:
       | This 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.
        
       | _fat_santa wrote:
       | My team has been building a greenfield SaaS app for the past ~9
       | months and when we started, we went all in on Zod and so far the
       | experience has been pretty fantastic. Zod is very intuitive to
       | use and being able to generate typescript types off the schemas
       | is very useful. Though with that said if you're already using Yup
       | or Joi I don't recommend switching as there's just not enough of
       | a reason to switch over.
        
       | cjonas wrote:
       | I've really enjoyed typebox. Any reason to check out zod v4?
        
       | jmull wrote:
       | > 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 contract)
       | 
       | But developers need to go in with their eyes open when it comes
       | to adopting these throw-away libraries and frameworks.
        
       ___________________________________________________________________
       (page generated 2025-04-12 23:00 UTC)