-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Upgrade FES from Zod 3 to Zod 4? #7833
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
Comments
@davepagurek can I work on this issue!! |
Thanks @madhav2348 ! Let me know if you run into any issues in the process. |
Thank you for your support, I definitely let you know |
hi @davepagurek Couldn't evaluate i18next key. You should either make the key evaluable or skip the line using a skip comment (/* i18next-extract-disable-line */ or /* i18next-extract-disable-next-line */). which i resolved by using skip comments , Fatal error: 'import' and 'export' may appear only with 'sourceType: module' |
Hi @madhav2348, what version of node are you using? We were seeing some issues like this before, but only on node 18 and under. Could you try 20 or higher if you haven't already? |
I checked my node version which is |
Also I think you probably don't need to update browser_errors.js and file_errors.js, we're using zod in src/core/friendly_errors/param_validator.js here:
After upgrading the zod version via Also, do you get the same error on a fresh clone of p5 on the dev-2.0 branch without adjusting the zod version at all? |
My mistake, I didn't realise that I was in the main branch , so now I switch to dev-2.0 Although I went through the migration docs, there are no major changes, just deprecation of And many test cases fail because [TypeError: schema.optional is not a function] its type.
[param_validator.js, line 234] "optional" could not be called as a function.
Verify whether "schema" has "optional" in it and check the spelling, letter-casing (JavaScript is case-sensitive) and its type. and ⚠️ [WEBDRIVERIO DEPRECATION NOTICE] The "switchToFrame" command is deprecated and we encourage everyone to use `switchFrame` instead for switching into frames. Read more about this command at https://webdriver.io/docs/api/browser/switchFrame. I'll try to resolve it and make a PR soon Thankyou |
hey @davepagurek Should I update the test cases or trim the message to get the expected results ?
In Zod 4, I thought there were minor changes, but most of the test cases are failing
(zod 3) Expected : "🌸 p5.js says: Expected number at the sixth parameter, but received undefined in p5.arc()."
(zod 4) Received : "🌸 p5.js says: Expected number at the sixth parameter, but received Invalid input: expected number, received undefined in p5.arc()." (zod 3) Expected: "🌸 p5.js says: Expected constant (please refer to documentation for allowed values) at the first parameter, but received 100 in p5.blendMode()."
(zod 4) Received: "🌸 p5.js says: Expected constant (please refer to documentation for allowed values) at the first parameter, but received Invalid input: expected "source-over" in p5.blendMode()." |
Increasing access
Apparently Zod 4 has some big performance bumps. Since FES uses Zod for parameter checking, and a big reason for people to turn FES off is to squeeze out more performance, maybe it'll let people use FES for longer before having to do so?
Most appropriate sub-area of p5.js?
Feature enhancement details
I'm not sure if there are any breaking changes that affect us, which could make it less of a straight win. But we use a fairly small set of what Zod can do, so this might be a quick change?
The text was updated successfully, but these errors were encountered: