Skip to content

[v2] Fix: Schema output type now properly guards against dynamically enabled validators - #2335

Merged
LeCarbonator merged 2 commits into
alphafrom
schema-output-type
Aug 13, 2026
Merged

[v2] Fix: Schema output type now properly guards against dynamically enabled validators#2335
LeCarbonator merged 2 commits into
alphafrom
schema-output-type

Conversation

@LeCarbonator

@LeCarbonator LeCarbonator commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Improved form schema output typing for validators whose submit-time behavior is configured dynamically.
    • Correctly reflects guaranteed, optional, or unavailable validation outputs based on validator settings.
  • Tests

    • Added coverage for omitted, enabled, disabled, boolean, and callback-based submit validation configurations.
  • Chores

    • Prepared a patch release for the form core package.

@nx-cloud

nx-cloud Bot commented Aug 13, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 504e0ef

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 4m 58s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 24s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-13 13:51:04 UTC

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: af001bd8-7988-449f-8423-1fe20f81d205

📥 Commits

Reviewing files that changed from the base of the PR and between c09c5e0 and 504e0ef.

📒 Files selected for processing (3)
  • .changeset/odd-comics-push.md
  • packages/form-core/src/validation.public.ts
  • packages/form-core/tests/validation.test-d.ts

📝 Walkthrough

Walkthrough

The patch updates form schema output inference for dynamic runOnSubmit validators. It distinguishes guaranteed, optional, and absent outputs. Type-level tests cover literal, omitted, boolean, and callback configurations.

Changes

Schema output typing

Layer / File(s) Summary
Submit-aware output inference
packages/form-core/src/validation.public.ts, packages/form-core/tests/validation.test-d.ts, .changeset/odd-comics-push.md
TryGetSubmitSchemaOutput now handles disabled, dynamic, and enabled-by-default validators. Mapped outputs use this inference. Type assertions and patch-release metadata were added.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 504e0

The PR changes schema output typing and adds related type tests; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • TanStack/form#2333: Modifies the same validation typing logic and introduces related validator-instance changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description, so it omits the required Changes, Checklist, and Release Impact sections. Add the template sections, describe the schema typing fix, record the test status, and mark the applicable release-impact option.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the schema output typing fix for dynamically enabled validators.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch schema-output-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 12 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/form-core 2.0.0-alpha.0 → 2.0.0-alpha.1 Changeset
@tanstack/angular-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/form-devtools 1.0.0-alpha.0 → 1.0.0-alpha.1 Dependent
@tanstack/lit-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/preact-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/react-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/react-form-devtools 1.0.0-alpha.0 → 1.0.0-alpha.1 Dependent
@tanstack/react-form-nextjs 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/react-form-start 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/solid-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/solid-form-devtools 1.0.0-alpha.0 → 1.0.0-alpha.1 Dependent
@tanstack/svelte-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent
@tanstack/vue-form 2.0.0-alpha.0 → 2.0.0-alpha.1 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Aug 13, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@2335

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@2335

@tanstack/form-devtools

npm i https://pkg.pr.new/@tanstack/form-devtools@2335

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@2335

@tanstack/preact-form

npm i https://pkg.pr.new/@tanstack/preact-form@2335

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@2335

@tanstack/react-form-devtools

npm i https://pkg.pr.new/@tanstack/react-form-devtools@2335

@tanstack/react-form-nextjs

npm i https://pkg.pr.new/@tanstack/react-form-nextjs@2335

@tanstack/react-form-start

npm i https://pkg.pr.new/@tanstack/react-form-start@2335

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@2335

@tanstack/solid-form-devtools

npm i https://pkg.pr.new/@tanstack/solid-form-devtools@2335

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@2335

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@2335

commit: 504e0ef

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (alpha@c09c5e0). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##             alpha    #2335   +/-   ##
========================================
  Coverage         ?   95.17%           
========================================
  Files            ?       67           
  Lines            ?     3482           
  Branches         ?      831           
========================================
  Hits             ?     3314           
  Misses           ?      160           
  Partials         ?        8           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@LeCarbonator
LeCarbonator merged commit 46c12c7 into alpha Aug 13, 2026
9 checks passed
@LeCarbonator
LeCarbonator deleted the schema-output-type branch August 13, 2026 13:51
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.

2 participants