[v2] Create error map fn #2431
alpha fromcreate-error-map-fn·opened 🎯 Changes#
Removes parseIssues in favor of adequate replacements:
- Form-level and group-level validators:
parseIssuescreated an error map, socreateErrorMapcan be extended to also accept standard schema issues. - Field-level validators:
parseIssueswas redundant, you can just return the array directly.
BREAKING: parseIssues will no longer be available.
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested code changes locally with
pnpm test:pr, or these tests do not apply to this pull request. - I fully understand the code in this pull request, including any code generated with AI assistance.
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
- New Features
- Standard Schema validation issues can now be returned directly from field validators, while form and group errors can be mapped through
createErrorMap. - Submission error handling now supports creating error maps from schema issues or supplied error maps.
- Readonly arrays are now supported for validation error inputs.
- Standard Schema validation issues can now be returned directly from field validators, while form and group errors can be mapped through
- 1
View your CI Pipeline Execution ↗ for commit 6c2d57702250fb60ee13421f4695f5438a4453d5
Command Status Duration Result nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded 4m 18s View ↗ nx run-many --target=build --exclude=examples/**✅ Succeeded 21s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-16 09:00:23UTC🚀 Changeset Version Preview#
8 package(s) bumped directly, 5 bumped as dependents.
🟨 Minor bumps#
Package Version Reason @tanstack/angular-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/form-core2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/lit-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/preact-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/react-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/solid-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/svelte-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/vue-form2.0.0-alpha.2 → 2.0.0-alpha.3 Changeset @tanstack/react-form-nextjs2.0.0-alpha.2 → 2.0.0-alpha.3 Dependent @tanstack/react-form-start2.0.0-alpha.2 → 2.0.0-alpha.3 Dependent 🟩 Patch bumps#
Package Version Reason @tanstack/form-devtools1.0.0-alpha.2 → 1.0.0-alpha.3 Dependent @tanstack/react-form-devtools1.0.0-alpha.2 → 1.0.0-alpha.3 Dependent @tanstack/solid-form-devtools1.0.0-alpha.2 → 1.0.0-alpha.3 Dependent More templates
- @tanstack/form-example-angular-array
- @tanstack/form-example-angular-basic
- @tanstack/form-example-angular-basic-splitting-form
- @tanstack/form-example-angular-field-groups
- @tanstack/form-example-angular-large-form
- @tanstack/form-example-angular-multi-step-wizard
- @tanstack/form-example-angular-query-integration
- @tanstack/form-example-angular-simple
- @tanstack/form-example-angular-standard-schema
- @tanstack/form-example-lit-array
- @tanstack/form-example-lit-basic
- @tanstack/form-example-lit-basic-splitting-form
- @tanstack/form-example-lit-field-groups
- @tanstack/form-example-lit-large-form
- @tanstack/form-example-lit-multi-step-wizard
- @tanstack/form-example-lit-query-integration
- @tanstack/form-example-lit-simple
- @tanstack/form-example-lit-standard-schema
- @tanstack/form-example-preact-array
- @tanstack/form-example-preact-basic
- @tanstack/form-example-preact-basic-splitting-form
- @tanstack/form-example-preact-field-groups
- @tanstack/form-example-preact-large-form
- @tanstack/form-example-preact-multi-step-wizard
- @tanstack/form-example-preact-query-integration
- @tanstack/form-example-preact-simple
- @tanstack/form-example-preact-standard-schema
- @tanstack/form-example-react-array
- @tanstack/form-example-react-basic
- @tanstack/form-example-react-basic-splitting-form
- @tanstack/form-example-react-compiler
- @tanstack/form-example-react-expo
- @tanstack/form-example-react-field-groups
- @tanstack/form-example-react-large-form
- @tanstack/form-example-react-multi-step-wizard
- @tanstack/form-example-react-next-server-actions
- @tanstack/form-example-react-next-server-actions-zod
- @tanstack/form-example-react-nextjs
- @tanstack/form-example-react-query-integration
- @tanstack/form-example-react-simple
- @tanstack/form-example-react-standard-schema
- @tanstack/form-example-react-tanstack-start
- @tanstack/form-example-react-ui-integration-dnd-kit
- @tanstack/form-example-react-ui-integration-shadcn
- @tanstack/form-example-solid-array
- @tanstack/form-example-solid-basic
- @tanstack/form-example-solid-basic-splitting-form
- @tanstack/form-example-solid-field-groups
- @tanstack/form-example-solid-large-form
- @tanstack/form-example-solid-multi-step-wizard
- @tanstack/form-example-solid-query-integration
- @tanstack/form-example-solid-simple
- @tanstack/form-example-solid-standard-schema
- @tanstack/form-example-vue-array
- @tanstack/form-example-vue-large-form
- @tanstack/form-example-vue-multi-step-wizard
- @tanstack/form-example-vue-simple
- @tanstack/form-example-vue-standard-schema
- @tanstack/form-example-svelte-array
- @tanstack/form-example-svelte-basic
- @tanstack/form-example-svelte-basic-splitting-form
- @tanstack/form-example-svelte-field-groups
- @tanstack/form-example-svelte-large-form
- @tanstack/form-example-svelte-multi-step-wizard
- @tanstack/form-example-svelte-query-integration
- @tanstack/form-example-svelte-simple
- @tanstack/form-example-svelte-standard-schema
@tanstack/angular-form
npm i https://pkg.pr.new/@tanstack/angular-form@2431@tanstack/form-core
npm i https://pkg.pr.new/@tanstack/form-core@2431@tanstack/form-devtools
npm i https://pkg.pr.new/@tanstack/form-devtools@2431@tanstack/lit-form
npm i https://pkg.pr.new/@tanstack/lit-form@2431@tanstack/preact-form
npm i https://pkg.pr.new/@tanstack/preact-form@2431@tanstack/react-form
npm i https://pkg.pr.new/@tanstack/react-form@2431@tanstack/react-form-devtools
npm i https://pkg.pr.new/@tanstack/react-form-devtools@2431@tanstack/react-form-nextjs
npm i https://pkg.pr.new/@tanstack/react-form-nextjs@2431@tanstack/react-form-start
npm i https://pkg.pr.new/@tanstack/react-form-start@2431@tanstack/solid-form
npm i https://pkg.pr.new/@tanstack/solid-form@2431@tanstack/solid-form-devtools
npm i https://pkg.pr.new/@tanstack/solid-form-devtools@2431@tanstack/svelte-form
npm i https://pkg.pr.new/@tanstack/svelte-form@2431@tanstack/vue-form
npm i https://pkg.pr.new/@tanstack/vue-form@2431commit:
6c2d577:warning: Please install the
to ensure uploads and comments are reliably processed by Codecov.
Codecov Report#
:white_check_mark: All modified and coverable lines are covered by tests. :warning: Please upload report for BASE (
alpha@3d39077). Learn more about missing BASE report. :exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.Additional details and impacted files
@@ Coverage Diff @@ ## alpha #2431 +/- ## ======================================== Coverage ? 95.10% ======================================== Files ? 116 Lines ? 4456 Branches ? 1005 ======================================== Hits ? 4238 Misses ? 208 Partials ? 10:umbrella: View full report in Codecov by Harness. :loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Not going to be tackled this way after all. Too many implications for a minor QoL improvement.
LeCarbonator(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
6a8be3db-ca54-4798-a13a-32e59a6afbb7📥 Commits
Reviewing files that changed from the base of the PR and between 3d3907734521024f54fd6f66e4fd591ee9abcae4 and 6c2d57702250fb60ee13421f4695f5438a4453d5.
📒 Files selected for processing: 23
examples/angular/field-groups/src/bound-field.component.tsexamples/lit/field-groups/src/field-bounds.tsexamples/preact/field-groups/src/fieldGroups/fieldBounds.tsxexamples/react/field-groups/src/fieldGroups/fieldBounds.tsxexamples/solid/field-groups/src/fieldGroups/fieldBounds.tsxexamples/svelte/field-groups/src/fieldGroups/UpperBoundFields.sveltepackages/form-core/src/FormApi/FormApi.public.tspackages/form-core/src/FormApi/handleSubmit.lib.tspackages/form-core/src/FormGroupApi/FormGroupApi.lib.tspackages/form-core/src/createErrorMap.lib.tspackages/form-core/src/ssr.lib.tspackages/form-core/src/types.public.tspackages/form-core/src/utils.lib.tspackages/form-core/src/validation.public.tspackages/form-core/src/validation/execution.lib.tspackages/form-core/src/validation/mount.lib.tspackages/form-core/src/validation/pipeline.lib.tspackages/form-core/tests/FormApi/submission-handling.spec.tspackages/form-core/tests/FormApi/validation.spec.tspackages/form-core/tests/FormGroupApi/FormGroupApi.spec.tspackages/form-core/tests/validation-pipeline.test.tspackages/form-core/tests/validation-public.test.tspackages/form-core/tests/validation.test-d.ts💤 Files with no reviewable changes: 1
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Validation and submission contexts now use
createErrorMapinstead ofparseIssues. Field validators can return Standard Schema issue arrays directly. The public validation types accept readonly inputs, and the field-group examples use the updated validation pattern.Changes: Form Error Mapping
packages/form-core/src/types.public.ts,packages/form-core/src/utils.lib.ts,packages/form-core/src/validation.public.ts,packages/form-core/tests/validation-public.test.ts,packages/form-core/tests/validation.test-d.tsCreateErrorMapFnhas overloads for error maps and Standard Schema issues. The standalonecreateErrorMapexport and theparseIssuestype declarations are removed.packages/form-core/src/createErrorMap.lib.ts,packages/form-core/src/validation/*,packages/form-core/src/FormGroupApi/FormGroupApi.lib.ts,packages/form-core/src/ssr.lib.ts,examples/*/field-groups/*,packages/form-core/tests/FormApi/validation.spec.ts,packages/form-core/tests/FormGroupApi/FormGroupApi.spec.ts,packages/form-core/tests/validation-pipeline.test.ts,packages/form-core/tests/validation.test-d.tspackages/form-core/src/FormApi/FormApi.public.ts,packages/form-core/src/FormApi/handleSubmit.lib.ts,packages/form-core/tests/FormApi/submission-handling.spec.ts,packages/form-core/tests/validation.test-d.tscreateErrorMapwith overloads for error maps and Standard Schema issues. Submission errors retain the map, and submission documentation and tests use the new helper.Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Suggested reviewers:
crutchcornMerge Risk: ⚪ Minimal · up to
6c2d5This change replaces issue parsing with createErrorMap and lets field validators return schema issues directly. No concrete merge-blocking problem was identified. The PR is declared breaking, so the release checklist and changeset still need attention.
Pre-merge checks:
3 · 
2
Full details: Description check
Explanation
The description explains the removal of parseIssues and lists the main replacements. However, this breaking published API change does not include a changeset, and the test-status checklist remains incomplete.
Resolution
Add the required changeset for the published breaking API change, select the applicable Release Impact option, and confirm whether pnpm test:pr was run or does not apply.
Full details: Docstring Coverage
Explanation
Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 21 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
🛠️ Fix failing CI checks: 💡
🧪 Generate unit tests (beta)
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