Earlier quoted context omitted.
How do you even migrate incrementally? why keep both old and new code together like a Frankeinstein project? Especially on a codebase you own. It's a library, not a platform.
Yeah, importing two versions could allow you to pass v3 objects to v4 methods and vice versa, and that seems like an extremely bad idea (if it would even type-check / run).
Zod 4
241–250 of 260 posts
Re: Zod 4
#242Earlier quoted context omitted.
I might be blindsided by using npm exclusively for years by this point, but what would be a better way to support iteratively migrating from v3 to v4 without having to do it all in one large batch?
Using npm's built in support for package aliases to simultaneously install zod@3 as zod and zod@4 as zod-next? Edit: reading the rationale, it's about peer dependencies rather than direct dependencies. I am still a little confused.
Re: Zod 4
#243Earlier quoted context omitted.
Zod has nothing to do with SPAs and isn't just a frontend tool. Do you not validate inputs in your code?
Laravel/Livewire handles it. I have no idea why something like Zod should be the concern for a high level application dev. For a framework dev, sure
Re: Zod 4
#244That said, the strategy does seem to prioritize ecosystem stability over short-term convenience, which is fair. Would love to see better tooling (maybe even IDE plugins or codemods) to help projects transition cleanly. Really appreciate the thoughtful design behind all of this.
Re: Zod 4
#245The little animation that highlights what section you are reading currently is beautiful
Re: Zod 4
#246Earlier quoted context omitted.
It defines yet another way to declare schemas in a way that's not reusable. ArkType mostly uses TypeScript's, so, it feels more natural.
That's going in the wrong direction IMO. TypeScript checks types only, not business logic. Zod does both.
Re: Zod 4
#247Earlier quoted context omitted.
Am I to understand the earliest version of Zod 4 is 3.25.0 ? Does this not sound insane? --- I've been using the alpha versions of Zod for months, I just want to edit package.json and upgrade. But now I need to shotgun across git history instead. Colin, I appreciate your project immensely. As a point of feedback, you made this ^ much harder than you had to. (Perhaps publish a 4.x along with the 3.x stuff?)
I understand this as a knee-jerk reaction. I didn't do this lightly. > Perhaps publish a 4.x along with the 3.x stuff You have some misconceptions about how npm works. Unfortunately it's less reasonable than you think. There's a single `latest` tag, and there's only one "latest" version at a time. It's expected that successive versions here will follow semver. Once I publish zod@4 I can no longer publish additional z…
Speaking bluntly, this isn’t how libraries in the npm upgrade, and pitching this does not inspire confidence.
Re: Zod 4
#248What is it?
Re: Zod 4
#249Wow! This is great!!! What is it?
Re: Zod 4
#250Earlier quoted context omitted.
Zod has nothing to do with SPAs and isn't just a frontend tool. Do you not validate inputs in your code?
Laravel/Livewire handles it. I have no idea why something like Zod should be the concern for a high level application dev. For a framework dev, sure
Unless you're saying
a) You don't validate user inputs b) You prefer validation to be bundled with the framework rather than having a choice