-
Couldn't load subscription status.
- Fork 3
Zod 4 #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zod 4 #129
Conversation
BREAKING CHANGE zod4 is now being used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the project from Zod v3 to Zod v4, updating API usage throughout the codebase to align with the new version's breaking changes.
Key Changes:
- Updated Zod package version from 3.25.76 to 4.1.12
- Replaced deprecated
Schema["_output"]type accessors withz.output<Schema>utility type - Updated error message parameter from
required_errortoerroracross field definitions - Updated Zod issue codes (e.g.,
invalid_literal→invalid_value)
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated Zod dependency from v3.25.76 to v4.1.12 in devDependencies and peerDependencies |
| src/fields/zod-field/zodField.ts | Replaced Schema["_output"] with z.output<Schema> type helper |
| src/fields/zod-field/Docs.mdx | Updated documentation to use z.output<Schema> type helper |
| src/hooks/use-multiselect-field-props/useMultiSelectFieldProps.tsx | Removed ArrayCardinality import and updated type extraction to use z.infer<Value> |
| src/fields/string-field/stringField.ts | Changed required_error parameter to error in z.string() |
| src/fields/number-field/numberField.ts | Changed required_error parameter to error in z.number() |
| src/fields/date-field/dateField.ts | Changed required_error parameter to error in z.date() |
| src/fields/boolean-field/booleanField.ts | Changed required_error parameter to error in z.boolean() |
| src/fields/checkbox-field/checkboxField.ts | Changed errorMap to error and updated issue code from invalid_literal to invalid_value |
| src/fields/list-field/listField.ts | Replaced ZodAny with ZodObject, updated z.any() to z.object(), and changed error parameter syntax |
| src/fields/array-field/arrayField.ts | Removed ArrayCardinality type parameter from ZodArray types |
| src/fields/files-field/filesField.ts | Changed z.instanceof(File) to z.file() |
| src/components/select/Select.test.tsx | Updated type extraction from schema["_output"] to z.output<typeof schema> |
| src/components/select/Select.stories.tsx | Changed required_error parameter to error in z.object() |
| src/components/radio-group/RadioGroup.stories.tsx | Changed required_error parameter to error in z.object() |
| Multiple test files | Updated expected error messages to match Zod v4 format |
| src/fields/array-field/stringArrayField.test-d.ts | Commented out test for non-empty array type, updated optional field type expectation |
| src/fields/files-field/filesField.test-d.ts | Updated FilesField submit value type from [File, ...File[]] to File[] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #129 +/- ##
=======================================
Coverage 80.42% 80.42%
=======================================
Files 39 39
Lines 332 332
Branches 61 61
=======================================
Hits 267 267
Misses 55 55
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# [6.0.0-next.1](v5.4.0...v6.0.0-next.1) (2025-10-24) * Zod 4 ([#129](#129)) ([c5ccdc7](c5ccdc7)) ### BREAKING CHANGES * zod4 is now being used * fix story
|
🎉 This PR is included in version 6.0.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* Zod 4 (#129) * fix(primitive-fields): update to zod4 * fix(array-fields): update types, don't use tuples * feat(zod): up to 4 BREAKING CHANGE zod4 is now being used * fix story * chore(release): 6.0.0-next.1 # [6.0.0-next.1](v5.4.0...v6.0.0-next.1) (2025-10-24) * Zod 4 ([#129](#129)) ([c5ccdc7](c5ccdc7)) ### BREAKING CHANGES * zod4 is now being used * fix story --------- Co-authored-by: semantic-release-bot <[email protected]>
# [6.0.0](v5.4.0...v6.0.0) (2025-10-24) * Next ([#131](#131)) ([58e800f](58e800f)), closes [#129](#129) ### BREAKING CHANGES * zod4 is now being used * fix story * chore(release): 6.0.0-next.1 # [6.0.0-next.1](v5.4.0...v6.0.0-next.1) (2025-10-24) * Zod 4 ([#129](#129)) ([c5ccdc7](c5ccdc7)) ### BREAKING CHANGES * zod4 is now being used * fix story
No description provided.