Releases: colinhacks/zod
v4.0.5
v4.0.4
v4.0.3
v4.0.0
With this release, [email protected]
has been published to npm
. There were no code changes between 3.25.76 and 4.0.0!
Zod 4 has been stable for the past 6 weeks, but it was published inside [email protected] on npm. this transitionary window gave the ecosystem time to incrementally support for Zod 4 (without dropping support for Zod 3). As there is now near-universal support for Zod 4 in the ecosystem, ths time feels right to finally put a bow on things 🎀
To upgrade to Zod 4:
npm upgrade zod@^4.0.0
If you’ve already migrated to Zod 4 using the subpaths, there are no changes required. however you can optionally simplify your imports (recommended)
// after upgrading to [email protected]:
import * as z from "zod"; // Zod 4 (regular)
import * as z from "zod/mini" // Zod 4 Mini
// these still work, but are no longer needed
import * as z from "zod/v4";
import * as z from "zod/v4-mini":
// if you still need Zod 3
import * as z from "zod/v3"; // Zod 3
Library authors — if you've already implemented Zod 4 support according to the best practices outlined in the Library authors guide, bump your peer dependency to include zod@^4.0.0
:
// package.json
{
"peerDependencies": {
"zod": "^3.25.0 || ^4.0.0"
}
}
There should be no other code changes necessary. No code changes were made between the latest 3.25.x
release and 4.0.0
. This does not require a major version bump.