Repository navigation
fix: publish Action cues before native transition capture - #1872
domgan-oai merged 8 commits into
Conversation
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
8 other measured values are unchanged. Public-import reachability bundles (bytes)
37 other measured values are unchanged. |
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 c6321e1. Configure here.
…sition's capture #1872 pinned the old same-root order, where the Action cue and the explicit transition state in one component rendered together in the microtask flush and shared its native capture. The cue now renders apart from that state, as in the separate-root case: it commits without a capture, and the state is captured when its task renders it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Main c0192ec (#1889, #1872, #1883, #1878 landing together) failed the new "bundle size checks" job: binding-base-ui-vite measures 62,351 gzip, so the downward ratchet requires its budget to drop from 62,384 to 62,383. run-minimal.mjs and run.mjs --write-budgets on that head change nothing else. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tion (#1864) (#1888) * fix(octane): commit the pending cue apart from its component's transition (#1864) When the component that raises isPending also held the transition's own update, both rendered together in the click's microtask flush: the cue showed the new state, and the browser could not paint "pending" until the whole transition render had finished. That is the canonical useTransition pattern (the docs' ProjectTabs example, the playground's Sort button). React renders isPending in an urgent lane with the previous state and the transition's update later, in a Scheduler task. A pending cue now never renders transition work that waits for the task. When a transition update flushes for a block already queued for its cue (flushTransitionActionBatch), or a cue arrives for a block whose transition is waiting (upgradeTransitionBlock), the block is queued in both places. The microtask drain renders only the cue (splitTransitionCue), at urgent priority over the block's committed cells, through the exposure an urgent ancestor already uses for a child with a queued transition, then leaves the block pending for the transition task. Suspense holds after the cue, useOptimistic, urgent updates during the wait (which still render the transition with them), flushSync, act(), unmount and controlled inputs keep their behavior. A split cue renders outside a View Transition and leaves addTransitionType types to the transition's render. beginUrgentTransitionRender no longer reverts a hook cell whose queue a render already consumed, which could flash a committed transition value back, and no longer allocates a slot index or predicate closure per call. An urgent ancestor that already rendered a split cue spares the block's own queue entry a second render. Chromium Event Timing on the Sort pattern (memoized 40 ms list, 5 clicks): main 5/5 slow clicks (40-80 ms); now 1/5 (first, cold), matching React 19.2.7. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: temporarily carry #1887's budgets so the test shards run Shard 1/4 fails its byte budgets until #1887 merges, and fail-fast then cancels shards 2-4. This commit only lets those shards report; it is reverted before merge, and the raise lands through #1887. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): keep committed plain cells out of a later split cue FLUSHED_TRANSITION_UPDATES is retained while any block waits for the transition task, so a block's already-rendered updates can still be listed when a later pending cue splits on that block. Hook cells were guarded by their consumed renderTransition, but plain cells (useDeferredValue's swap, useLinkedState) were reverted to their pre-transition base: the cue flashed the deferred value from before the swap. When a block that is not queued is scheduled at transition priority, a render has consumed every update retained for it, so queueTransitionBlock marks them rendered and the cue's committed-cell exposure skips them. A hold that takes the entries clears the mark, so hold and promotion behave as before. Reported by Cursor Bugbot on #1888. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: update the temporary #1887 budget carry for the plain-cell fix Reverted with fdb2de9 before merge; the raise lands through #1887. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): a same-component Action cue now commits before its transition's capture #1872 pinned the old same-root order, where the Action cue and the explicit transition state in one component rendered together in the microtask flush and shared its native capture. The cue now renders apart from that state, as in the separate-root case: it commits without a capture, and the state is captured when its task renders it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: drop the temporary #1887 budget carry The bundle-size gates now run in their own job (#1889), so the runtime shards no longer need the raised budgets to run. The raise lands through #1887. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
A useTransition or useActionState raising isPending, or a useOptimistic value, rendered at transition priority in the click's microtask flush. When that render reached a descendant whose state the transition sets, the descendant rendered its new state there too, so the browser could not paint the cue until the whole transition render finished. React renders the cue in an urgent lane, where that descendant shows its committed state, and renders the transition in a later Scheduler task. The microtask flush now renders a pure cue (one with no transition work of its own) at urgent priority. renderBlockInner's existing urgent-ancestor exposure keeps descendants with waiting transition work on their committed cells, and they keep that work for the transition task. The cue marks live in the transition driver (TRANSITION_CUES) and are scoped to the queue epoch, so apps that never start a transition carry no new bytes. View Transition routing extends #1872's Action-cue rule to every pure cue: a drain of cues alone starts no capture, and transition work that rides with them (a root render, native signal work, staged state) keeps it. Co-authored-by: Claude Opus 5.5 <[email protected]>

Summary
An Action started under
ViewTransitioncan leave its pending indicator on the old DOM while the browser holds the native update callback. The pending render correctly keeps transition semantics for Suspense, but that alone should not make a cue-only drain start an animation.Track the Action cue in the optional View Transition capability. Publish cue-only work immediately, while preserving capture for state updates, root requests, and native signal work that this drain will actually render. A root or state update still waiting in the separate task queue does not qualify the cue's earlier drain. Clear consumed cue/transition records after real drains, including
flushSync, so a later cue cannot reuse stale linked-state work.This is a focused follow-up to the scheduler now on
main; the landed task queue and its priority rules are preserved.Validation
b7d152cc0runtime. Coverage includes a held native callback, microtask/synchronousact/passive entry, same-component and separate-root state, a descendant cue with a queued root request, native signal work, stale linked-state receipts, and Suspense retention.git diff --checkpasses; independent read-only complexity/correctness review is clean.perf-review: exactb7d152cc0source diff scan has zero candidates. No new render queue, per-Block field, or DOM measurement is introduced. Admission inspects existing queued-work receipts only when a cue reaches native capture.b7d152cc0: ordinary root exports +27 raw / -12 gzip bytes; transition exports without native View Transition +27 raw / +12 gzip. Canonical CI bundle measurements remain authoritative.044a81201is green: CI and benchmark report. All unit, Chromium, parity, static, build/package, and example gates passed. All 64 js-framework work counters remain unchanged.typescript-native; the CI results above use the pinned toolchain.Risk / follow-ups
The native callback tests establish controller admission and DOM publication, not browser snapshot or paint latency. Current-head Chromium/conformance, unit, and bundle checks pass; native browser snapshot/paint latency remains outside the controller test evidence.
Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes scheduler/View Transition admission in the core runtime around Actions and native capture; behavior is heavily tested but timing-sensitive integration with browser View Transitions remains the main merge risk.
Overview
Action pending cues (
useActionStateisPending) no longer force native View Transition capture when the drain is cue-only; pending UI can commit before the browser holds the native update callback. The View Transition driver tracks an Action cue viamarkActionCue/endCue, andqueueAllTransitionnow treats batches as animation-eligible only when real transition work (queued state, root requests, native signal receipts in the same drain) warrants capture—not when only the pending edge is flushing.flushSyncand synchronous drains clear consumed transition receipts (FLUSHED_TRANSITION_UPDATES) and end the cue so later Action cues cannot reuse stale linked-state work. Docs indifferences-from-react.mddocument this behavior.Also registers
@tanstack/react-query-devtoolsin the MCP React-package bridge and website binding catalog, with a minor bundle budget tweak and newtransition-task.test.tscoverage (held native callback, separate roots, Suspense siblings, etc.).Reviewed by Cursor Bugbot for commit 044a812. Bugbot is set up for automated code reviews on this repo. Configure here.