Repository navigation
feat(octane): commit unrelated transitions independently - #2222
Conversation
…uspense-rollback Co-Authored-By: Claude Opus 5.5 <[email protected]>
A transition batch can finish while a Suspense boundary renders: an urgent update that supersedes a held transition releases the hold inside the boundary's render (releaseHeldTransition -> releaseTransitionHookHolder -> finishTransitionHookBatch). The batch-scoped useOptimistic revert then scheduled its block while another component was on the stack, so dev logged "Cannot update a component while rendering a different component" and the block was flagged as a cross-render update. The global listener this replaced ran under the publish-depth guard; schedule the revert under it again via scheduleHookPublication. Also update the TRANSITION_PENDING_COUNT comment: optimistic lifetimes no longer subscribe to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Re-lands #2165 on main. It merged into `next` on 2026-10-20, after #2103 had already integrated `next` into `main`, and `next` was then deleted, so the change never reached `main`. This is the #2165 squash commit (2af686e) without its useOptimistic fix: #2218 scopes optimistic reverts to their transition batch, so this change builds on it rather than adding a second mechanism. React 19.3 renders each transition lane on its own, so a suspended transition no longer holds back an unrelated one: - The reveal barrier groups held boundaries that hold a common batch (stagedRevealGroup), so one transition's boundaries still reveal together while unrelated groups commit on their own, each once per flush. - A held boundary still on screen retries its batches when any thenable it suspended on settles, keeping the fresher thenable's resume and fallback timeout. Refs #2053. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 801a51d | Commit Preview URL Branch Preview URL |
Oct 23 2026, 08:38 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 2a13d4d | Commit Preview URL Branch Preview URL |
Oct 23 2026, 08:42 PM |
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)
13 other measured values are unchanged. Public-import reachability bundles (bytes)
39 other measured values are unchanged. |
main now has #2218 (squashed) and #2221. The conflicts were in #2218's own files, actions.ts and actions.test.ts, which this branch carried at #2218's earlier head; they take main's version. #2218's later commits revert a transition's optimistic values once a timeout fallback lets its batch commit around the fallback, so the behind-the-fallback case now pins only isPending, and leaves the optimistic value to that rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Flushed groups rejoin via missing holds
- Added a
flushed.has(other)check to the expansion loop instagedRevealGroupso that members already committed in the current scan cycle are not re-absorbed into later groups via the HELD_TRANSITIONS walk, preventing both double-commits and poisoned group formation.
- Added a
Or push these changes by commenting:
@cursor push f6efbb92a4
Preview (f6efbb92a4)
diff --git a/packages/octane/src/runtime/transitions.ts b/packages/octane/src/runtime/transitions.ts
--- a/packages/octane/src/runtime/transitions.ts
+++ b/packages/octane/src/runtime/transitions.ts
@@ -511,7 +511,7 @@
if (hold === undefined) unbounded = true;
else for (const batch of hold.batches) batches.add(rootTransitionBatch(batch));
for (const other of HELD_TRANSITIONS) {
- if (group.includes(other)) continue;
+ if (group.includes(other) || flushed.has(other)) continue;
const peer = TRANSITION_HOLDERS?.get(other);
let shares = unbounded || peer === undefined;
if (!shares)You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 6541257. Configure here.
stagedRevealGroup put every held boundary without a batch hold into every group. That one rule covered three different cases: a transition that folded no hook work (`root.render` in startTransition), a holder released during its retry, and members of a view-transition-deferred reveal. So unrelated groups were pulled together: a hook transition waited behind an unrelated root.render transition, and a deferred group could be absorbed into another flush. Boundaries without a batch hold now form one group of their own, the barrier before parallel transitions, and never join a batch's group. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ds its first render (#2223) * fix(octane): render a deferred value's final attempt while a root holds its first render When a root with no Suspense boundary suspends on its first render, a useDeferredValue mounted with an initialValue spawned its swap, but the rollback disposed the slot and the swap was dropped. The final value never rendered until the preview fully loaded. The swap now renders the root again as a deferred pass in its host task. Its suspension keeps the original attempt's wakeable live, so whichever attempt is ready first commits, as in React 19.3 (react/react#35392). Ports the two React 19.3.0 ReactDeferredValue-test.js sibling cases into parallel-transitions.test.ts, and :407 and :526 into deferred-value.test.ts, asserting committed DOM. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): retry a held root's deferred attempt once per swap task Each disposed useDeferredValue slot from a rolled-back root render called owner.retry(true) on its own. With two such hooks, the second deferred attempt rolled back the first and unioned only its wakeable, so the original attempt's data no longer retried the root and the initial values never committed. Collect held roots and retry each once. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ransition holds The sibling case from #2193 expected Gate's ready reveal to wait for Later's unrelated transition, the global barrier from before parallel transitions. Gate's root.render transition and Later's setLater transition are separate, so Gate now reveals once its own data lands while Later keeps holding; the primary, listener and event assertions run at that point. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l-transitions-main Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>


Summary
Re-lands #2165 (parallel transitions, matching React 19.3) on
main. Unrelated transitions commit independently: a transition that suspends holds only its own work.#2165 merged into
nexton 2026-10-20. But #2103 had already integratednextintomainon 2026-10-17, andnextwas later deleted from origin, so the change never reachedmain. This is the #2165 squash commit (2af686e) without itsuseOptimisticfix. #2218 scopes optimistic reverts to their own transition batch, so this change relies on it rather than adding a second mechanism for the same thing.Refs #2053.
Changes
runtime/transitions.ts:stagedRevealGroup(flushed)groups held boundaries that hold a common root batch, transitively, and returns one fully staged group at a time. Held boundaries with no batch hold (a transition that folded no hook work, such asroot.render) form one group of their own, the barrier from before parallel transitions, and never join a batch's group (third commit, after Bugbot).runtime/suspense.ts:flushStagedRevealsIfReadyflushes each ready group once per call, including when a view transition defers one of them.runcommits only the members still staged, and does nothing when none are left.attachResume: when a thenable this boundary suspended on settles after a newer one has replaced it, a held boundary still on screen retries the batches it holds (TRANSITION_ROOT_DRIVER.retry). The newer thenable keeps its resume and fallback timeout. A boundary already showing its fallback (hidden) waits for its current thenable.docs/differences-from-react.md, Scheduler section: a parallel-transitions paragraph, including that Octane has no 10-lane reuse.SUSPENSE_DIVERGENCE.mdaudit item Add changeset for the vyre→octane rename release #1 is updated too..changeset/parallel-transitions.md:octaneminor. It doesn't mention optimistic reverts; fix(runtime): scope optimistic reverts to transition batches #2218's changeset covers those.tests/conformance/parallel-transitions.test.tsand fixture, 11 cases:ReactTransition-test.js: separate and shared boundaries, reversed resolution order, same-queue entanglement, per-transitionisPendinganduseOptimistic, and a single-transition control;root.rendertransition is held (third commit);isPendingbehind a fallback, and view-transition deferral.Validation
On this branch (current
main, plus the re-land and #2223):pnpm sync: no changes.node scripts/split-runtime.mjs check: 34 modules, 0 violations.pnpm format:files:check.pnpm typecheck:fileson the changed runtime files, test and fixture.pnpm test: not run locally (machine load rule). Left to CI.main: everytests/hydrationfile plus the transition, suspense, optimistic, action and deferred-value sets, inoctaneandoctane-prod: 486 file runs, 19,556 tests passed.parallel-transitions.test.tspasses 18/18 inoctaneandoctane-prod. With thesrcchange reverted, on fix(runtime): scope optimistic reverts to transition batches #2218 alone, 6 of the 9 dev cases fail.octaneandoctane-prod: 130 files, 3,026 tests passed.perf-review: unchanged from feat(octane): commit unrelated transitions independently #2165.scheduleRender, which this PR no longer contains.concise-code: runtime issuspense.tsandtransitions.tsonly (+88 −25), with no new files or fields insrc. Rejected alternative: keeping feat(octane): commit unrelated transitions independently #2165's own optimistic revert, which would duplicate fix(runtime): scope optimistic reverts to transition batches #2218.Risk / follow-ups
fix(octane): publish resumed hydration events on acceptance #2193's hydration test "publishes a ready boundary when a sibling transition ends" expected a parked hydration boundary's reveal to wait for an unrelated transition: the old global barrier. Per the maintainer's decision, it is now "publishes a ready boundary while an unrelated transition still holds". Gate reveals once its own data lands, Later's separate transition keeps holding, and the primary, native-listener and event assertions run at that point. Sharing one
startTransitionfor both was tried first and doesn't create a two-boundary group: Gate's hold claims the shared batch before Later suspends.fix(runtime): scope optimistic reverts to transition batches #2218's final commits revert a transition's optimistic values once a timeout fallback lets its batch commit around the fallback. The behind-the-fallback case therefore checks only
isPending, and leaves the optimistic value to fix(runtime): scope optimistic reverts to transition batches #2218's rule. That narrowed case still fails without this PR'shiddenDomguard.Two of the Bugbot fixes (rescanning waiting groups, and skipping an empty deferred reveal) have no dedicated test. Each is reachable only mid-loop, and public behavior doesn't expose either.
Async Actions are unchanged: a transition started while an async Action is in flight joins it, as React's entangled action lane does.
Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
High Risk
Changes core transition/Suspense commit coordination and root suspension/retry paths; incorrect grouping or wakeable handling could cause stuck UI, premature reveals, or wrong commits.
Overview
Re-lands React 19.3 parallel transitions: unrelated
startTransitionwork can commit on its own schedule instead of waiting on another suspended transition. Staging/commit coordination now groups held Suspense boundaries by shared transition batch (stagedRevealGroup) and flushes each ready group independently; superseded thenables on visible holds can retry only the batches they were blocking.Also aligns
useDeferredValuewithout a Suspense boundary with React: a root holding its first render on the initial value can run a spawned deferred attempt, andsuspendRootRenderretries on whichever wakeable settles first. Deferred swaps batch into oneroot.retry(true)per held root.Docs, audit notes, ledger entries, and conformance tests (
parallel-transitions.test.ts, extendeddeferred-value.test.ts) record the new behavior.Reviewed by Cursor Bugbot for commit 2a13d4d. Bugbot is set up for automated code reviews on this repo. Configure here.