Skip to content

Conversation

josephsavona
Copy link
Member

@josephsavona josephsavona commented Oct 3, 2025

Partial redo of #34710. The changes there tried to use z.function(args, return) to be compatible across Zod v3 and v4, but Zod 4's function API has completely changed. Instead, I've updated to just use z.any() where we expect a function, and manually validate that it's a function before we call the value. We already have validation of the return type (also using Zod).

@meta-cla meta-cla bot added the CLA Signed label Oct 3, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Oct 3, 2025
@josephsavona
Copy link
Member Author

Note: this is a redo of #34710 w fixes

@josephsavona josephsavona force-pushed the pr34717 branch 2 times, most recently from 45c2375 to 69fbdea Compare October 3, 2025 16:44
@josephsavona josephsavona changed the title feat(eslint-plugin): add Zod v4 compatibility Partial redo of #34710. The changes there tried to use z.function(args, return) to be compatible across Zod v3 and v4, Oct 3, 2025
@josephsavona josephsavona changed the title Partial redo of #34710. The changes there tried to use z.function(args, return) to be compatible across Zod v3 and v4, [compiler] Update for Zod v3/v4 compatibility Oct 3, 2025
@josephsavona josephsavona requested a review from poteto October 3, 2025 16:46
@react-sizebot
Copy link

react-sizebot commented Oct 3, 2025

Comparing: 71753ac...8335312

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 536.14 kB 536.14 kB = 94.81 kB 94.81 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 663.96 kB 663.96 kB = 117.04 kB 117.04 kB
facebook-www/ReactDOM-prod.classic.js = 687.83 kB 687.83 kB = 121.08 kB 121.08 kB
facebook-www/ReactDOM-prod.modern.js = 678.26 kB 678.26 kB = 119.43 kB 119.44 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 8335312

Partial redo of #34710. The changes there tried to use `z.function(args, return)` to be compatible across Zod v3 and v4, but Zod 4's function API has completely changed. Instead, I've updated to just use `z.any()` where we expect a function, and manually validate that it's a function before we call the value. We already have validation of the return type (also using Zod).
@josephsavona josephsavona merged commit d6eb735 into main Oct 3, 2025
253 of 285 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 3, 2025
Partial redo of #34710. The changes there tried to use `z.function(args,
return)` to be compatible across Zod v3 and v4, but Zod 4's function API
has completely changed. Instead, I've updated to just use `z.any()`
where we expect a function, and manually validate that it's a function
before we call the value. We already have validation of the return type
(also using Zod).

Co-authored-by: kolvian <eliot@pontarelli.com>

DiffTrain build for [d6eb735](d6eb735)
github-actions bot pushed a commit that referenced this pull request Oct 3, 2025
Partial redo of #34710. The changes there tried to use `z.function(args,
return)` to be compatible across Zod v3 and v4, but Zod 4's function API
has completely changed. Instead, I've updated to just use `z.any()`
where we expect a function, and manually validate that it's a function
before we call the value. We already have validation of the return type
(also using Zod).

Co-authored-by: kolvian <eliot@pontarelli.com>

DiffTrain build for [d6eb735](d6eb735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants