Repository navigation
perf: register client warm plans without empty batches - #1028
Merged
domgan-oai merged 1 commit intoSep 10, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
September 10, 2026 10:42
Closed
68 of 84 tasks
14 of 21 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
registerWarmPlan(thunk, void 0)instead of allocating an emptyuseBatcharray on each reachable render.Why
The compiler already uses
registerWarmPlanfor attached child plans. For client fallbacks that need an in-body closure,useBatch([], thunk)performs the same active-plan stack registration, but creates an array merely to select that branch. Passingvoid 0preserves the former stack entry's props value and registration point.Changes
puBatch([], thunk)on the server anduseBatch([], thunk)on universal units.useBatch/ 0registerWarmPlancalls to 3 / 1 across suspension and retry, with one start per resource and identical visible output. A fallback-only parent module drops its sole empty batch call and import; server/universal controls remain unchanged.octanepatch changeset.Validation
pnpm typecheckpnpm format:files:checkon all six changed filespnpm sync(no additional tracked changes)vitest run packages/octane/tests/parallel-use.test.ts --project octane --project octane-prod(126 passed)mainon isolated previews; all semantic, client-output, server/universal, context, and warm-adoption guards passed.pnpm test: the local Node 26 run encountered unrelatedlocalStorageavailability failures in Jotai and an email preview file-watcher assertion; repository CI uses Node 24. Current-head CI is the full-suite gate.Risk / follow-ups
The measured result is fewer emitted empty-batch call sites and fewer browser helper calls for the fallback case. No latency, heap-allocation, or bundle-size improvement is claimed. The remaining active-plan and cache work in #981 stays open.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes compiler output and runtime registration for client suspense/warm-plan paths; behavior is heavily gated but incorrect lowering could break parallel child warming or hydration updates.
Overview
DOM client codegen for complex parallel-
use()components now registers fallback warm plans withregisterWarmPlan(thunk, void 0)instead ofuseBatch([], thunk), avoiding a per-render empty array while keeping the same active-plan stack behavior. Server still emitspuBatch([], thunk)and universal still usesuseBatch([], thunk); direct data batches are unchanged.parallel-use.test.tsadds coverage for independent child fetches when the parent’s own read is already fulfilled (including rebound props) and for post-hydration updates after server prerender. The recursive-context work gate rebaselines compiler and browser counters (e.g. warm-plan control 3useBatch/ 1registerWarmPlan, fallback-only parents with zero batch imports, no empty-array batch sites on client controls) and documents before/after counts in the README. Anoctanepatch changeset records the release note.Reviewed by Cursor Bugbot for commit d1c7a8e. Bugbot is set up for automated code reviews on this repo. Configure here.