Live data from Hacker News

Zod v4 Beta

v4.zod.dev

31–40 of 48 posts

Re: Zod v4 Beta

#31

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…

So I guess your team is busy upgrading to the latest shiny Phoenix + Liveview version rather than getting anything done?

Re: Zod v4 Beta

#32

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…

> "a team that is busy constantly upgrading to the latest shiny library rather than getting anything done"

Your disdain for resume-driven development is fair enough, but it's not like there's a binary choice between Phoenix/LiveView and spinning your wheels chasing the new shiny.

Re: Zod v4 Beta

#33

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

I use it in a fairly big project. The only breaking change for me was z.record() now requiring two parameters, previously the second parameter was optional. The rest are deprecations that can be easily fixed like .email, etc.

Re: Zod v4 Beta

#35

I completely understand TypeScript, Zod not so much. The context here is performance. My understanding is that Zod performs synchronous operations to validate the schemas. Something about "using the tool correctly" resonates here. Maybe don’t validate very large and nested schemas frequently and things like that. But I can’t help but think it is adding another layer of potential footguns that you have to be mindful a…

> I completely understand TypeScript, Zod not so much

Different tools. I only use TS but once you add external data to the mix you cannot escape `any` and `unknown` — so what you do is use `as`. Congrats, your types are now useless.

Zod would close that gap as it enforces types on external resources (e.g. `fetch` or `readFile`)

Re: Zod v4 Beta

#36

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…

What’s the app? Would you mind sharing ?

Re: Zod v4 Beta

#37
post #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.

That sad truth is the best apps with modern frontend quality are just flurry of bad code dirty typescript and react

Re: Zod v4 Beta

#38
post #26

Earlier quoted context omitted.

> 4 years in JavaScript land is actually pretty long For non-JS developers to get a sense of how long this is, companies have probably migrated from React to Vue to Svelte to Solid and then back to React in this time.

Did they get any useful work done in that time, or just learn new frameworks? That sounds like a form of hell.

Be serious, devs doing only useful work would lead to absolutely massive layoffs.

Re: Zod v4 Beta

#39
post #35

I completely understand TypeScript, Zod not so much. The context here is performance. My understanding is that Zod performs synchronous operations to validate the schemas. Something about "using the tool correctly" resonates here. Maybe don’t validate very large and nested schemas frequently and things like that. But I can’t help but think it is adding another layer of potential footguns that you have to be mindful a…

> I completely understand TypeScript, Zod not so much Different tools. I only use TS but once you add external data to the mix you cannot escape `any` and `unknown` — so what you do is use `as`. Congrats, your types are now useless. Zod would close that gap as it enforces types on external resources (e.g. `fetch` or `readFile`)

That's not necessarily true.

You can write type assertion functions that validate the input is a given shape.

In theory, you'd use these type assertion methods at any API boundaries a single time for external inputs/outputs in a "Parse, Don't Validate" approach to cover your bases.

Re: Zod v4 Beta

#40
post #35

Earlier quoted context omitted.

> I completely understand TypeScript, Zod not so much Different tools. I only use TS but once you add external data to the mix you cannot escape `any` and `unknown` — so what you do is use `as`. Congrats, your types are now useless. Zod would close that gap as it enforces types on external resources (e.g. `fetch` or `readFile`)

That's not necessarily true. You can write type assertion functions that validate the input is a given shape. In theory, you'd use these type assertion methods at any API boundaries a single time for external inputs/outputs in a "Parse, Don't Validate" approach to cover your bases.

Soooo exactly what Zod is doing?
Post reply on HN