perf(raycast): avoid useForm error state no-op churn#562
Closed
JustYannicc wants to merge 71 commits into
Closed
Conversation
(cherry picked from commit fb7405f)
(cherry picked from commit 290a0f5)
(cherry picked from commit 3739cb0)
(cherry picked from commit c78d0b9)
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/hooks/use-cached-promise.ts
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime-renderers.tsx # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack # Conflicts: # src/renderer/src/CameraExtension.tsx
…ated-integration-stack
…ated-integration-stack # Conflicts: # src/renderer/src/raycast-api/list-runtime.tsx
…ated-integration-stack
…ated-integration-stack
… into codex/perf-consolidated-integration-stack
Collaborator
Author
|
Superseded by the consolidated wave-2 UI/runtime PR: #572 |
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
useFormerror state handling to use the existing guardedclearFormFieldErrorandsetFormFieldErrorhelpers.scripts/test-use-form-error-state-noop.mjswith source checks and identity-churn measurements for no-op clears and same-value error sets.Why
useForm.setValuecloned the error map and deleted the changed field on every value change, even when that field had no error. That republished a new error object for no-op clears and could drive avoidable render/state churn.Compatibility impact
Raycast extension behavior is preserved. Changing a field with an existing error still clears only that field and preserves unrelated errors. Setting a different validation error still publishes the new error. Same-value validation error sets now return the previous error map.
How tested
node --test scripts/test-use-form-error-state-noop.mjspassed.node --test scripts/test-form-runtime-error-state-noop.mjspassed.node --test scripts/test-use-form-error-state-noop.mjs scripts/test-form-runtime-error-state-noop.mjspassed, 6/6 tests../node_modules/.bin/tsc -p tsconfig.renderer.json --noEmitpassed.node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js run build:rendererpassed.use-form.tsdiagnostics reported no errors.Performance evidence
node scripts/test-use-form-error-state-noop.mjs --reportshowed no-error field changes now keep the same error object: 10 changes before 10 identity changes, after 0; 100 changes before 100, after 0; 1000 changes before 1000, after 0. The same report verifies same-error sets keep identity, changed errors publish, and clearing an existing error removes only that field while preserving unrelated errors.Stack validation
Started from
fork/codex/perf-consolidated-integration-stackresolving to264fb89dc5c867d6c3d77bc4b95e26e235e326ea, matching the initial detachedHEAD, before creatingcodex/perf-raycast-use-form-error-noop.Replaces
Implements the delegated Raycast
useFormerror-state no-op churn finding from source thread019f2bf5-ccf0-7791-b5ec-844ed436e725; no prior PR is replaced.