Skip to content
Discussion options

You must be logged in to vote

Great question! Yes, incremental migration to Zod v4 is absolutely possible and actually recommended, especially for microservices architectures with many schemas.

Migration Strategy

Zod v4 is specifically designed to support incremental migration through its subpath versioning strategy:

1. Side-by-Side Installation

Zod v4 is published alongside v3 in the same package:

npm upgrade zod@^3.25.0

After upgrading, you can use both versions simultaneously:

// Existing v3 code continues to work
import { z } from "zod"; // or "zod/v3"

// New v4 code
import { z } from "zod/v4";

2. No Breaking Changes to v3

Importantly, there were no code changes between [email protected] and [email protected] - only the addition o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ValentinGurkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants