-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(zod-package): support for Zod v4 #5032
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
base: main
Are you sure you want to change the base?
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5032 +/- ##
==========================================
+ Coverage 89.36% 89.41% +0.05%
==========================================
Files 93 94 +1
Lines 8046 8226 +180
Branches 1394 1439 +45
==========================================
+ Hits 7190 7355 +165
- Misses 849 864 +15
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Here's a dedicated guide for library authors that answers some common questions: https://v4.zod.dev/library-authors
Note that the |
Thanks for your guidelines, I decided that it might be best to go for v3 and v4 simultaneous support for now. I'm having issues with the following imports:
The only import paths I got working is this:
package.json looks like this:
Am I doing something wrong? |
I'm thinking we should instead support standard schemas and not have to deal with specific resolvers for multiple versions of a schema provider. I've planned this for v5 since standard schemas can be supported without having to implement any resolvers, we would drop support for non-standard schemas tho like yup. |
Yeah that seems like a more reasonable solution. |
🔎 Overview
This PR is a basic migration to support Zod v4, there is definitely more work to do, but this could be a little help to get things started. I went ahead and migrated everything I could and all the tests seem to be passing.
I am a little hesitant since I had to install both the beta and the core package of Zod since some types that are needed are only available under the core package now.
✔ Issues affected
closes #5027