Repository navigation
perf: avoid per-list key callback wrappers - #1057
Merged
domgan-oai merged 3 commits intoSep 11, 2026
Merged
Conversation
Closed
68 of 84 tasks
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 7e3a8e7. Configure here.
domgan-oai
marked this pull request as ready for review
September 11, 2026 22:04
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
Remove the per-list key callback selected by
renderPreparedChildList: reconciliation now reads the prepared key array directly or calls the existing compiled-map key function with normalization at the original read site.Partial follow-up to #981. Explicit/nested key encoding and keyed component-slot coercion remain open.
Changes
@forkey identity, the public callback's two arguments and receiver, key/coercion evaluation order, development duplicate-key diagnostics, and empty-fill/error cleanup.@foroutput remains unchanged.@forcontrols, plus a patch changeset.Performance evidence
@forcontrol: 0 → 0. All cases preserve full markup, survivor nodes, typed input values, and focus.Validation
./node_modules/.bin/tsgo --noEmit -p packages/octane/tsconfig.json./node_modules/.bin/tsgo --noEmit -p packages/octane/typetests/tsconfig.jsongit diff --check; test-marker check.pnpm syncpnpm test,pnpm typecheck, and repository-wide formatting were not run.bf66a67a4. The merge incorporates main fix: stabilize main CI failures #1056, fixing the prior Three camera type failure and Solana module-reload timeout. Cursor Bugbot passed, all review threads are resolved, and the worktree is clean. GitHub still requires reviewer approval before merge.Local tests used a temporary selection of the repository's existing
octane/octane-prodprojects, retaining their compiler plugins, exclusions, environments, and per-test setup. The unrelated React differential-fixture precompile was omitted because the selected suites do not use it. No additional dependency download was needed. Commands:vitest run --config /private/tmp/1057-vitest.config.mjs(216 tests), thenvitest run --config /private/tmp/1057-related-vitest.config.mjs --maxWorkers=4(856 tests).The rebuilt production work fixture matches the measured candidate byte-for-byte (
6b19ce09eb24956a00c0da2bdb26557b3bba227ed65aa1b4c2e3492e549522a8). Standard production/server mapped fixtures and ordinary@foroutput are unchanged. Dev andautoMemo:falseguarded component maps now pay for a full component slot to preserve transitions; measured emitted-code deltas were +5/+17 bytes, not a heap-cost measurement.CI attempt 1 hit a Vitest browser-orchestration error while starting the adapted Base UI
MeterTrack.test.tsx, with no assertion failure reported. That exact Chromium fixture passed 15/15 tests locally. The targeted shard retry and its dependent checks passed without further code changes; the underlying browser error cause was not available in the CI log.Risk / follow-ups
This touches key reads in the shared client reconciler and component-slot selection for guarded map item roots. The original failing hydration scenario is preserved. No server implementation or public/compiler ABI changes. Current-head CI is green; the full local differential suite was not run.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
High Risk
Changes keyed reconciliation in the shared client runtime and compiler component-slot selection for map item roots—areas that affect hydration, list identity, and reorder correctness.
Overview
Removes per-list key callback wrappers in the de-opt child-list path: reconciliation now reads prepared key arrays directly or invokes compiled map key functions at each read site via
readListKey, eliminating 512 executed callback constructions per phase in the new work gate while keeping@forcallback semantics, duplicate-key diagnostics, and hydration behavior.Fixes guarded
.mapitem roots in the compiler by passingmappedItemintoplanJsxso component map roots always use a full component slot (not a lite scope), preserving DOM/input identity when switching between nativeArray.prototype.mapand a custommapimplementation.Adds an opt-in
WORK_MODE=key-callbackbrowser benchmark (descriptor lists, native mapped lists, compiled@forcontrol), README evidence, a patch changeset, and expanded tests for nested descriptor reorders, mapped hydration, object keys, and manualforBlockkey errors.Reviewed by Cursor Bugbot for commit bf66a67. Bugbot is set up for automated code reviews on this repo. Configure here.