Skip to content

feat: upgrade to Zod v4.0.17 with 3x performance improvement#19

Merged
Melvynx merged 2 commits intomainfrom
zod-v4-upgrade
Sep 13, 2025
Merged

feat: upgrade to Zod v4.0.17 with 3x performance improvement#19
Melvynx merged 2 commits intomainfrom
zod-v4-upgrade

Conversation

@Melvynx
Copy link
Copy Markdown
Owner

@Melvynx Melvynx commented Aug 13, 2025

Summary

  • Upgraded from Zod v3.23.8 to v4.0.17 using automated migration tools
  • Fixed TypeScript compatibility issues with Zod v4's stricter type system
  • All tests passing (39/39) with 97.23% coverage maintained

Performance Improvements

  • 3x faster parsing overall
  • 57% smaller bundle size
  • 20x reduction in TypeScript compiler instantiations
  • 14.71x faster string parsing

Changes

  • Updated package.json dependency to Zod v4.0.17
  • Used zod/v4 subpath imports for compatibility
  • Modernized z.string().uuid()z.uuid() syntax
  • Fixed type compatibility in RouteHandlerBuilder
  • Updated test files with proper schema definitions

Test Plan

  • All 39 existing tests pass
  • TypeScript compilation successful
  • ESLint checks pass
  • Production build works
  • Coverage maintained at 97.23%

- Fix metadataValue typing to be optional
- Add type assertion for params data from safeParse
- Add missing query schema in test cases
- Reset middlewares array when defining new metadata schema
- All tests passing (39/39) with 97.23% coverage
Comment thread src/routeHandlerBuilder.test.ts
@Melvynx Melvynx merged commit 11b83fa into main Sep 13, 2025
1 check passed
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.

2 participants