Skip to content

feat(validator-zod)!: upgrade zod to v4 - #316

Open
rodilo wants to merge 1 commit into
pablo-abc:mainfrom
rodilo:feat/validator-zod-zod-v4
Open

feat(validator-zod)!: upgrade zod to v4#316
rodilo wants to merge 1 commit into
pablo-abc:mainfrom
rodilo:feat/validator-zod-zod-v4

Conversation

@rodilo

@rodilo rodilo commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Upgrade @felte/validator-zod to support Zod v4.

  • Bumps zod peer dependency from ^3.2.0 to ^4.0.0
  • Bumps zod dev dependency to ^4.4.3
  • Updates root zod dev dependency to ^4.4.3
  • Refactors ZodSchemaZodType and handles Zod v4 issue shapes (invalid_union, invalid_key, invalid_element)
  • Updates tests to match Zod v4 error messages
  • Replaces removed .nonempty() with .min(1) in README examples

Breaking changes

Consumers using Zod v3 must upgrade to Zod v4. The validator no longer accepts ZodSchema as the public type; use ZodType instead.
Also included: a changeset file at .changeset/upgrade-zod-v4.md with a major bump for @felte/validator-zod.
Verification done:

  • pnpm -r --filter='@felte/validator-zod' test → 10/10 passed
  • pnpm -r --filter='@felte/validator-zod' build → passed
  • lsp_diagnostics on changed files → clean (only unrelated deprecation hints from zod v4 .email() remain)

BREAKING CHANGE: bump Zod peer dependency to ^4.0.0 and devDependency to ^4.4.3.

Update source/tests for Zod v4 issue shapes and error messages.

Replace ZodSchema with ZodType and .nonempty() with .min(1).

Update root devDependency zod to ^4.4.3.
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

@rodilo is attempting to deploy a commit to the Pablo Alejandro Berganza Campos' projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant