perf(raycast): reduce renderer hook and registry churn#555
Open
JustYannicc wants to merge 51 commits into
Open
perf(raycast): reduce renderer hook and registry churn#555JustYannicc wants to merge 51 commits into
JustYannicc wants to merge 51 commits into
Conversation
… into codex/perf-consolidated-integration-stack
…tus' into codex/perf-consolidated-integration-stack
… into codex/perf-consolidated-integration-stack # Conflicts: # src/renderer/src/CameraExtension.tsx
(cherry picked from commit c51a0df)
(cherry picked from commit ea2c28a)
(cherry picked from commit 0437f45)
(cherry picked from commit fb7405f)
(cherry picked from commit 290a0f5)
(cherry picked from commit 3739cb0)
(cherry picked from commit c78d0b9)
This was referenced Jul 3, 2026
This was referenced Jul 3, 2026
Contributor
|
Reviewed the Raycast-runtime portion of this stack (the 10 commits on top of Strengths
Concerns / potential bugs
Suggestions
🟡 Approve with minor comments — behavior/API is preserved and the stale-run and abort fixes are genuine improvements; only low-severity edge cases noted. 🤖 Automated review by Claude Code (Opus 4.8). |
Collaborator
Author
|
Addressed the review concerns in
Proof run locally:
|
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
useFetchresponses and stale promise hook completions acrossusePromise,useCachedPromise, anduseStreamJSON.useStreamJSONlifecycle work on revalidation/unmount while composing caller-provided abort signals without mutating them.setValue/setErrorwould publish the same error state.Why
These renderer hot paths are hit during extension renders, hover/selection churn, virtualized grid scrolling, icon-heavy surfaces, JSON streaming hooks, and launcher file search. The consolidation keeps stale async completions from overwriting newer state and reduces repeated DOM, filesystem, registry, and launcher lookup work without changing the Raycast API surface.
Compatibility impact
Public Raycast hook, form, grid, list, icon, and launcher APIs are unchanged. Stale async runs are ignored only when a newer run has superseded them or the hook is unmounted.
useStreamJSONobserves caller-provided abort signals via a composed signal and does not abort caller-owned controllers. Missing local asset paths are cached only for a short stale window so newly-created assets can still resolve shortly after appearing. Launcher duplicate file-result paths continue to use the first command, matching the old.findsemantics.How tested
pnpm exec node --test scripts/test-use-fetch-stale-runs.mjs scripts/test-form-runtime-error-state-noop.mjs scripts/test-grid-virtualization.mjs scripts/test-icon-tint-cache.mjs scripts/test-registry-dirty-checks.mjs scripts/test-icon-asset-cache.mjs scripts/test-abortable-promise-hooks.mjs scripts/test-launcher-file-result-command-map.mjs scripts/test-use-stream-json-lifecycle.mjspnpm exec tsc -p tsconfig.renderer.json --noEmit --pretty falsepnpm exec vite buildgit diff --check fork/codex/consolidate-raycast-renderer-hooks..HEADuse-fetch.ts,use-promise.ts,use-cached-promise.ts,use-stream-json.ts,useLauncherCommandModel.ts,launcher-file-candidates.ts,grid-runtime-hooks.ts,grid-runtime-virtualization.ts,list-runtime-hooks.ts,icon-runtime-assets.tsx,form-runtime.tsx, andform-runtime-state.ts.Performance evidence
statSynccall; 10,000 repeated missing path resolutions within the stale window used 1statSynccall.getComputedStylecalls.useStreamJSONbefore evidence from perf(utils): guard useStreamJSON lifecycle #554: the lifecycle harness failed before the hook change for stale data overwrite, stale error surfacing, missing unmount cleanup, and missing signal composition; it passes after this consolidation.Stack validation
This branch starts from
codex/perf-consolidated-integration-stackand adds only the Raycast renderer hook, registry, grid, form, icon, launcher file lookup, anduseStreamJSONlifecycle fixes assigned here. Renderer typecheck and production renderer build pass on this stack.Replaces