perf(form): skip no-op error state updates#542
Closed
JustYannicc wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Superseded by consolidated upstream PR #555. |
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.
What changed
setValuereturns the previous errors object when the changed field has no stored error.setErrorto avoid republishing identical error maps.Why
Ordinary field changes were cloning and publishing the Form error snapshot even when no error existed for that field. Because the Form context carries the error snapshot, this created needless state identity churn on typing.
Compatibility impact
No intended behavior change: value updates, placeholder fallback, real error clearing, and submit values remain unchanged.
How tested
node scripts/test-form-runtime-error-state-noop.mjs --report): 10/100/1000 -> 0/0/0.node --test scripts/test-form-runtime-error-state-noop.mjsnode --test scripts/test-*.mjs(clean PR branch: 27 pass, 1 skipped, 0 fail)form-runtime-state.tsclean;form-runtime.tsxLSP reported missing React resolution noise despite installed module links. Direct compiler check on the clean PR branch is blocked by existing unrelated renderer errors outside the touched form files.Stack validation
This clean PR branch was created from
origin/mainand contains one cherry-picked worker commit. It is part of the consolidated performance stack and should be reviewed with/after #530-#535 andJustYannicc:codex/perf-consolidated-integration-stack.