Repository navigation
Conversation
domgan-oai
marked this pull request as ready for review
August 7, 2026 15:35
6 of 13 tasks
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.
Summary
@forrows whose class depends only on a strict comparison between the selected value and the row's authored key. Emit a tree-shakable compiler-only capability that updates only the previously selected and newly selected keyed rows while preserving component rerenders and existing public APIs.Validation
pnpm format:checkpnpm typecheckpnpm test— 1,555 test files / 16,519 tests passed (NODE_OPTIONS=--no-experimental-webstoragerestores jsdom storage under local Node 26; CI uses Node 22/24).pnpm exec vitest run --project octane --project octane-prod packages/octane/tests/for.test.ts packages/octane/tests/transitions.test.ts packages/octane/tests/hydration/for-hydrate.test.ts packages/octane/tests/auto-memo.test.ts— 236 passing tests; compiler suite: 852 passing tests.node benchmarks/bench.mjs --quick --ratios js-framework— all eight framework targets and all nine applicable ratio guards pass; 10,000-row selection: 0.10 ms TSRX vs. 1.10 ms JSX.node benchmarks/bench.mjs --quick codegen-size bundle-size— eligible corpus adds 4 gzip bytes; a noneligible TodoMVC app and framework chunks are byte-for-byte identical to upstream HEAD.Risk / follow-ups
@forrows with one static-arm class comparison. JSX.map()and more general selection expressions remain future work.26,530 / 24,722 = 1.073×against the historical1.04×ceiling. The new same-run selection guard passes, and nonparticipating applications pay zero shipped bytes.Provenance
agent-authored)Note
Medium Risk
Changes compiler emission and
@forruntime reconciliation for a narrow, proof-gated pattern; fallbacks and broad tests limit blast radius, but incorrect proofs could cause stale row UI.Overview
Adds a compiler-proven keyed selection fast path for production
@forrows where the host root’s soleclass/classNameis a static ternary comparing a captured parent value to the row’s authored key (selected === item.idor the reverse). Eligible lists emit tree-shakablekeyedForBlock(notforBlock) and encode the selection dependency inforBlockflags; everything else keeps ordinary keyed reconciliation.Runtime: When the items snapshot and non-selection deps are unchanged,
tryUpdateKeyedSelectionre-invokes only the blocks for the old and new selected keys instead of walking the full list. Transitions, hydration, iterable identity changes, extra captures ofselected, shared bindings, and mismatched key vs selection property fail closed to fullforBlockbehavior.Benchmarks:
selectalternates rows so timing isn’t a no-op; newselect_lotson 10k rows plus an untimed DOM selection gate;ratios.jsonadds a same-run TSRX vs JSX ceiling forselect_lots.Tests: New fixtures and cases cover DOM identity, custom keys, hydration, reorder/remove, immutable item updates, and selection during suspended transitions.
Reviewed by Cursor Bugbot for commit faaea44. Bugbot is set up for automated code reviews on this repo. Configure here.