Live data from Hacker News

Zod v4 Beta

v4.zod.dev

11–20 of 48 posts

Re: Zod v4 Beta

#11
post #8

> 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…

I didn’t exactly see a litany of breaking changes here…

In fact, zod is one of the leading forces behind this: https://github.com/standard-schema/standard-schema

A major version increase in four years doesn’t exactly scream “throw-away” to me.

Re: Zod v4 Beta

#12
post #8

> 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…

Zod has only been around as 1.0 since 2020, so it's probably not a project with enough history you'd have been interested in for many more years yet anyways.

Of course the bigger question here for most is how large are the breaking changes, not if there is a decade between them.

Re: Zod v4 Beta

#13
post #8

> 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…

This seems unnecessarily cynical, 4 years is a pretty long time to go between major versions for a library like this, and if you look at the breaking changes they're not exactly severe. This isn't a React Router situation where you need to re-write your whole app.

> I don't blame the maintainers (I assume they don't have a fat support and maintenance contract)

What's the implication here?

Re: Zod v4 Beta

#14
post #8

> 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…

So what you're saying is that people need to be aware of software being an iterative process and that maintainers of libraries can't know in advance all the things that might come up in 4 years time?

I don't know of any software that doesn't have these problems. Either you snapshot a thing and never do updates or you continually update it and have things change.

The update causes almost 0 breaking changes. I don't think this classifies as a "throwaway" library.

Re: Zod v4 Beta

#15
post #8

> 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…

This is a little disingenuous. As far as I know, v3 isn't going anywhere. There's what... weeks until May 2025, which would be four years?

4 years in JavaScript land is actually pretty long. Zod has a pretty good maintenance record. I don't see how a statement like yours can be made without snark. Calling it a "throw-away" library is pretty brash.

This looks like a good update that sticks to the formula.

Re: Zod v4 Beta

#16
Zod is installed in nearly every project I use. It’s an essential part of my toolkit. I adore this library. It near perfect as-is and these additions make it even better. Thanks for all the hard work.

Re: Zod v4 Beta

#17

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 b…

We’ve been using LiveView for years now and I still really miss the ergonomics that you get with typescript.

A lot of that is going away with better LSP support and better LLM suggestions.

But elixir and LiveView are generally great (I LOVE ecto), but building component frameworks and component communication still feels a bit janky.

Re: Zod v4 Beta

#18
Surprised not to see more people ask about performance profile of v4.

Zod is great in terms of API, but a no-go in terms of performance.

We ended up writing babel plugins (https://github.com/gajus/babel-plugin-zod/) and using it along with zod-accelerator, which improves performance, but breaks in various edge-cases.

Re: Zod v4 Beta

#19

Zod is installed in nearly every project I use. It’s an essential part of my toolkit. I adore this library. It near perfect as-is and these additions make it even better. Thanks for all the hard work.

I used to use Zod until I realised it’s rather big (for many projects this isn’t an issue at all, but for some it is). Now I use Valibot which is basically the same thing but nice and small. I do slightly prefer Zod’s API and documentation, though.

Edit to add: aha, now I read further in the announcement, looks like @zod/mini may catch up with valibot -- it uses the same function-based design at least, so unused code can be stripped out.

Re: Zod v4 Beta

#20
post #18

Surprised not to see more people ask about performance profile of v4. Zod is great in terms of API, but a no-go in terms of performance. We ended up writing babel plugins ( https://github.com/gajus/babel-plugin-zod/ ) and using it along with zod-accelerator, which improves performance, but breaks in various edge-cases.

I guess people are not asking because the article contains benchmarks
Post reply on HN