Add @tanstack/form-server Package#1730
Open
jiji-hoon96 wants to merge 14 commits into
Open
Conversation
- Add mapServerErrors for normalizing various server error formats - Add applyServerErrors for injecting errors into form instances - Add onServerSuccess for handling successful responses with reset options - Add selector utilities for extracting server data from stores - Support Zod, Rails, NestJS and custom error formats - Include comprehensive test coverage and React integration guide
- Replace type assertions with proper type guard functions - Add comprehensive null/undefined checks for server error properties - Eliminate 'any' type usage in favor of Record<string, unknown> - Improve runtime type validation for all error formats
- Add ApplyErrorsOptions type with multipleMessages strategy - Support 'first', 'join', and 'array' message handling modes - Add customizable separator for join strategy - Include comprehensive tests for all message handling strategies - Maintain backward compatibility with default 'first' behavior
- Add comprehensive null/undefined checks in mapServerErrors - Strengthen error handling with try-catch blocks for all error format parsers - Improve defaultPathMapper with type validation and error recovery - Add defensive checks in applyServerErrors for form API methods - Handle mixed field/form error scenarios properly - Filter out empty/invalid error messages throughout the pipeline - Maintain backward compatibility while improving robustness
- Add generic type support for server response result - Introduce storeResult option to save server response in form meta - Pass result to after callback for post-success processing - Add comprehensive error handling with try-catch blocks - Improve type safety with proper generic constraints - Maintain backward compatibility while adding new functionality
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many --target=build --exclude=examples/** |
❌ Failed | 3s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-09-15 05:20:46 UTC
…into feat/form-server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new @tanstack/form-server package that provides utilities for handling server errors and success responses in TanStack Form applications.
Key Features
Supported Error Formats