Skip to content

Comments

fix(zod): relax zod v4 resolver overload typing#840

Open
daimon-s-ww wants to merge 3 commits intoreact-hook-form:masterfrom
daimon-s-ww:fix/zod-v4-structural-overload
Open

fix(zod): relax zod v4 resolver overload typing#840
daimon-s-ww wants to merge 3 commits intoreact-hook-form:masterfrom
daimon-s-ww:fix/zod-v4-structural-overload

Conversation

@daimon-s-ww
Copy link

@daimon-s-ww daimon-s-ww commented Feb 10, 2026

Proposed Changes

  • Replace strict Zod v4 overload constraints based on $ZodType internals with structural _zod-based typing.
  • Preserve explicit generic usage (<Input, Context, Output>) while improving compatibility for mixed zod dependency trees.
  • Keep raw/non-raw resolver return typing behavior unchanged.
  • Add focused type-level tests for Zod v4 and v4-mini to lock structural overload inference.

Test plan

  • pnpm vitest run zod/src/__tests__/zod-v4.ts zod/src/__tests__/zod-v4-mini.ts -t "structural schema type"
  • Full suite in this environment (currently has unrelated existing runtime/hook failures)

daimon-s-ww and others added 2 commits February 10, 2026 11:15
Switch zodResolver v4 overloads from strict $ZodType internals to structural _zod-based schema typing so mixed zod type resolutions no longer fail overload matching.

Co-authored-by: Cursor <cursoragent@cursor.com>
Normalize multiline generic declarations in zod resolver overload signatures after biome auto-format.

Co-authored-by: Cursor <cursoragent@cursor.com>
@daimon-s-ww daimon-s-ww reopened this Feb 20, 2026
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.

1 participant