Repository navigation
refactor: integrate next runtime redesign - #2103
Conversation
…ctanejs#2043) (octanejs#2044) * test(octane): convert the parallel use() error-order test to React's error model The source-order first rejection still wins over an earlier-settling later one, but the server now reports it through onError and ships the pending fallback for a client render instead of rendering the catch arm. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): keep transition signal writes in one pending slot per node (#2043) Signal writes inside startTransition keep fork semantics on the renderer's update-queue model instead of per-transition fork frames. A node written or derived inside a transition batch keeps its committed state and at most one pending slot tagged with that batch (signals/pending.ts). Committed readers, subscriptions and DOM bindings read committed state; a render folds a ready batch's slots exactly when it folds its hook updates, and the transition's synchronous callback reads its own. An urgent write updates committed state and re-applies on top of the pending value. A batch that writes or derives a node already pending in another batch entangles with it, as hook queues do. When a batch and the batches entangled into it finish, their slots promote before the commit that presents them accepts its reads; DOM bindings present the change before public subscribers hear of it. A held batch also holds other roots that rendered its signals, so a shared signal never commits in one root alone. This deletes SignalActionFrame, the transition coordinator and candidate sources (transition-action.ts, transition-coordinator.ts, transition-candidate.ts), the renderer's native transition glue, and the DOM-binding transition markers. Pending code keeps the octane-islands placement through action-capability*.ts. A held transition unblocked by its boundary's timeout fallback now renders in the transition task, after the fallback's commit and effects. A signal transition renders in the transition task like other transition work. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): pin fork semantics of transition signal writes on pending slots A held transition keeps committed readers and DOM bindings on the old value while urgent writes commit and the transition re-applies on top of them; two transitions that write one signal commit together; a dropped render leaves no pending state behind, its private request aborts and a later transition on the same signal commits on its own. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): recapture the deferred-hydration fixture's server HTML for wire v2 The minimal deferred-hydration scenario hydrates a hand-copied server render. Hydration wire v2 (4ccd446964) renders a Suspense boundary without a fallback, which <Hydrate> uses inside its wrapper, as one range instead of two, so the copy had one range too many. The client reported the mismatch, rendered the island on the client and dropped the click captured on the discarded button, as docs/deferred-hydration.md specifies, and the scenario read that detached button as still dormant. Recapture the HTML from renderToString(DeferredRoot), and report whether the island adopted the server button, so a stale copy shows as a non-adoption rather than as an island that never activated. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): pass suspension on from a server @try without @pending (#2028) On the client a @try without @pending is not a Suspense boundary: tryBlock sets propagateSuspense when it has no pending body, so a suspension inside it shows the nearest @pending fallback, as React's error boundaries do. On the server it caught the suspension itself and, in a stream, registered a boundary with an empty placeholder. A later throw in its content then took ssrTry's recovery path because that boundary had a stream entry, shipping a client-render instruction for it instead of passing the error on, while the buffered renderers and an error thrown before the suspension rethrew. ssrTry's propagateSuspense now defaults to pendFn === null, mirroring tryBlock. A catch-only @try never registers, so its suspension and its errors reach the nearest Suspense boundary through the existing pending/errored paths, or the root when there is none: the shell waits, and a later error fails it. The <Hydrate> wrappers, which own their suspension, pass false explicitly, and compiled presentation-binding views keep passing their own flag. The lowered JSX ErrorBoundary no longer needs the explicit flag, so its server call drops `, undefined, true`. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(octane): a server @try without @pending does not hold a suspension (#2028) State that a @try with only @catch, like ErrorBoundary, is not a Suspense boundary on the server either: a suspension inside it ships the nearest Suspense fallback, or holds the shell with none above it. Covers the render-errors section, the Suspense divergence note, and the server-errors changeset. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): render a direct binding's owner with a transition that writes its signal A transition that writes what a direct signal binding presents renders the Block that owns the binding with its batch, so the read its render records can hold the transition; the binding itself still writes only committed values. A hookless component's stand-in resolves to that owning Block. A held batch with pending signals also drops the other roots' renders of it in the same drain, so a shared signal never commits in one root alone. The renderer -free control binding no longer carries a transition marker. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): pin hookless and cross-root reads of a held transition's signals Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): check pending signal placement in the bundle-boundary suite (#2043) Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(octane): describe transition signal writes as pending slots on the update queues Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): place a fresh direct-host row's root at commit (#2043) A committed list's direct-host row keeps its one root detached: commitBag self-marks the row with it (DETACHED_ROOT), and the list's log inserts it before its anchor at commit. The row needs no fragment to render into and no rehoming, so a fill does the same DOM work as before off-document rendering. Other rows still render into a run fragment. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): settle a batch's signals with its root and share pending world scoping Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: changeset size for pending signal slots Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): hide and reveal boundaries at commit (#2043) Inside a root render, a Suspense primary's hide (HIDE) and reveal (UNHIDE) are commit ops: the hide lands after the content the render built, the reveal ahead of the content it patches, and a dropped render touches no display or text state. A changing Activity journals its visibility record, its Block's inactive flag and its suspense handler, and reveals at commit, so a dropped render leaves it as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): count opaque attribute work against commit-time direct signal bindings (#2043) Since 1dd1cd68ab a direct signal attribute records into its bag in render and its commit function calls bindSignalAttribute only for a recorded value. A value equal to the committed one, including undefined, an object, a function or an unchanged handle, records nothing, so neither the helper nor the policy runs. The guard still pinned the render-time helper call on every update. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): release a held transition in one render, as React does (#2043) Since 1d632e8490 a held transition is queued hook work that its holder retries at transition priority, so the release renders the new value with isPending's falling edge once, as React retries the transition lane (checked against React 19.2.7: hold [prev,true],[next,false]; release [next,false]). The control still expected the promotion render the queue model removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): delete the DOM binding transition preview (#2043) The signal-transition queues removed every NATIVE_TRANSITION_CONSUMER registration on binding views, so nothing calls a view's drain(true), assigns a program transaction's preview, or calls a connection's, style's, projection's, read tracker's or control lease's preview(). Delete that path from dom-bindings.ts, dom-binding-program.ts and their signal, style, projection and control leaves, with __prepareBindingSources, BindingPreparedValue, BindingControlPreview and NativeTransitionPresentation. Their notifies never carry a consumer now, so forwardNativeTransitionConsumer was an identity there and goes too. The error-code generator stops listing the deleted transition-candidate module, and the Lynx plan names the consumer tag that replaced the presentation protocol. Binding-view bundles in the bundle-boundaries suite shrink 330 to 1,180 B gzip (scalar view 3,548 -> 3,072, renderer-free binding 23,385 -> 22,810, StyleX combined 76,235 -> 75,177). Apps without binding views are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(bench): expect no journal snapshots from commit-time handler and style writes (#2043) Since dc409debd6 a compiled template records changed value bindings into its bag and its commit function writes them, outside any journal window. A changed handler capture no longer snapshots its native bundle (100 -> 0), and an updated inline style no longer snapshots the style attribute (Happy DOM reads 700 -> 600 for both consumers). The guards still pinned the render-time snapshots; their semantic controls are unchanged and pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): read a hydrating slot's open comment through a local receiver 4ccd446964 (mountTry) and cff07abee1 (renderBranchSlot) read the slot's open comment as `(STAGED_DOM ? STAGED_DOM.view(state.start) : state.start).data`. The staged-DOM check accepts a staged receiver only around a local identifier, so it reported both reads as unclassified native operations. Hoist the slot's start into a local, as every other staged comment read does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): resume boundaries as root renders, and mount late slots off-document (#2043) A boundary's resume or hidden retry that runs outside a render (a thenable settling) now renders as its root's render (inBoundaryRender), so its commit, not its render, writes the DOM: the fallback stays and the primary stays hidden until the reveal commits, and a retry that suspends again leaves the screen alone. Under a ViewTransition driver it still renders in place (step 3). That makes the slots a committed Block first reaches after an earlier render suspended (component, lite component, child, list, try and Activity slots) build in a frontier their commit inserts, so content lands in render order beside slots that changed in the same render. A component whose earlier render suspended still mounts its first template in place. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): checkpoint boundary windows into their render's capture (#2043) A committed boundary's transition window, and a resume's replay, no longer allocate a capture of their own inside a root render: they checkpoint the capture the render already records into. Success costs nothing, and a drop truncates the window's effects, events, refs, stores and render cleanups. Native reads, and reveals that reconnect effects against their own queues, keep a separate capture. Each root owner also reuses its commit queue across transactions rather than allocating one per render. Together these bring the transition-hooks held phase from 91 to 64 arrays a cycle. Also: catalog the frontier rehome assertion as error 346, and delete the unused returnSlotTail. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): clear a root container at commit; nested windows copy outer pending structure (#2043) A synchronous root mount queues the container's previous content as the frontier's first outgoing entry, so a render that never commits leaves it in place. A slot or list whose pending structure an outer window built is copied on a nested window's first touch, so that window's drop gives it back; a structure the window built itself is marked and left to the ops truncation. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): delegate a portal target's events from the commit that inserts it (#2043) A portal a root render builds off-document registers its event range and its target's delegated listeners from a commit op, so a dropped render attaches nothing to the target. A portal torn down before that commit gives back no share it never took. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): render a ViewTransition's batch and commit it in the native update (#2043) vtFlush runs a render-only drain: root transactions are held, not committed, so the batch builds off-document like any root render (frontiers, framed resumes, portals) and its commit lands inside the startViewTransition update, with layout after resources as before. A render that would join a held transaction commits it first; a root unmounted or replaced while the commit waited drops it, and an early presentation that changed is prepared again before any staged write lands. Planning reads the DOM the held commit will leave (vtPreview). An interruption the drain causes waits for its end, and an empty flush no longer skips running animations. Render-time writes to committed DOM that remain still stage through DOMStage during the drain, so commit-phase staging (staged root owners, rejected presentations) is gone but DOMStage itself stays for now. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): run the ViewTransition files with DOM staging off (#2043) pnpm test:vt-staging-off runs the 27 ViewTransition test files with OCTANE_VT_STAGING_OFF set. The test setup turns that into a development-only global that makes vtFlush drain without DOMStage and with an inert staged commit capture, as the runtime will once both are deleted. Each render-time writer that still needs staging then fails the tests pinning the old snapshot; the writers moving to commit use it as their acceptance check. Production builds drop the switch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): gate hydration range probes by mount-path family (#2028) scripts/hydration-probe-audit.mjs runs the hydration suites with the probe audit on and sums every probe miss and fallback by the mount-path family that made it: returned values, de-opt descriptors, component calls, template roots, holes, lists, branches and root entry. It fails when a family exceeds its budget, or when a probe belongs to no family. Each step of the hydration cursor redesign takes its family to 0. The budgets start at today's counts. The reporter now reads frames V8 prints with an alias (`fn [as body]`). It had skipped them, crediting de-opt item and return-slot probes to renderBlockInner. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(octane): render a returned value directly in its component's range (#2028) Hydration protocol 3 (P2). A component's returned value now renders inside the range that bounds the component's output, instead of in a second range of its own, and so do the values of components it returns in turn. On the server, RETURN_IN_RANGE says whether a range bounds the rendering component's output: its own frame, its returning component's range, or for an M3 call its parent's. A root's output has none, so a value the root returns keeps its range, as does a keyed returned element, which the client renders as a one-item list. The compiler marks the sole root of a `return <jsx>` body with inherit `2`, read by ssrComponent and ssrChild. On the client a return slot's first hydrating render borrows its block's range whenever the block's markers are a server pair (returnsInRange), and a returned single-root component inherits it. This replaces the special cases for an empty range, a synthetic root range and server text (isUnframedRootRange, holdsServerText), so a returned text no longer gains an inserted anchor comment. lendRange stops probing and counts as protocol, not a fallback: the returned-value family is at 0 probes. Template-root claims take 216 more misses, which the next template commit makes strict. The seed script names version 3, and a version 2 root renders on the client with error 345. The binding hydration suites' captured server HTML is recaptured. A tail mismatch in a returned value now names the call whose range holds it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): mount the storage-candidate test's input from outside the root container (#2043) 8ad7d72b39 clears a root container's previous content at the mount's commit, as React does. The test's hand-written body moved its input into the root's range only when it was disconnected, and it started inside the container, so the body left it there and the commit removed it. Start it outside, so the body mounts it into the range it renders. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): snapshot a resumed boundary once, and skip the hold lookup while nothing holds (#2043) A detached boundary render that opens its own frame snapshots the TrySlot directly instead of looking it up first. holdsUnrenderedTransition returns early while no holder exists, which restores transition-hooks held_map_gets to its 1,793 ceiling (1,920 before). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): build Suspense and error boundary arms off-document (#2043) A root render that changes a committed boundary now builds its incoming arm in the slot's frontier (insertArmPair) instead of in place: the try body of mountTry and mountErrorBoundary, the pending arm, the restarted hidden primary, and both catch arms. Commit inserts the fragment before the boundary's end (the hidden primary before the visible fallback), so a dropped render leaves the boundary's DOM untouched. TrySlot and ErrorSlot gain `next`; beginDetachedBoundaryRender journals the boundary's range only while hydrating, which still writes in place. A Block whose first render suspended (a primary that never resolved) is never marked mounted, so its deletion ran at render and a dropped render lost its markers for good. defersRootUnmount now defers every Block an earlier render created. The for.test.ts retry case read the live document mid-render; its fresh body now renders off-document like the first attempt. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): write committed de-opt hosts at commit (#2043) A root render over committed DOM no longer patches a de-opt host as it reconciles. reconcileDeoptNode and hostElementBody resolve the descriptor record in render and queue one DeoptOrder per host: at commit it runs setHostProps against the committed DEOPT_DESC, stamps the record, and places the children's order. A committed Text's data is a record of its own. A later pass of the same render starts from the pending record, its children from `nodes` rather than the DOM, and getDeoptDesc reads the pending record. The order no longer lands at render. A replaced element (deoptItemBody, hostElementBody's tag change) builds in a frontier its commit inserts; a self-marked item's markers move to the replacement as it lands (the frontier's bound), so the keyed list's own entry, which runs first, still moves it by the node it shows. promoteSelfMarkedItem still mints its pair at render: the list splices its entry ahead of the item's, so a pair inserted at commit would not exist when the list moves it. A compiled handler's authority refresh in a root render publishes at commit (queueEventOwner). A same-component root.render from a mutation-phase callback no longer ends the commit that runs it: the commit finishes, with its effects, as React's does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): write head elements, native styles and hostComponent at commit (#2043) A root render over committed DOM now computes these and queues the write: - headBlock keeps a committed element's next attributes and text in HeadSlot.next, applied by one commit entry per transaction. A new element is still written before it joins <head>; namespaceHead's teardown of a committed entry is a queued deletion. - nativeStyleBody, nativeProjectionBody and writeScalarNativeStyle read and resolve in render; the write and the publish of the committed value (slots[0] or the scalar binding's style) are a commit entry. - hostComponent applies props to a committed host at commit, after its children's entries, in the Scope that rendered them (commitInScope, shared with the de-opt host commit). A host that first appears under a committed Block lands from a frontier, and a render that drops forgets it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): project a controlled select's value at commit (#2043) setSelectValue no longer projects onto the options during a root render; the commit's controlled sync (drainControlledSyncs) projects it once the options are placed, so a render that never commits leaves the selection alone. A root render always queues that sync. Writes outside a root render, such as a de-opt or hostComponent commit entry's, still project at once, and a ViewTransition drain's DOMStage still stages its render's projection until staging is deleted. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): reconcile a host's pending de-opt order on the general path (#2043) A later pass of a root render over a host with a pending order now skips the scalar-text and fresh-host fast paths and matches against the order's nodes on the general path. Drop the $$deoptOrder prototype seeds: the reads are per changed host, not per scanned child. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): test the staging driver by truthiness in setSelectValue (#2043) A `STAGED_DOM !== null` comparison kept the driver in split-shell's runtime chunk (run-minimal reachability gate). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): queue no de-opt record for an unchanged committed host (#2043) A committed descriptor host whose props would write nothing (equal values, no controlled field to reassert) stamps its record in render, as before, and queues no commit entry; its children queue an order only when their nodes or order change. The commit places children past foreign ranges unconditionally, so the record drops its `skip` flag. hostComponent's first insert journals its slot only when the root attempt would not discard the Block whole. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): change a child slot's text at commit (#2043) A render over committed DOM no longer writes a child slot's text. New Text waits in the slot's frontier, which commit inserts after the outgoing content leaves; a markerless only-child Text appends through a frontier of its own, and its removal, a translator reset and kept server content leave at commit. A steady text change on a Text the DOM shows queues a commit write: render compares against the DOM until the transaction queued a write to that node, and every later change then queues too. A host's first component child and a pure host the slot builds land through the frontier as well, and a markerless host leaving its slot for anything but another host takes its new marker pair with it at commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(compiler): commit renderable holes through two cells (#2043) A template hole records its raw value and its Text into commit cells (bagHole, bagChildHole) instead of writing at render. A primitive into the hole's committed Text records only the value, which the commit function writes; anything else renders the slot now, off-document over committed DOM, and records the Text it settled on, which commit publishes with the value. A staged bag's cells are the hole's pending state, so a second render in one transaction compares against them. Holes record after the template's first bagDone, which keeps a queued bag's cells for them, and a trailing bagDone queues or commits what they recorded. Certified repeated rows mount their holes directly and call the recorder only for a change, an object, or a moved cell, so a stable row costs no extra call. Render-time text writes outside commit functions (holes the recorder writes in order, signal children, signal text scalars, commit-less templates such as presentation views) go through setRenderText, which queues the write while a render may be dropped. setText stays the commit-time writer. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): commit hosts that resolve props across sources, and raw HTML (#2043) Every host whose props resolve across sources (spreads, duplicate props, form cascades, dev customized built-ins, textareas and native-read hosts) now records its sources at render (bagRecordHost) and resolves and writes them in its commit function: setHostPropSources for a plain host, the signal binding otherwise. A native-read host still reads its winning style in render, so the render observes it. Raw-HTML ownership still resolves at render; setHTML and setScriptText write at the commit of a render that may be dropped. A direct signal binding, signal child or signal host notified while a root renders schedules its owner's render instead of writing mid-render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): restore a held ViewTransition's committed selection on a user edit (#2043) A controlled multi-select whose value resolves across writers records its target at commit (9d80f4d61d), so a user edit while the transition is held restores the committed selection rather than the one the held render asked for. Fails with DOM staging off when the host's sources resolve in render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): adopt component calls only at the range the server framed (#2028) The server frames every component call that does not inherit its parent's range (protocol 3), so a hydrating call now adopts the range at its anchor, or, appended or as the sole hole of an arm, the one at the cursor (HydrationCapability.callOpen). Anything else is a structural mismatch that names the call site. Under a root or island attempt that defers (adoptOrDefer), the call renders on the client, detached, so an earlier suspension still wins over a later mismatch. This deletes in-place and unframed adoption: unframedRoot, renderUnframed, renderInPlace, parkAtHole, parkInPlace, takeUnclaimed, settleUnclaimed, the lite in-place paths and the inPlace*/unclaimed* cursor state. A fresh client render borrows its block's range for a returned value too, so it mints no anchor comment for it. Server and compiler changes that make the shapes agree: - A `@for`/`.map()` item whose only content is a component keeps the component's own range inside the item's (canShareSsrComponentItemRange and ssrSingleRootComponents are gone), and a `.map()` that runs another collection's `map` serializes its component items the same way, so either receiver hydrates the other's HTML. - A returned renderer descriptor at a root renders inline on the server, and an independent island's sole component keeps its frame, as the client's hydrate boundary module expects. - A keyed or configured `<Activity>` in a `.tsx` return passes its children as a children block on the server, as the client compiles them. Tests that pinned in-place adoption now assert the structural fallback: one recoverable error, the client's DOM, and a development warning that names the call site. The probe audit's components family is at 0; its misses moved to template roots (templates budget 5701 -> 5900), which commit 6 makes strict. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): re-place a de-opt host's children after their own commit entries (#2043) A committed host whose children kept their nodes and order queued no order (52ca5f979a). But a child's own commit entry runs first and can move it: the docking editor's attribute write makes its custom element reparent itself into another container, and nothing put it back, so focus-restoration's "restores a focused editor moved into another container" failed (both anchor cases). The host now skips its order only when its children queued no commit entry; otherwise the order runs after them and moves the editor back with its focus and selection, as before the writes moved to commit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): commit island fallbacks, root replacements and Hydrate disposers (#2043) Three hydration paths still wrote the visible page while a root render was being prepared, which only DOMStage hid from a ViewTransition: - An island whose activation falls back builds its client render in a frontier (fallBackOffDocument). The commit removes the server's nodes in its range and after it, inserts the client render before the range's end and gives the island's Block back its markers. A render that drops leaves the server DOM as it was. - A root render that replaces the root component mounts the new tree in a frontier, which the commit inserts after the outgoing screen before that screen's deletion. - A Hydrate boundary disposes its strategy and prefetch installers as a commit op, so a transition that suspends keeps them alive with the server DOM it keeps. An island that activates in a root render that can still drop journals the server nodes its attempt changes, as a root's hydrating attempt does, so the retry after the drop adopts the server DOM afresh. Under a staged drain DOMStage still discards them itself. pnpm test:vt-staging-off now passes all 27 files. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): delete DOMStage; a ViewTransition render writes no committed DOM (#2043) Every render-time writer now waits for its commit, so a ViewTransition's held drain needs no staging. This deletes: - src/dom-stage.ts and the STAGED_DOM stage, with every `STAGED_DOM ? STAGED_DOM.view(x) : x` receiver (908 sites) and domNode; - StagedCommitCapture: the staged owner receipts, guards, queue capture and publication, and the driver hooks that routed lifecycle work through it (stageAction, stageTeardown, stageDeactivation, projectEventBundle, projectControlled, stageDelegation, recordStageEntry, retireHostTree); - the projected signal-host binding and the staged direct-binding activation, which now run as written; - the development-only staging-off switch and `pnpm test:vt-staging-off`: it is the only mode now; - DOMStage's own adapter tests and benchmark. The deferred-layout driver keeps only what the layout phase after fonts and images needs, and its capture no longer nests. A scope host's stylesheet is injected at commit, into the document the host lands in (an iframe's). The island save journaling no longer depends on the stage (the behavior-root island case needs it either way). scripts/check-staged-dom.mjs becomes check-render-writes.mjs: every native DOM write in runtime.ts must sit in a function classified in scripts/render-writers.mjs (commit, primitive, fresh, hydration, rollback, unmount, native). Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: pnpm sync Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): adopt templates, branches, lists and holes only in the shape the server framed (#2028) The server frames every slot (protocol 3), so hydration no longer probes the server DOM for another shape it could adopt instead: - Opens. resolveOpen is the one rule for a slot's first render: the range at its anchor or, for an appended or sole slot, at the cursor. Component calls, @for lists and renderable holes use it, and anything else is a mismatch unless the slot renders in a range the client built. - Lists. A @for range must carry its item marker (`[f0`/`[f1`): a plain range is a mismatch rather than a legacy shape to inspect. A compiled list's row adopts by the compiler's static shape, one element or a range, so legacy per-row ranges around one-element rows fall back. An adopted list parks the cursor past its range, as a component does. De-opt descriptor lists keep their per-value probe (deoptItemSelfDelimits) until #2028 P4 decides it statically on both sides. - Branches. An arm whose server range holds more than the client renders is always a mismatch (settleArmTail), and a mismatch the attempt deferred is reported before any later one. The arm tail and slot-count tracking that excused the cases the cursor could not tell is gone. - Holes. An element's only text child adopts bare server text only: textFrameEnd, unframe and framesSlotContent are gone. The server now serializes a signal's text and a `.tsx` ternary only child as bare text, as the client renders them. The probe audit's templates, holes, lists and branches families are at 0. The de-opt item probe moves to descriptors (commit 3), and the unframed root return and passthrough root list probes to roots (commit 10a). Tests that pinned a legacy shape now assert the fallback, with OCTANE DIVERGENCE notes: legacy per-row pairs in for-hydrate and an empty component frame where the client renders an empty text in the React reconnecting conformance suite. The sonner hydration fixture is recaptured. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): pass a React island's server error through the Octane error boundary As in React, the server never runs an error boundary: an error thrown by a React island under an Octane ErrorBoundary fails the render when no Suspense boundary is above it, and otherwise reaches onError and leaves the Suspense fallback for a client render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): decide a descriptor item's range by its value on both sides (#2028) A descriptor list item has no range of its own exactly when it renders one host element and nothing in it needs a component's range. That rule, selfDelimits in hydration-protocol.ts, is the one the client's de-opt reconciler already used to self-mark an item on a fresh mount, and now the server's serializer and the client's hydration use it too, from the item's value. - Server: a host whose children are other hosts or arrays no longer gets a range (serverHostHasPrimitiveChildren is gone). ssrHostElement records whether its children needed a component's range, from the children value it already read, so a descriptor's fields are still read once. - Client: mountItem adopts a descriptor item bare or ranged by that rule, without probing the server DOM. An item in a range it does not need, as an older server wrote every host, is a structural mismatch. The mapped fallback's per-list probe (markerlessMappedFallback) and its deoptNode wrapper are gone: mountItem seeds every self-delimiting item's node. - deoptItemBody lends a component-bearing item's server range to its nested slot through the same borrowed-slot literal a client mount builds, so HydrationCapability.lendRange is gone. lentSlot stays: that slot's first render still has to claim the range. The probe audit's descriptors family is at 0 (lists 2114 -> 1827 as de-opt rows stop probing). The test that pinned the older marked encoding now asserts the structural fallback. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): land late boundary markers, hidden remounts and de-opt pairs at commit (#2043) - An ErrorBoundary new under committed DOM builds in a frontier, as a @try's does (freshSlotEnd). - attachResume remounts a discarded primary hidden and retries it inside one boundary render, so the arm pair and its hide land with that commit. - A self-marked de-opt item promoting to an `it` pair mints the pair off-document. Its commit inserts it around the node after the keyed list's own entry has moved it, then re-points the item's markers; the render builds against the pending pair (itemRange), which also counts as the item's shared bound for an incoming component's pair. - A markerless slot whose host a pure-host upgrade adopts lands its pair around the host at commit (landHostPair). A host it cannot adopt now renders through the slot's frontier like any other value. - The compiler's dangerCommit/formCommit bindings, and the dangerValue and formValue sources they collected, were unreachable: any spread already routes every prop through the host collector. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): hydration value writers keep server values without comparing (#2028) Commit 8 of the hydration cursor plan. An adopted element's attribute, class, style and raw HTML writers return while hydrating, and production compares nothing but stale server values (a dormant island whose captures changed), which keep their raw comparison until staleServerValues goes. Development's one-warning-per-pass comparison moves to hydration/dev-values.ts, which no production bundle includes. settleValues becomes settleTexts: production settles only the render-phase texts. A new stale-capture case pins each kept value (attribute, class, style) on its own, and that captures moving no value keep the server's element. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): fail a hydration mismatch through one entry (#2028) Every structural mismatch now throws through HydrationCapability.fail, or failAt for a slot whose call site names it, and passes every @catch and ErrorBoundary on its way to the nearest Suspense arm, Hydrate island or root, which renders on the client as before. The variants that wrapped it collapse into those two: - itemMismatch and listArmMismatch are inlined at their one call site each. - settleItems and settleArmTail share one leftover check: server content between the cursor and the close of a range its owner finished rendering. - UnclosedHydrationRange is a HydrationMismatch with error 338, so a server range without its close reaches onRecoverableError as the same error as any other mismatch. adoptOrDefer stays: a suspension earlier in React's order still keeps the server HTML ahead of a later mismatch. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): let a hydrated boundary body borrow the boundary's range (#2028) The server renders a Suspense, `@try` or ErrorBoundary boundary's content directly inside its one range (protocol 3), and the client's body now adopts that range as its own instead of inserting a `try-b` pair inside it while hydrating. armRange keeps only its presentation-binding branch, whose arm has a range of its own, and writes nothing. A dropped attempt has no markers to restore. The first arm that shows beside a body that borrows the range mints the body's own end. mountPendingBody creates it with the fallback's pair, so it lands with the fallback at commit, and hideBlockHostRange stops at the boundary's end as well, for a hide that commits before that arm lands (a held transition that times out). A catch arm replaces the body, so it needs none. Tests: hydrating a resolved boundary inserts no node (a MutationObserver pass), and an update that suspends a hydrated body, and a held transition that times out, show one visible fallback beside it, hide nothing after the boundary, and reveal the same nodes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): compiled use() sites seed through an opt-in module (#2028) Commit 11 of the hydration cursor plan. seedOrCreate's site seeding, its factory thenables and their materialization move from HydrationCapability to hydration/use-seeds.ts, which the first compiled site a hydration pass seeds installs (SEED_SITES). A hydrating app without a compiled use() creation ships none of it, nor the public use() that the capability's factory branch kept alive. Positional seeds stay with hydration: every use(thenable), and every thenable a component renders as a child, consumes them in render order. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(vite-plugin): update the root catch and signal placement checks to the redesign - The root catch route follows React's model for server rendering errors (93bcf89132): the server ships the root's pending arm with an instruction to render it on the client, where the catch arm renders. The dev and production bodies still match once each response's stream token is normalized. - The islands placement oracle looked for transition-action.ts and transition-coordinator.ts, which 50c02aefc1 replaced with pending.ts. It now checks that module's placement. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): test an unchanged row hole once, and stage cells without fill() (#2043) js-framework select on the jsx fixture re-renders every row, staging each row's bag for its fresh handlers. Since holes commit through two cells, a stable row hole paid for an unmounted-marker test and a four-way staged check before its skip, and every stage paid for Array.prototype.fill's builtin call. - A certified row hole now tests `_o || committed !== value` first, then `_n === null ? staged : _n[cell] !== bag` (a render's own `_n` implies the bag is staged, the form bagChildHole already uses). Only a hole that passes tests its unmounted marker, which is never a value. - stageBag fills a staged bag's cells with a loop instead of fill(). Paired select on minified fixtures, per click: jsx 0.874x head (0.924x the pre-two-cell base), tsrx 0.975x head. A new prod-mode test renders keyed rows twice in one drain, moving their holes and moving them back, with and without a binding before the hole; dropping either staged branch commits the stale value. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): stage a bag's first update into a pooled cell array (#2043) A bag allocated its `next` cells on its first stage and kept them, so the first update of every newly mounted template allocated one array: the transition-hooks cycle, updater, dispatch and click phases ran one array over their limits, and urgent (two bags) two over. stageBag now takes its cells from BAG_POOL, eight spare arrays seeded at module load, sizing a pooled array to the bag and keeping it packed. While the pool is short, a commit returns an idle bag's array to it (runCommitOps after each op, bagDone after an immediate commit); bags beyond the pool keep their own, so a large list re-render makes no pool traffic. transition-hooks arrays: cycle 1793 -> 1792, updater 1793 -> 1792, dispatch 705 -> 704, click 705 -> 704, urgent 1858 -> 1856 (limits 1792, 1792, 704, 704, 1856). Removing the pool restores the overruns. Paired select per click against the previous commit: jsx 1.005x, tsrx 1.000x. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): give a hydrated body its own range when it is hidden (#2028) A body that hydrated borrows its boundary's range. Commit 4 bounded it with a comment of its own end when a fallback first showed beside it, which a catch arm that later replaced the body left behind. Instead, the commit that hides the body gives it a pair of its own around its content (ownTryBodyRange), queued ahead of the hide, so the body has the shape a client mount's has from then on and its own teardown removes the pair. The pair goes before the fallback's arm when that arm landed first. A dropped render queues nothing. hideBlockHostRange and insertArmPair lose the extra parameters the separator needed. The timeout test now waits for its fallback rather than a fixed delay, and a new test checks that a catch arm replacing a hydrated body after a fallback leaves none of what the boundary showed connected (it failed on the stray comment before). Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(evals): bridge the template cell and commit helpers to graded submissions The user-app grader resolves `octane/internal/client` to a bounded bridge (tests/_client-runtime.ts). Since dc409debd6 the client compiler routes a template's per-render cells and commit functions there (bagRecord, bagRecordEvent, bagDone, bagHole, commitHole, setRenderText, setEventSlot, commitHostSources and the rest), and the bridge did not re-export them, so every graded submission failed with "bagRecord is not a function". The import-boundary suite's counter grade fails without this, and the eval corpus' Strong repair ledger rejected its valid alternatives for the same reason. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): pin listeners fired by a commit's DOM patch A host whose props resolve across sources writes them at commit since 9d80f4d61d, so the spread that disables a focused input, and the attribute whose stringification probes a later write, now run in the render's commit, not its render. The listeners still run and publish their writes, and the commit goes on after them, outside any render, where authored code may write signals as React lets commit-phase code set state. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): compare stream boundaries without their ids, and fake a held timeout - The production root catch check compares the dev and production bodies with each stream boundary id normalized: the id carries a per-response token and a per-process counter. - The held-transition timeout test drives the timeout with fake timers. Whether a real 0 ms timer fires inside act depended on the runtime build's task ordering, so it failed under octane-prod. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): render a mapped host row's new component off-document (#2043) 533c04a6d2 left a promoted self-marked item's `it` pair pending until its commit, but an exotic map's row that turns from a host descriptor into a component rendered that component before the pending end, which is not in the document: NotFoundError (auto-memo's custom-map host row tests). Over committed DOM, mappedDeoptItemBody now renders the component in a frontier fragment between a fresh pair it inherits. The frontier's commit removes the host node, inserts the pair and its content where the node stood, after the list has moved it, and swaps the item's markers for the pair through its bound. promoteSelfMarkedItem defers only over committed DOM; a pair in fresh DOM lands at render. A structure-commit test moves a mapped host row while it becomes a component, with a probe after the list: nothing touched the DOM before commit, the host leaves, and the row moves and unmounts whole. It fails with NotFoundError on the previous code and with render-time mutations when the pair lands at render. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): point three React Fizz parity cases at their React-model tests 93bcf89132 renamed the streaming tests that evidence three Fizz cases when it adopted React's model for server rendering errors, which left their ledger entries naming tests that no longer exist (react-parity:validate). The entries now name the renamed tests, and their rationales describe the client render that replaced the server catch arm. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): one componentSlot call for a mapped item's component (#2043) itemComponentFrontier only prepares the frontier, its pair and the bound; mappedDeoptItemBody renders the component through its existing call and puts the item's node back as its range afterwards. −51 B raw on the app-shell framework bundle. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): test a released op target's bag state without typeof (#2043) Only a bag has `$`; any other commit-op target compares undefined, which is false. −22 B raw on the app-shell framework bundle. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): return pooled cells inline in the commit loop (#2043) releaseBag was a call per commit op while the pool was short: the paired js-framework work counters rose by one call per op on tsrx select and up to nine on jsx (a large list's first committed rows refill the pool). The check now runs inline in runCommitOps, and an immediate commit (fresh, unqueued or hydrating renders) keeps its bag's array. transition-hooks arrays stay at their limits (cycle 1792, updater 1792, dispatch 704, click 704, urgent 1856). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): recover hydration at commit and delete its undo log (#2028) A hydrating render no longer writes the server DOM it adopts, so a dropped attempt has nothing to undo: - What a slot builds on the client over server DOM in a root's hydrating attempt goes through a frontier, as it does over committed DOM (usesFrontier): a hydration-created Block counts as live when its parent lies in the root's container. - A boundary the client renders instead of the server's arm queues the server content for deletion on its slot (discardServerArm), and its arm builds in the slot's frontier (insertArmPair takes the frontier a slot already has): `[$!` arms (takeNativeFreshArm), a pending streamed sentinel (claimStreamTemplate), a dehydrated boundary's client render (clientRenderDehydratedTry), and catch arms that replace an adopted body, which unmount without detaching. - A Text for an empty server text lands at commit (placeHydratedText). An only-child binding finds a pending one through PENDING_HOST_TEXTS. - A `<Hydrate>` island's fallback always builds off-document in a root render and its tail discard is an op; a root's fallback builds in its mount's frontier, whose commit removes the server nodes first. A document or `<html>` container still renders in place, since its head entries need the client's `<head>`. - A claimed head element takes the client's props at commit, and a de-opt element hydration has to build (a `<noscript>`'s children) builds with hydration suspended. - An arm attempt that is discarded, and an island attempt that is retried, drop the ops they queued (dropRootOps). A hidden Activity mounted after hydration is hidden at commit. Deleted: HydrationCapability.save/settle/rollback, speculative, undoable, saved, undo, keepChanges, saveDeoptChildren, the hydration journalRootChildren and journalText calls, and fresh tracking (freshNodes, markFresh, isFresh, inFreshRange, rebuilds, suspendFreshLiteComponent and the fresh-anchor branches): what the client builds is off-document or renders with hydration suspended. A try body that throws to its catch arm drops the texts it left to compare, since the catch arm's commit discards them. renderUpdate stays for commit 10a, which removes the hydrating updates that use it. Render-phase text that a hydrating render rewrites still writes at once. The new MutationObserver test hydrates a root and a Suspense arm whose attempts suspend: neither changes the server DOM (it saw 11 records before). The misaligned empty-text test now adopts, as React does, where it used to fall back. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): land a one-host branch arm's root at commit, without a fragment (#2043) client-hot-paths branches toggle ran 1.16x main: each `@if`/`@switch` arm swapped in over committed DOM rendered into a frontier fragment, before a sentinel it appended and removed, and its commit moved the fragment in and rehomed its Blocks: two DOM moves and a sentinel per arm. The compiler now marks arms whose only output is one template host (controlFlowArmIsSingleRoot, the direct-host row proof): ifBlock's mask gains bits 4 and 8, and switchBlock takes a root mask in its lite mask's layout. swapBranchFrontier renders such an arm into a markerless slot detached, exactly as a committed list's fresh row does (DETACHED_ROOT): commitBag self-marks the arm with its root, the slot's pending structure carries that root, and applyNext inserts it alone and then moves a sole-root ancestor's bound. A later swap of the same render drops an earlier arm's unlanded root. Paired branches browser runner against main: toggle 1.16x -> 0.95x, stable 0.85x. Tests: a swapped-in arm's probe sees no DOM change before commit, and its root lands before the slot's anchor; one drain that flips an arm and flips it back leaves no stray root (fails when the later swap keeps it). hookless-arms reads the lite bit out of the wider mask. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): reuse applied slot records; a commit ends its own host retirement (#2043) js-framework tsrx remove ran 1.068x main. Each committed slot change allocated a pending record with two arrays (listNext's members list was eager), and each commit that deleted a host queued a microtask to end that task's retirement epoch. - applySlotNext returns an applied record to SPARE_NEXTS (reset, its fragment released); slotNext and listNext take one (newSlotNext). A list's members list starts with its first run (listRun, @empty's run). - retireEventHostTree queues its end-of-task reset only outside a commit; runCommitOps resets the epoch as the outermost commit ends, by which time everything it retired has left the document. - vtPreview counts a detached arm root (SlotNext.root) as an arrival. Paired remove, minified tsrx: 0.959x the previous commit, 1.02-1.05x main. retired-event-hosts fails if a commit's retirement sets no epoch; the pooled record's root reset is covered by the branch suites, which fail when it leaks. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): reuse a list's landed run fragments (#2043) Every fresh run of rows in a committed list (and a committed list's @empty run) created a DocumentFragment, about 0.2 us of a single-row insert in the uibench tree profiles. applySlotNext now returns a list's landed, empty runs to SPARE_FRONTIERS with the record, and listRun and the @empty run take one from there, as openFrontier already does. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): retire signal nodes without rebuilding their states Owner disposal regressed against main (#2043): retiring a node went through the value-only state and lastState accessors, and could build a value-only node's ready state only to replace it, once in notifyNode and again in retireGraph. In unoptimized and baseline code those accessor calls dominated the per-node difference. retireState now settles the waiter, writes the stored state directly and releases retention, for both the retiring owner's nodes and the dependents it notifies. Each retirement also builds its error state once and shares it, instead of allocating two state objects per node; states are immutable and compared by value, and every node still presents the same ScopeDisposedError. Revocation of retained foreign values uses the same state. scoped-signals --sizes=100,1000, 12 alternated runs normalized by in-process Alien, against main 5594cb06ea: dispose geomean 0.85x (head 1.05x), the continuous cycle 1.00x (head 1.01-1.03x). The regression test pins that a dependent notified of a retirement stops retaining a foreign value, so that owner's later disposal is not a change. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): clear a retiring signal owner's observer set once retireGraph stopped every observer while iterating the owner's set, and each stop deleted that observer from the same set, so the set rehashed repeatedly as it emptied under a live iterator. The retiring owner now stops each observer without that delete and clears the set once. An observer only ever sits in its node's owner's set, and views and pending shadows share their cell's owner, so the result is the same empty set. scoped-signals --sizes=100,1000, 15 alternated runs normalized by in-process Alien, against main 5594cb06ea, with the previous commit: dispose geomean 0.79x (head 1.03x), the continuous ownership cycle 0.95x (head 1.01x), and write_sparse 0.90x / batch_write_all 0.86x keep their gains. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): compare commit bindings inline and queue a template's commit as it stages (#2043) A changed js-framework row made about 10 more calls than main: every value binding called its recorder, a handler bundle called four, and a changed bag paid stageBag, bagDone and a commitEventBundle per bundle on top of `C`. A value binding now compares with its committed slot in the template and calls bagRecord only for a change, or when an earlier render of the transaction staged the bag (`_r`), whose cells this render must rewrite. A handler bundle records through one fused call, which still runs every render so signal ownership refreshes its authority. The two hot recorders stage an idle bag inline and queue `C` there, from the commit function the bag factory now receives, so the trailing bagDone only runs for a render that commits at once. `C` writes handler slots and bundles in place unless the runtime passes `careful` (an open journal, or a dispatch in flight that holds handler snapshots). Calls per op against main 5594cb06ea: jsx update 9,655 -> 8,623 (was 19,665), select 9,159 -> 8,125, swap/remove about -1,030; tsrx update 3,477 -> 3,285 (was 4,485). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): record handler bundles through bagRecord (#2043) The bundle recorder carried its own copy of the inline stage. A bundle now passes itself to bagRecord as its committed value and host, so the hot stage exists once: about 150 B gzip less runtime on the js-framework apps. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): a bulk list clear retires its rows' signal authority (#2043) A bulk clear (the owned-parent queue and clearItems) treated a row with no hooks, effects, cleanups, children, slots or refs as inert and only marked it disposed. A row whose handlers escaped its scope token, or whose block owns a signal owner, then kept that authority: a queued bubble handler on a cleared row read signal state as live instead of retired. Both checks now also require no signal owner and no escaped token, so such a row unmounts and runScopeCleanups retires its authority. Tests: a 20-row list whose row handler clears it, in a parent the list owns and one it shares; the row's queued bubble handler must see ScopeDisposedError (both failed before). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): retire only Blocks that can have queued work (#2043) A commit's retired set exists for drainQueue, which skips queued work at or below a Block a render deleted, and for a held ViewTransition's preview. Every deleted row joined it, so a 10k-row clear made 10k Set inserts. retiresVisibly admits a Block with pending work, an update error, hooks, effects, cleanups, children, slots or signal authority, and every Block while the ViewTransition driver is installed (a truthiness read, so applications without the driver fold it away). retireRootBlock and both bulk-clear loops skip the rest. Test: one drain whose root render deletes a stateful row while that row's own update is queued renders the row no more; it fails when nothing retires (the retired set had no such coverage before). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): stage commit bags only in bagRecord (#2043) bagRecord now holds the only stage: it resumes a bag staged earlier in the transaction, or allocates or clears its cells and, in a render that may be dropped, queues `C`. Controlled form properties and host sources record through it with the bag as their committed value, which no value equals, so they record every render; signal bindings and holes stage through it too. stageBag, bagRecordAlways and their second copy of the queue go away. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): retire a bulk clear's rows in one loop, without a call per row (#2043) The retired-set filter called retiresVisibly once per row, so the paired js-framework clear counted 10,000 more calls (tsrx 91 -> 10,100). retireBlocks now holds the filter and the pending journal once: retireRootBlock passes one Block, and both bulk-clear paths pass their first row. Oxc js-framework tsrx: 31,567 -> 31,542 gz. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): type the commit-error fixture's coerced title (#2043) Co-Authored-By: Claude Opus 5.5 <[email protected]> * Revert "perf(octane): reuse a list's landed run fragments (#2043)" This reverts commit f7bb793430. Reusing run fragments showed no measurable timing change (uibench tree insertFirst 1.006x) and cost +24 gz on the shell_ full framework and +40 on base. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): seed first-stage cell arrays instead of recycling them (#2043) The cell pool recycled committed bags' arrays through a check in every commit op, which cost +11 gz on the shell_ full framework and +55 on base (stageBag itself is absent there, so the recycling check was the cost). Eight preallocated arrays now serve the first bags a page stages, and every bag keeps the array it stages into, as before the pool. shell_: full 108,059 -> 107,993, base 55,692 -> 55,651. transition-hooks arrays stay at their limits (cycle 1792, updater 1792, dispatch 704, click 704, urgent 1856). Past the eighth first stage a bag allocates its array, as it did before the pool. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): allocate slot records again; keep one record factory (#2043) Reusing applied slot records cost +96 gz on the shell_ full framework and +91 on base, and dropping it leaves paired tsrx remove at 1.016x [0.963, 1.065] and swap at 0.996x. newSlotNext now only builds the record (slotNext and listNext share it), and applySlotNext applies it. The commit-scoped retirement reset, the lazy members list and the detached-root arrival in vtPreview stay. shell_: full 107,993 -> 107,897, base 55,651 -> 55,560. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): skip an unchanged handler's record (#2043) A native handler and a compiled handler bundle recorded through bagRecord every render, so each re-rendered row paid a call per handler even when nothing changed. The template now compares the handler itself (SameValue for bundle captures) and calls bagRecord only for a change or a resumed bag. A changed bundle passes its callback against the bag, so bagRecord learns the change without repeating the comparison. Signal authority still refreshes every render where it can move: once anything can give a handler an owner (an owner frame or environment, the signal document, module signal bindings), the template calls setEventHandler(host), which publishes only an authority that moved. That condition is a monotonic cell, signalOwnerUse, an object rather than a live binding so harnesses that destructure compiled imports still read it live. bagRecord no longer names setEventHandler, so a template without handlers does not retain the event authority code. tsrx update: 3,285 -> 3,185 calls (main 3,477). Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): commit at bagDone only a render that cannot be dropped (#2043) bagRecord already queues `C` at a render's first record whenever the render may be dropped; it now does so for a resumed bag no window queued yet too, and a hole resumes through it. bagDone is left with the renders that commit at once, which drops its copy of the queue. Co-Authored-By: Claude Opus 5.5 <[email protected]> * perf(octane): trim per-node calls on the mount path (#2043) Each mounted js-framework row made several helper calls that only read a value: htext and htextSwap coerced strings, setClassName normalized a string class, htext/child/sibling went through getFirstChild/getNextSibling, createdInRootRender called isCreatedInRootRender, renderBlockInner called blockIsAncestor for a direct child, and the context epoch was read through contextEpochNow. Each now reads in place. An event bundle factory installs its bundle directly unless setEventHandler has work: a slo…
…ts item range (octanejs#2028) (octanejs#2081) serverDescNeedsBlocks did not count a portal as needing a block, while the client's descNeedsBlocks does. A host item whose child is a portal was then serialized through the plain descriptor path, which rejects a portal, instead of the block path whose range hydration expects. A portal now needs a block on the server as on the client. Co-authored-by: Claude Opus 5.5 <[email protected]>
…module functions (octanejs#2028) (octanejs#2082) * perf(octane): move the hydration-only HydrationCapability methods to module functions (octanejs#2028) A method's name ships in every bundle that keeps it, since no minifier mangles property names; a module function's is mangled. Every method that no client-only code calls becomes a function of the capability, `name(h, …)`, declared after the class: 21 of the 75. Client-only code is measured, not assumed: an esbuild bundle of every runtime export but Hydrate and the hydrateRoot entry points keeps no HydrationCapability, and the TypeScript references of each method, resolved through its type, place every caller of these 21 outside that bundle. The other 54, called from childSlot, componentSlotLite, the branch, list and try blocks, the host writers or useThenable, stay methods: esbuild never folds `hydrating`, so a function named there would ship in client-only bundles, where a method leaves with its class. holds and awaitsCommit stay too, called through HYDRATION_PASS?.; parseSeeds was parseSeedJson, which its callers now call, and the diagnostic holds take no capability. failure becomes hydrationFailure, as a local of that name shadows it at a caller. The fields the functions read lose `private`. The hydration-free gate lists the 21 functions with the class, so a createRoot bundle that maps into any of them fails it. shell_ full and base_hydrate shrink 634 B raw (84 to 102 B gzip), and hydrateRoot bundles 634 to 803 B raw (107 to 239 B gzip). Every Vite and esbuild createRoot row is byte-identical in raw size. Cold hydration pairs flat against the previous step. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): classify adoptText's write under its function name in the render-write ledger (octanejs#2028) adoptText moved from a HydrationCapability method to a module function, so the writer ledger's 'HydrationCapability.adoptText' entry no longer matched it and check-render-writes reported its nodeValue write as unclassified. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* fix(octane): remove a .tsx Provider's children when they become null (octanejs#2076) * fix(octane): remove a .tsx Provider's children when they become null * fix(octane): remove CompiledContext children when they become null * fix(octane): keep CompiledContext's emptied dialect so a rolled-back transition can't duplicate its children * test(website): reload the dev /devtools warm-up once before failing Main a9dfdf7 failed the website integration suite: the dev-SSR beforeAll waited 120 s for the TanStack Devtools trigger on /devtools and skipped all 37 dev-SSR tests. The wait came with octanejs#2062 and has failed on main and two branches since, while passing locally on every cold warm-up (~3.9 s). The devtools client mounts after hydration from modules a cold dev server may only discover on that first visit, and Vite recovers with a reload a slow runner can miss. Wait 60 s, log what the first attempt saw, reload once, and fail with the page errors if the trigger still never appears. The devtools tests themselves still assert the trigger and panel on fresh loads. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(three): render Canvas as a Strong template (octanejs#2080) * fix(octane): seed nothing for a pending snapshot read instead of throwing (octanejs#2077) A server module that reads module signals installs the native read collector as it loads, and every later render in the process then collects its reads for the hydration snapshot. A render that read a pending query through snapshot(), such as an automatically streamed query, completed with a read it could not seed and threw "A completed native server read has no serializable ready value". On main 0bb503f, 28 of the 30 early-independent-intent cases throw once that collector exists, while the same page renders in a server that has loaded no such module. A snapshot renders a pending or failed state as it is, without suspending. The client resolves that state itself, or takes a stream's later delivery, so the read now contributes no seed, which is also no invented ready one. A completed value read of an unready source still throws. The signals-hydration case that pinned the throw now asserts that contract: the pending output renders with no hydration snapshot, adopts the same node, and shows the result once the query resolves. The supplemental native DOM smoke case says the same. The new streamed test loads a module-signal page, renders a pending snapshot under streamed signals, hydrates while the client is still pending, and takes the stream's result without a second fetch. Co-authored-by: Claude Opus 5.5 <[email protected]> * fix(octane): render a server element entry as its component's root, as hydrateRoot does (octanejs#2078) * fix(octane): render a server element entry as its component's root, as hydrateRoot does renderToString(<App />), and every other server renderer given an element, rendered the element as a value its root returns (renderEntryValue), which frames the component in a range of its own. hydrateRoot(container, <App />) unwraps an element whose type is a component into the root's body and props, as it does App itself, so the client root has no such range. When App returns a component, a fragment, a Suspense boundary or a template, or renders its children, the server's HTML did not match, and the root rendered on the client with a recoverable error. Each server renderer now reads its entry through renderEntry: a component element renders as that component's root, with the props its descriptor renders it with (descriptorProps, shared with ssrComponentDescriptor), and any other value as before. The two entry forms produce the same HTML, and either hydrates through either hydrateRoot form. root-entry-forms pins every pairing of renderToString and renderToReadableStream, each given App or <App />, with hydrateRoot given App or <App />, for a root that returns host JSX, a template, a component, a fragment, text, null, a Suspense boundary or its children, in dev and prod compiles: 80 of its 256 cases fail before this change. Client bundles are unchanged; the minified server runtime shrinks 234 B raw. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): read a server descriptor's children only after the scoped check A scoped component descriptor's children getter resolves deferred children, so reading it first ran them in the parent's scope before the component entered. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> * test(website): let the generated MDX hot-update test re-write and outwait a slow runner Main 8318702 failed the website integration suite: "hot-updates generated MDX twice while preserving the surrounding interactive page" timed out waiting 20 s for an edit to reach the page. It also failed on perf/runtime-size-redesign; it passes locally every time. Until 1622fa0 the /devtools warm-up flake skipped the whole dev-SSR block, which hid it. Each edit now waits in 15 s rounds, re-writing the file between rounds in case the watcher dropped a write that followed the previous one, for up to 60 s; the test's budget grows to 180 s. The assertions are unchanged: the generated text updates, the sibling counter keeps its state, and no errors. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): keep an emptied Provider's dialect, and refill it through a frontier (octanejs#2043) Clearing an emptied CompiledContext at commit dropped its hooks map, so the empty dialect was lost; it is now kept. A refill's reset opens the scope's frontier like a dialect flip, so its incoming body builds off-document. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Olzhas Alexandrov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: domgan-oai <[email protected]>
* tooling: add a runtime.ts split tool and its module map scripts/split-runtime.mjs splits packages/octane/src/runtime.ts into concept modules under runtime/ from scripts/split-runtime.map.json, leaving runtime.ts as a facade with the same exports. It works from the TypeScript AST, moves each top-level statement with its comments unchanged, and adds only exports, imports, and the evaluation-order imports. `check` validates the map before anything is written: every declaration mapped and none stale, a `let` lives with every function that assigns it, drivers and Rolldown-uninlined constants stay above the reads oxc folds or inlines, module-scope initializers read only their own module, and load-time pure calls stay in the callee's module. `--suggest` places new declarations with the code beside them. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: read the client runtime from runtime.ts and its concept modules Once runtime.ts re-exports concept modules under runtime/, every tool that reads the runtime's source reads all of them: the render-writer check, the perf-review scan, error-code generation, the hydration-free gates and size runners, the redact-audit ledger, and the tests that bundle or scan the runtime. Each works on both layouts. Harnesses that patch runtime text and load it in place of runtime.ts read benchmarks/lib/client-runtime.mjs's joined runtime instead: every module's statements in evaluation order with runtime.ts's own exports, from the working tree or a git revision. The effect-postorder harnesses take their helpers by name rather than by slicing between declarations. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: point agent rules and contributor docs at the runtime's concept modules Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): install the effect, form-pending and root-error drivers through installers enqueueEffect, runTransition and the three root factories assigned their drivers inline, which made each of them a writer of state that lives with the scheduler. Each now calls an installer declared beside the drivers, on the same once-per-install path: the first effect slot, the first submit transition, and root creation. No call is added to a render, node, or update path, and the drivers keep their truthiness and noop tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): request a hydrating root's flush through requestFlush A root's hydration attempt set the scheduler's flag inline, which made the 381-line hydrateRootWithOutputHandler a writer of scheduler state. It now calls requestFlush, declared beside the flag. The attempt runs once per root hydration and once per suspended retry of it, never per render or update; the per-update schedulers keep setting the flag inline. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): take root ids, requeue deferred passive effects and begin hydrating renders through helpers Four boundary and root paths incremented nextClientRootId inline, two deferred hydration notifications copied the same passive requeue, and a root's hydration attempt set ROOT_DISCARD_STAMP after beginning its render. Each now calls a helper declared beside the state it writes: takeClientRootId, requeuePassiveEffect and beginHydratingRootRender. Every one of these paths runs once per root, boundary arm, recovered Hydrate, or root hydration attempt, never per render, node or update. The per-render writes of the same state stay inline. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: search the runtime module order gzip compresses best `node scripts/split-runtime.mjs order` writes the split in place, builds the shell_ app's framework chunk, the full-surface ceiling and every Rolldown scenario of run-minimal.mjs with source maps, then restores runtime.ts. It cuts each chunk into the runs each module emitted and anneals over the module orders the map's constraints permit, scoring each by re-sequencing those runs and gzipping. Every permitted order keeps the same code, so only compression moves. The best of four seeded runs is written into the map's module order. run-minimal.mjs writes each Rolldown scenario's chunk and source map to BUNDLE_SIZE_MAP_DIR when it is set. The tool now formats the map it writes. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: remap the runtime for the installer and helper commits With the cold driver installs and scheduler-state writes behind helpers, the module that must hold mutually assigned state shrinks from 8,237 to 5,179 declared lines. The render pass's state and its writers get their own render module, hydrateRootWithOutputHandler moves to roots, and the module order is the one `order` found: shell_ framework gzip 107,446 -> 106,770, full surface 164,403 -> 162,892 and run-minimal Rolldown scenarios 896,232 -> 892,353 against the mean-position order. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: link the runtime's evaluation chain through empty re-exports The plain-module printer parses to ESTree, where `import {} from` and a bare import are the same node, so it reprinted every order link as a bare import and its fidelity test failed for the split runtime. An empty re-export prints back unchanged, draws no esbuild warning or unused-import error, and keeps the module order in Rolldown and esbuild. The joined runtime follows these links. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: map the runtime at next `check --suggest` placed next's new declarations: the module functions that replaced HydrationCapability's methods go to hydration, the CompiledContext and Provider children helpers to context, the commit-time marker and writer helpers with the concept that calls them. claimedHeadMarker moves to head, beside the claims it reads, which breaks a head/roots order cycle. The module order is the one `order` found. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): split runtime.ts into concept modules Generated, not edited: `node scripts/split-runtime.mjs split` on runtime.ts at the previous commit with scripts/split-runtime.map.json. runtime.ts keeps its exports and re-exports 36 modules under runtime/; every statement moved unchanged with its comments. Regenerate this commit rather than editing it: drop it, rebase the commits before it, run `check --suggest`, `order`, then `split`. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…dge (octanejs#2083) * perf(octane): retain single-scope signal reads without a grouping map * perf(octane): retain only direct signal owner validation after review
…nejs#2091) * tooling: check the split runtime's rules and make the migration commands migration-only Once runtime.ts is split, the concept modules are the source of truth. On that layout `split-runtime.mjs check` now reads the modules themselves and enforces what matters going forward: module-scope initializers read only their own module's bindings, every order constraint (a driver or uninlined constant above the reads that fold or inline it) holds along the chain the modules' order links form, and every module with code stays on that chain. A test runs it on the committed modules in ci:workflow:test, and another shows it failing on a cross-module initializer read and a removed link. The map, `split`, `order` and `--suggest` are migration-only and refuse to run on the split layout; the tool header, the map comment, the facade text and CONTRIBUTING.md say so. The root factories move from the map into the tool, and the joined runtime reports each module's range and the chain. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(octane): regenerate the runtime facade's comment Generated, not edited: `node scripts/split-runtime.mjs split` on the single-file runtime.ts of the split's parent with the updated map. Only the facade comment changes: the concept modules are the source to edit, and `check` enforces their rules. Co-Authored-By: Claude Opus 5.5 <[email protected]> * tooling: check every fold and inline read against the split's evaluation order checkSplit fed the joined modules to orderConstraints, which keeps only the pairs whose binding already precedes its reader in the text, so a driver or uninlined constant moved below its reader dropped out and was never reported. The split check now collects every fold- or inline-dependent read, wherever it sits, and compares the binding's and reader's evaluation order, across modules and within one. The 24 reads that already came before their binding in the single-file runtime never folded and are listed in ORDER_BASELINE; an entry that comes back into order is reported so the list only shrinks. The new test relocates a driver below its folding reader and fails on the previous check. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…t commit (octanejs#2093) A committed list's new direct-host row keeps its one root detached until commit, which inserts it alone. A row whose body is a sole component still rendered into a run fragment, which its commit moved and whose members it rehomed, so inserting such a row cost more than on main. The compiler now flags a sole-component row whose component's own template inserts the root (bit 7; a keyed selection's index moves to bits 8+), and mountItem keeps that row's root detached too. commitBag self-marks the component's Block and the row with the root, and leaves a lite stand-in, which has no range of its own, with no end. Co-authored-by: Claude Opus 5.5 <[email protected]>
|
This PR is too large for Bugbot to review. It changes 86,043 lines and 4,009,575 characters. Split the change into smaller pull requests to get a review. |
domgan-oai
left a comment
There was a problem hiding this comment.
Deep review of the current head found four actionable issues. The runtime findings were reproduced with paired SSR/hydration cases; the tooling finding is a demonstrated false negative in the new safety gate.
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (8 without a verdict)
Work counters (an increase fails this check):
37 other measured values are unchanged. Application bundle size (bytes)
2 other measured values are unchanged. Public-import reachability bundles (bytes)
21 other measured values are unchanged. Lynx dual-thread render (report only)All 13 timed operations (13 without a verdict)
|
…ry-next fix: preserve keyed list state across suspended updates
Port the behavior from octanejs#2117 to the split next runtime, including passive-effect release and partial-capture handling.
* feat(octane): support Trusted Types Re-lands #2162. 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 #2162 squash commit (424e5cc) cherry-picked onto `main` without changes. A TrustedHTML, TrustedScript, or TrustedScriptURL passed to dangerouslySetInnerHTML or an attribute now reaches its DOM sink as the object, as in React 19.3, so it works under an enforced require-trusted-types-for 'script' CSP. Markup Octane parses itself (compiled templates, binding fragments, streamed regions) goes through a module-private `octane` policy, created at module load with the native `String` as its rule, and the streaming bootstrap's JSON carrier through `octane-stream`. Application strings never go through either. Refs #2053. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): type the Trusted Types browser fixture main's test config rejects reading a server fixture's export through its index signature, so name the fixture module type, as other tests do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): write changed script text through its Trusted Types sink setScriptText updated an existing Text node in place, so after the first write a TrustedScript never reached the script's textContent sink, and under enforcement a string update was not rejected. An unchanged body still writes nothing; a changed one now always assigns textContent. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#2157 merged into `next` as 32dc7f1 after `next` had already landed on main (#2103), so its compiled-output saving never shipped. Cherry-picked onto main; the one conflict kept main's bagOf rehome argument in the spill path. Co-authored-by: Claude Opus 5.5 <[email protected]>
…aries and deferred activation (#2224) * feat(octane): support Trusted Types Re-lands #2162. 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 #2162 squash commit (424e5cc) cherry-picked onto `main` without changes. A TrustedHTML, TrustedScript, or TrustedScriptURL passed to dangerouslySetInnerHTML or an attribute now reaches its DOM sink as the object, as in React 19.3, so it works under an enforced require-trusted-types-for 'script' CSP. Markup Octane parses itself (compiled templates, binding fragments, streamed regions) goes through a module-private `octane` policy, created at module load with the native `String` as its rule, and the streaming bootstrap's JSON carrier through `octane-stream`. Application strings never go through either. Refs #2053. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): type the Trusted Types browser fixture main's test config rejects reading a server fixture's export through its index signature, so name the fixture module type, as other tests do. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(octane): write changed script text through its Trusted Types sink setScriptText updated an existing Text node in place, so after the first write a TrustedScript never reached the script's textContent sink, and under enforcement a string update was not rejected. An unchanged body still writes nothing; a changed one now always assigns textContent. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(octane): cover Trusted Types hydration, streamed table/SVG boundaries and deferred activation Run the enforced `require-trusted-types-for 'script'` browser suite, which has no default policy, over the cases the streaming design doc lists: hydrateRoot of renderToString output, a streamed page whose <tbody> and <svg> boundaries reveal after the shell hydrates, and a deferred <Hydrate> boundary that a click activates. Each page then mounts fresh table and SVG content and rewrites its adopted dangerouslySetInnerHTML. A report-only run checks that the same pages raise no violations. Each case passes in dev and prod bundles and fails when the template, stream-bootstrap, setHTML or dev hydration-compare sink writes a string. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* fix(runtime): scope optimistic cleanup to transition batches * fix(runtime): keep optimistic reverts out of cross-render diagnosis 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]> * feat(octane): commit unrelated transitions independently 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]> * fix(octane): give boundaries without a batch hold their own reveal group 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]> * fix(octane): render a deferred value's final attempt while a root holds 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]> * test(octane): reveal a parked hydration boundary while an unrelated transition 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]> --------- Co-authored-by: dannyward630 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…y change (#2248) Issue #1351 reported two symptoms of a root render that changes an Activity's visibility and then suspends with no boundary: the hidden panel was revealed before commit, and an update accepted inside a still-visible Activity ran no effects until the held render was cancelled. The runtime redesign (#2103) fixed both; its dropped-render test covers the first. Cover the second in both directions and at both priorities: while the visibility change is held, an update inside a visible Activity runs its layout and passive effects, and one inside a hidden Activity keeps them disconnected. Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Integrate
nextintomain. The branch separates render work from commit work, splits the client runtime into concept modules, and updates hydration, signal ownership, streamed rendering, list commits, and runtime tooling.Merge
maininto the fork'snextbranch while retaining the split runtime and the main-branch fixes for Strong keyed configuration, script ownership, permanent-static hydration, provider cleanup, and server root entries. Keep custom mapped-result framing local to its SSR slot, isolate nested root range state, honor a root's explicit hydration protocol, and stage keyed host replacement until commit. The render-write check now requires a real guard controlling the write and distinguishes audited sites from unresolved debt. Ref visibility bookkeeping shares its common publication and detach logic.Validation
pnpm format:checkpnpm typecheckpnpm testpnpm sync, split-runtime integrity, scoped formatting, and diff checks passed. Independent complexity review found no remaining actionable simplification.069f6db89; the benchmark found no increased js-framework work counters.Risk / follow-ups
Full local workspace validation was blocked by registry 403 responses; local checks used filtered dependencies and focused configurations. The render-write gate still lists six legacy writer-wide debts and one exact-site unresolved same-tag transfer fallback; passing the gate does not prove the entire runtime is free of render-time DOM writes.
The current-head benchmark compared the generated PR merge with its
mainfirst parent on the same runner. Complete gzip bundles grew for Threadline Oxc +1,693 bytes (+3.5%), Threadline esbuild +1,530 (+2.6%), bindings +2,043 (+0.9%), and weather +707 (+1.6%); Wayfinder shrank 4,491 bytes (−3.0%). No js-framework work counter increased; ten timed operations were faster and ten had no verdict. Exact-build Threadline source maps attributed +8,666 raw bytes to generated application code while Octane runtime code fell 953 raw bytes; the authored app was unchanged. The new per-template commit writers and binding records account for the growth pattern. The retained ref simplification saved only 11 Oxc / 19 esbuild gzip bytes in matched complete Threadline builds. Local prototypes against this head did not meet the complete-bundle objective: staging once per bag grew Threadline gzip by 159 Oxc / 167 esbuild bytes, while sharing an update-local value temporary grew it by 17 / 40 bytes. The former reduced calls in two affected interactions; the latter preserved measured call and DOM-work counts. Field-name normalization exposed no additional reusable complete writers in Threadline (15 distinct shapes among 17 writers). Neither prototype was retained; substantial bundle growth remains unresolved. Byte changes are report-only in the benchmark workflow.Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need.