Repository navigation
feat: align ViewTransition with React and add element scopes - #1095
domgan-oai merged 22 commits into
Conversation
…ansition-parity # Conflicts: # packages/octane/src/runtime.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 7cd5428. Configure here.
trueadm
left a comment
There was a problem hiding this comment.
Full review of e36dec2b4 (base 277c10c3f). I read every hunk, ran the jsdom and Chromium ViewTransition suites locally, and verified each finding below against the head with a throwaway test or a traced code path. Local runs on the head: jsdom view-transition* + conformance + hydration 316/316, browser parity/scopes/streaming 68/68, pnpm sync clean, Prettier clean.
The parity work itself is thorough, and the new browser suites are a real asset. The problems are concentrated in the two new mechanisms, the staged DOM plan and element scopes, where the eager-commit invariants the rest of the runtime relies on stop holding. Seven confirmed correctness defects, two of them regressions from main.
Applied for you
I cannot push to openai-oss-forks (GitHub's maintainer-can-modify only covers user-owned forks), so the small fixes are on octanejs/octane branch fix/vt-review-fixes-1095, commit d38e8477d, based on this PR's head. Cherry-pick it onto the branch:
git fetch https://github.com/octanejs/octane fix/vt-review-fixes-1095 && git cherry-pick FETCH_HEAD
It contains, each with a regression test that fails on e36dec2b4 and passes after:
vtFlushsnapshots the batch before pre-render passives run (runtime.ts:6496-6501).queuedOwners/queuedBlocksare default parameters, so they are evaluated beforedrainPassivesBeforeRender(); a passive that callsstartTransition(() => set())pushes a block that the samework()renders but every planning loop skips. That scope's DOM changes inside another scope's transition with no capture, nostartViewTransitionon its owner and noonUpdate(regression: base captured all ofVT_REGISTRY). Fix: snapshot after the passive drain. Test:view-transition-scoped-effects.test.ts"captures a scope whose update a pre-render passive effect schedules".- Render errors inside an animated commit are demoted to
onRecoverableError/console.error(runtime.ts:6606-6609,6780,6940-6956,4696-4715). The drain error is caught intodrainError, only re-surfaces via the update callback's rejection, and the sync rethrow at6973needs every group settled, which never holds.await act(...)resolves,actErrorsnever sees it, a root withoutonUncaughtErrorgets a console line, and the guide's "actionable native failures" sentence is applied to render errors. Base rethrew (sync path) orqueueMicrotask(() => { throw }). Fix: the error is known before any native start, sointerrupt()(publishes the prepared work) and rethrow. Test:view-transition.test.ts"surfaces a render error thrown inside an animated transition to the caller". - SSR
vt-scope="none"survives hydration and excludes those hosts from every document capture (runtime.server.ts:4867,runtime.ts:3988,4017,4088-4091). The server stampsnoneon the hosts of an invalidscope="element"declaration;vtClosestScopetreats anyvt-scopeattribute as a scope;vtPrepareScopeBoundaryreturns before the only code that rewrites the attribute. After hydration an outer<ViewTransition onUpdate>around such a declaration never animates, while the identical client-rendered tree does. Fix: onlyvt-scope="element"is a scope on the client; the server marker stays for the streaming driver. Test:view-transition-ssr.test.ts"keeps hydrated hosts of an invalid element scope in the document capture". The inline driver'sowns()(runtime.server.ts:9185,if(node.hasAttribute("vt-scope"))return false;) has the same over-broad check for pre-hydration reveals of a document-owned outer boundary; I left it for you since it needs a streaming test. - Secondary hosts are named
name_1by the server butname-1by the client (runtime.server.ts:4811vsruntime.ts:4392,4506). Authored::view-transition-group(card-1)CSS matches a client update but not the streamed reveal of the same boundary. Fix:-, pinned in "annotates each host and reserves auto for generated names".
Plus, covered by the existing suites (3014 jsdom, 85 browser tests green on the branch): DOMStage reads native firstChild/lastChild/siblings when the parent has no staged entry, and native attributes when the element has no staged twin (items 8 and 9 below); the inline-style hooks check VIEW_TRANSITION_DRIVER !== null before the property-name compare (item 12); dead deferPassives hook and stale comment, unused vtRegisterHandle _capture parameter, unused DOMStage.discard(); resetStreamRuntimeGlobals also clears __octaneViewTransitionScopes (the SSR suite hand-rolls this superset today).
Blocking, needs your change
- Same-body
root.renderwhile a stage is pending discards the whole DOM plan (runtime.ts:39088-39100,7476,7550,7842-7846,39022-39030).startTransition(() => root.render(App, a))prepares the plan and callsstartViewTransition; before the async update callback, a secondstartTransition(() => root.render(App, a))(a router re-navigation, orstartTransition(async () => { await x; root.render(...) })) bumpsrenderOwner.generationwithout interrupting (TRANSITION_DEPTH > 0) and withoutrefreshPublishingOwner(requiresinFlush). Atstage.commit()everystagedOwnerGuardreceipt fails, so the prepared host writes, effects and refs are dropped while block state already reflects them: text stays old, an@ifswitch leaves the old branch in the DOM and never inserts the new one, and the follow-up render is a no-op. Reproduced with a jsdom test that fails on this head (expected 'old-tail' to be 'a-tail') and passes onmain; the different-body variant is fine.view-transition-staging.test.ts:221only covers the same-root refresh from inside the native callback. Either bumpgenerationonly on an identity change (the comment at39084-39086already says identity changes are what discard staged state) or extendrefreshPublishingOwnerto the not-yet-published capture on a same-body refresh. - Streamed
$OCTRXno-ops while its parent's reveal is queued (runtime.server.ts:9099-9103,9128-9130,9055-9059,9795-9811,10113-10119,10157). The driver queues every$OCTRCand parks a blocked item without runningprepare(), so a nested child's<template data-oct-b>is still JSON text;$OCTRXstays synchronous andif(t){...}finds nothing. Server side the child's error chunk (and the abort tail) needs only the parent influshedSegmentsand is written in the same wave. Reproduced: animated first boundary, wave 2 parent carrying a nested pending child,inner.reject()orcontroller.abort()→ child sentinel never getsdata-oct-err; a dormant<Hydrate>around the parent then waits forever (runtime.ts:13277,13294-13322). Pre-PR$OCTRCwas synchronous so "child template is in the DOM before its own$OCT*call" held (the comment at10096-10099still relies on it). Simplest driver-independent fix: make the base$OCTRXlazy (stash[id,so]when no template is found, re-apply at the end of$OCTRCafter the content is inserted). No test covers$OCTRX/abort after a queued reveal; the recipe above belongs inview-transition-ssr.test.ts. - Staged delegation attach is dropped on rollback while
_delegatedkeeps saying it is attached (runtime.ts:20891-20909,7493-7511;dom-stage.ts:139-153,657-660,881-889).delegateEventswrites_delegated.set(name, type)eagerly (never journaled) but the back-attachdomNode(target).addEventListener(...)on the root container (user-supplied, so never fresh) is enqueued with the journal-cancellable guard. A transition attempt that mounts the app's first<input value>(or the first spread/de-opton*of a type) and then suspends rolls back, the guard turns false, the listener is skipped at publish, and on resumedelegateEventshits_delegated.has(name) → continue, so that root never receives the type: controlled restore and every$$input-style handler for it are dead permanently. Reproduced in jsdom (0inputlisteners on the container after resume,onInputnever fires, controlled value stays drifted; the unstaged run attaches 2 and passes; attaching to the rawtargetfixes it). Notetests/_helpers.tspre-delegates the common types, which is why the existing suites cannot see this. Listeners are not visual mutations and the bookkeeping is already eager, so attach eagerly (target.addEventListenerat20909,20915,20943, and the same forregisterDelegationTarget), and add the test toview-transition-staging.test.ts. Same hazard one level up:stageDelegation(7864-7869) enqueuesregisterDelegationTargetthrough the same guard, so acreateRootinside a rolled-back staged render is never registered.
Performance model
Non-VT apps stay at a null check, which is good, and the bundle guard really asserts DOMStage/vtFlush exclusion. Note that vtWouldWrap (runtime.ts:4933-4938) wraps every all-transition flush once the driver exists, with or without a mounted boundary; that gate is unchanged from base, but the cost of a wrapped flush went from one callback to a full Proxy-staged drain, so an app that rendered one <ViewTransition> anywhere now stages every later startTransition commit. Inside an active transition the plan is quadratic in several places; none of the fixtures has a large list, so RESULTS.md cannot see it.
DOMStagesibling/child reads were O(n) per read (dom-stage.ts:189-210,366-373): everynextSibling/firstChildthrough a view copiedArray.from(parent.childNodes)andindexOf-scanned it, sovtRangeElements,unmountBlockInner, the hydration cursor and every keyed walk became O(n²) during preparation. Fixed on the branch (native read when the parent has no staged entry; every staged structural write records one).- Attribute reads cloned a twin per element (
dom-stage.ts:796-806,256-285):hasAttribute('vt-scope')runs on every boundary element and ancestor inside the staged window, and each call built an inert clone with all attributes copied. Fixed on the branch (native read when no twin exists). matches/closest/form/elementsclone the whole document per call (dom-stage.ts:288-334,414-416,861;runtime.ts:3167-3176,3199-3203,22752).projection(node, true)re-clones from the document root on every call and nothing caches it; a controlled radio write under a journaled transition doesform/elements/form !== formper cousin, so a 20-radio group on a 10k-node page clones ~420k nodes for onecheckedwrite.- Staged
insert/removecopy the whole child array per op (dom-stage.ts:651-659,683-687): appending or clearing N rows into an existing parent inside a transition is O(N²) plus N discarded arrays, andbatchClearItemsunder staging (runtime.ts:37488) forces the per-item path so the one-shottextContent = ''becomes NremoveChildcalls at publish. Mutate the cached array in place and test the trailing anchor beforeindexOf. - Inline-style hot path paid a string compare before the driver null check (
runtime.ts:19512,19556-19604,19646): every property write/removal in every app compared the name against'view-transition-scope'first. Fixed on the branch by reordering; this is also what turned the clear loop into a block and forced thestyle-literals-work.mjschange (the count guard cannot see the added per-iteration work, so that edit is fair but hides the cost). - Also worth a look:
created()walks every subtree with an array per node just to find<template>s (dom-stage.ts:99-113, usequerySelectorAll('template')for element/fragment roots);vtMeasureElementsreadsgetComputedStyleforclipon every boundary in the before pass but onlynextRects.clipis ever consumed (runtime.ts:4415-4443,6413); the whole-documentMutationObserverwithcharacterData+attributesallocates a record for every write outside any boundary (runtime.ts:4540-4560,4589-4633);vtScopeForBlock/vtClosestScopeare recomputed up to four times per boundary per flush with no per-flush memo (runtime.ts:3986-4028,4815,6548,6611,6631); an unnamedscope="element"boundary with arefforces twogetComputedStylereads per render (runtime.ts:13970-13976,4195-4218);vtSsrMapTagsslices and visits every nested tag for callers that only look at depth 0 (runtime.server.ts:4771,4807,4849-4866).
Design
- This reverses a documented decision without recording why. The base plan doc (
docs/view-transitions-plan.md:151-159at277c10c3f) said: do not fix toward React by inventing a staged-mutation reconciler mode, it trades the eager-mutation performance model for a timing nicety. The PR builds exactly that (an 894-line Proxy projection,domNode()at ~1,190 call sites in ~240 functions, three hand-curated key lists, a 20-methodDeferredLayoutDriverconsulted from ~36 general-purpose sites) and rewrites the plan doc so neither the old decision nor the reason it was overturned survives; the guide still points at "the implementation plan and its documented edge cases" that no longer exist (docs/view-transitions.md:199-202). Whatever the outcome, the trade-off needs to be written down in the plan doc: which requirement made the base divergence unacceptable (as far as I can tell only a boundary whose ownupdate/nameprop flips in the same animated commit needs post-render props, and no test pins that case). - The seam.
getFirstChild/getNextSiblingare the right shape (one indirection) and are then bypassed ~270 times by inlinedomNode(x).nextSibling. Nothing enforces "no live write during a stage": a futureel.setAttributewithoutdomNode()type-checks, passes every non-VT test, and corrupts the old snapshot only while a transition prepares. The existing operations layer (initDomOperations,runtime.ts:16097) is where a single swap for the staged window would replace the per-site wraps, and it would letdom-stage.tsdropPROJECTED_PROPERTIES,state()andprojection(). - Scope lease vs. one stylesheet rule.
scope="element"is a string-level lease on the host's inlineview-transition-scope(runtime.ts:4030-4037,4081-4082, eight hooks on the style setters, hydration special-casing at852-886and17024-17045, three SSR attributes). The host already carriesvt-scope="element"; one injected rule[vt-scope="element"]{view-transition-scope:all!important}through the existinginjectStylepath would remove the lease, the hooks and the harness change, and an author's inline!importantstill wins, which is the opt-outvtScopeName(3945-3949) already honours. - Invalid scope hosts are silent and degrade scheduling (
runtime.ts:3967-3971,4090,4806-4810,4825-4827). A two-hostscope="element"gets no DEV warning (the duplicate-name path warns once at6257), and becausevtScopeForBlockreturnsnull,vtQueuedOwnersreturnsnullfor any batch containing it, sovtActiveHandles(null)treats every session as affected and the batch waits for unrelated animating scopes.
Smaller items
startViewTransitionis always called with the options object and the sync throw is swallowed by a barecatch {}(runtime.ts:6894-6913); callback-only engines pay the whole staged drain on every transition flush and never animate, with nothing reported and no memoized "unsupported" flag. The docs declare the outcome, so the remaining defect is the silent swallow plus the repeated cost.set()records the detached twin's read-back for non-projected keys (dom-stage.ts:506-518), so a stagedscrollTop = 480reads back as0for the rest of the drain, against the file header's own rule. I could not find a reachable double read in one drain today (jsdom cannot show it either, itsscrollTopis a plain slot), so this is a hazard rather than a repro; exclude scroll geometry fromvalues.vtSsrClaimArm's localreadand thevtSsrInjectdedupe use naiveindexOf(' name="')(runtime.server.ts:4903-4909,4793) while the PR addsvtSsrAttributefor exactly this; an attribute value containingvt-exit="none"misroutes the arm.- Three different viewport tests with different edge semantics (
runtime.ts:4426-4431inclusive,4662-4668exclusive, driver9148exclusive) replaced the onevtInViewporthelper. - The
TRANSITION_JOURNAL !== null && !ROOT_RENDER_ROLLBACK && !TRANSITION_JOURNAL_REPLAYINGpredicate is copied six times (runtime.ts:7772,7792,7812,13044,13055,13288); the stream driver re-implements theMmarker check and the carrier unwrap thatstreamRuntimeJsalready defines (runtime.server.ts:9022vs9240,9033vs9215). EAGER_METADATA(dom-stage.ts:8-18) is a bare list with no comment saying why these eight$$expandos bypass staging, and nothing at the runtime.ts definition sites points here; the next expando is staged-until-commit by omission.wrapResumepasses precomputedowners/blocksfromgetBlocks(), so a passive that enqueues during a resumed flush has the same stale-snapshot shape as item 1.
Tests and docs
conformance/view-transition-{staging,lifecycle,matching}.test.ts(28its) cite no React case;testing.mdreservesconformance/for ports with a per-itsource citation, and "staging" names an Octane-only phase.- Nothing imports
dom-stage.ts; the staging suite does not cover a rolled-back stagedaddEventListeneron an existing node, a projected read after a non-projected write,classList/styleproxies,innerHTMLstaging, orquerySelector/closest/formmapping back to originals. - Twelve new components in
view-transition-matching.tsrxand two indeferred-hydration-contract.tsrxtake an untypedprops(tsrx-authoring.md), while the PR's other fixtures are typed.
Already answered by you on the Bugbot threads (streamed vt-update ancestor walk, auto relays, img.onload) and not re-raised here.
Review fixes for the ViewTransition parity and element-scope work, each with a regression test that fails on the PR head: - vtFlush snapshots the queued batch after pre-render passives run, so a scope whose update a passive schedules into the same commit is captured instead of changing inside another scope's transition. - A render error thrown inside an animated commit is rethrown to the caller (uncaught, or collected by act()) instead of being demoted to onRecoverableError/console.error through the native rejection. - Only vt-scope="element" is a scope on the client; the server's vt-scope="none" marker for an invalid declaration no longer removes hydrated hosts from the document capture. - Secondary SSR hosts take the client's `-N` name suffix. Also: DOMStage reads native siblings/children for parents without a staged entry and native attributes for elements without a staged twin (the previous fallbacks copied the child list or cloned the element per read); the inline-style scope hooks check the driver before comparing the property name; dead deferPassives/discard/_capture removed; the shared stream-globals reset clears the scoped handle map. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Pushed the review fixes in a04266a, including your supplied commit (cherry-picked with authorship preserved). Each inline thread now has its disposition and regression evidence. The delegation finding in the main review is also fixed: native listener attachment stays consistent with eager bookkeeping, newly created roots survive a rolled-back attempt, and existing portal listeners remain live until accepted deletion publishes. The staging suite exercises first-input suspension without the helper's predelegation, controlled restoration, an external root, and held portal deletion. Validation includes 18,214 passing local core tests, 81 native browser cases, and focused final follow-ups (334 SSR/stream cases, 15 native stream cases, 18 error/resume cases, strict types). The updated PR description distinguishes the broad run from later focused runs and the local differential dependency limitation. The refreshed performance record includes the measured remaining document-ready SSR cost (1.282→2.314 µs), the parser optimization, raw samples and noise, plus large-tree work counters. The plan preserves the earlier eager-rendering decision and why this request expanded it. Current-head CI and Bugbot are running; I’m following them through completion. |
trueadm
left a comment
There was a problem hiding this comment.
Re-review of 759330f34 against the 20 threads from review 5203270246. I re-ran my saved repros and the local suites on this head, and re-read every follow-up hunk (e36dec2b4..759330f34: runtime.ts, dom-stage.ts, runtime.server.ts, scripts, docs, tests).
Verified fixed, all 20 threads. The two saved repros for the open findings now pass (same-body root.render before the native callback: 5/5; staged delegation rollback without helper predelegation: 4/4). Locally on this head: jsdom ViewTransition, hydration, lists, portals, Suspense, controlled, transitions, events and styles 3,439/3,440 (the one failure, deferred-hydration.test.ts "shares eager module state", passes 3/3 in isolation and is a load flake unrelated to this diff); Chromium parity/scopes/streaming/host-state/activity/suspense-hydration 101/101; format, typecheck and pnpm sync clean. Receipt refresh, eager delegation with staged unregister only for pre-existing targets, resume-path passive ordering, boxed drain errors, callback-overload fallback memoized per native function, invalid-scope diagnostic gated on inInactiveSubtree, physical-owner scheduling fallback, the $OCTRX retention/replay, owns() on vt-scope="element", linked child records with lazy snapshots and complete projection invalidation, scroll readback, querySelectorAll template discovery, the staged-DOM checker (runs via ci:workflow:test in the lint job), typed fixture props, moved suites, ledger paths, and the evidence hashes all check out. Thread-level details are on the six threads I replied to.
One change requested before merge (details on the runtime.server.ts:4945 thread): vtSsrStrip became a full tag walk of the whole document, head and every stream chunk whenever any boundary rendered, replacing the reviewed head's single regex replace. On a 25 KB page with one tiny boundary that is 27.3 → 148.6 µs per render (about 5 µs per KB, roughly 1 ms for a 200 KB page); the committed 113-byte View fixture cannot see it, which is why RESULTS.md reports 1.28 → 2.31. Octane-emitted markup never carries vt-*-x=" inside an attribute value, so the regex strip was already correct for everything but raw dangerouslySetInnerHTML text. Restore the regex strip or confine the walk to the boundary's own segment, and add a large-page fixture to ssr.mjs so the record measures it.
Two small fixes to fold in with it: docs/view-transitions.md:117-119 still describes the removed inline view-transition-scope lease and contradicts lines 170-172; and vtInjectScopeStyle injects only into the global document with a runtime-wide dedupe, so a root in a foreign document (iframe roots are supported) gets the vt-scope marker but never the stylesheet (runtime.ts:4079 thread).
Optional, noted on the threads: the checker's owner() keys exemptions on bare function names; the plan's "request was explicitly expanded" sentence should cite the instruction or say it was the task's own re-scoping; a one-line hardening for DOMStage.insert()'s eager branch (pre-existing, not a regression); two raw-HTML-only stripper edge cases (a="1"vt-exit-x="b" adjacency, case-sensitive </SCRIPT> search) and up to five attribute scans per tag in vtSsrClaimArm; the whole-batch downgrade for a passive-introduced urgent update is coarser than docs/view-transitions.md:111 states; the $OCTRX retention code ships on every stream (+136 gzip) and abort-tail entries persist for the page lifetime, both bounded.
The fix/vt-review-fixes-1095 branch is superseded by your cherry-pick and can be deleted once this merges.
…ansition-parity # Conflicts: # benchmarks/baselines/ratios.json

Summary
Align ViewTransition with React 19.3 for activation classes, transition type maps, stable names and refs, pseudo-element APIs, geometry/mutation detection, and cleanup at native animation finish.
Prepare ViewTransition updates with an optional DOM plan, then publish the accepted mutations inside the native update callback. This fixes nested
update="none"captures while preserving node identity, committed handlers, deletion cleanup, and urgent interruption.Add opt-in
<ViewTransition scope="element">with independent sibling/nested animations, names local to each native owner, and scope-targeted pseudo-element handles.Animate streamed Suspense reveals and coordinate document/element captures across streaming, hydration, and client updates.
Remove per-node staging helper calls from ordinary rendering and run the existing js-framework work guards in PR CI.
Skip inactive driver calls during effect/scope cleanup and Activity/Suspense deactivation; guard post-transition cleanup work in Chromium CI.
Contract and implementation
Ordinary rendering retains its eager DOM path. After the optional ViewTransition driver is installed, all-transition batches can prepare a DOM plan, including batches that discover a newly entering boundary. Preparation uses the finished boundary activation props; old snapshots retain their previous names, matching React. Native publication accepts that plan once, runs mutation/insertion work, waits for relevant resources, completes refs/layout effects and their updates, then waits for an already-pending navigation before the new capture.
The plan retains real node identities. Suspended attempts cancel their writes; reentrant same-root refreshes finish accepted work before applying newer props; replacements and unmounts invalidate stale work. Retired cleanup remains owed even when an earlier callback unmounts the root. Hydration disposers and abort signals remain live until an accepted deletion publishes.
Element scopes
scope="element"requires one persistent direct host and adds no wrapper. Omitted boundaries inherit their nearest scope or use the document. Names, sharing, activation callbacks, pseudo-element targets, and cleanup belong to each native owner. One scheduled batch still publishes its DOM and layout work once across all participating owners. Sibling scopes can overlap; nested scopes can start after an ancestor's capture; work affecting a busy owner waits for its animation. Ordinary urgent work interrupts affected scopes;flushSyncinterrupts all.The host retains native self-participation and clipping. Its default name is
root; authored CSS names andnoneare respected, with an explicit componentnametaking precedence during capture. An unnamed scope's stable ref follows its host's committed CSS name. A shared stylesheet rule makes[vt-scope="element"]hosts scopes; authored inline!importantcan override it. Marker coownership preserves shared hosts until the final scope declaration is removed. Client and SSR use the same rule without style-setter hooks or inline hydration handoff attributes.Unsupported
Element.startViewTransition, invalid/missing hosts, and replaced scope roots commit normally without promoting the update to a document animation. Invalid visible hosts warn once in development. A callback-only native overload is detected and cached per native function; unexpected native failures report through the owning root handler while publishing once. The minimum browser version is unchanged. This is a progressive Octane extension based on the native element-scoped API.Reference snapshots for React compatibility: React 19.3.0 and React main for the already-supported experimental parent relays. Gesture APIs remain a separate feature.
Validation
ea346c0ce48926f076ae135d6cf3437dd011ecb2, including core/React parity, native Chromium, both work guards, lint, types, package validation, examples and compatibility. Cursor Bugbot passed. The Linux cleanup artifact reproduces all 12 local counts, source/compiler/fixture/harness hashes and complete emitted assets exactly; js-framework remains 34,088/46,167 calls. This head contains mainede01deec, is mergeable, and has a clean worktree. All 23 review threads are resolved; the earlier maintainer Changes requested review remains for re-review.tsrx-tscprojects.pnpm sync, scoped formatting and strict core/fixture types; nine staged-DOM checker cases including deliberate bypass mutations; production core build.c6fb27a9f4f56693e6fe80435404692e9e582db2, including core/React-parity shards, native browser integration, the new js-framework work guard, lint/types, package validation, runtime loaders, examples and compatibility. Cursor Bugbot also passed. The Linux CI artifact records 34,088/46,167 calls and 33,040/61,653 gzip bytes; its source hash, compiled fixture inputs and emitted asset manifests exactly match the local final evidence. All 23 review threads remain resolved. The branch contains mainfe1b2b7e6, has no merge conflict and is clean. The earlier maintainer Changes requested review remains for re-review.Performance
The ordinary-client regression and its fix are recorded first in RESULTS.md, with complete canonical run reports, hashes, failure controls, and measurement limits. Final TSRX/JSX gzip sizes are 33,040/61,653 bytes: +767/+1,425 versus main, and +182/+578 versus the reviewed PR. Inline native selection removes the extra function calls, but stage branches and shared code still have a bundle cost. No zero-overhead claim is made.
The following paragraphs describe the earlier review rounds; the latest client measurements supersede their client-byte observations.
Final feedback measurements and comparisons against both the reviewed head and main are recorded in RESULTS.md, with raw distributions, source/fixture/asset hashes and reproducible commands. Ordinary controls exclude the optional driver and adapter. Scope style-setter hooks are removed; all 40 ordinary style work cases retain their counts. Native capture and rectangle counts remain unchanged, while unused old-capture computed-style reads are removed.
The 1,024-row retained-plus-append adapter control eliminates 3,672,576 copied sibling slots and 2,100,224 searched slots. Its full-parent clear uses one clear instead of 2,048 removals. Projection caching reduces imported nodes from 51,694 to 1,102 for 48 radio association reads on a page with 1,024 unrelated hosts. These are deterministic work reductions, not claims about whole-application latency or allocations.
Round two adds realistic pages with one tiny boundary among 200 or 1,600 unrelated rows. Against
759330f3, the 24.6 KB page improves from 139.350 to 22.108 µs (84%), and the 197 KB page from 1,220.954 to 310.027 µs (75%). A separate comparison against the earliere36dec2b4implementation verifies that the page regression is removed (20.707 → 19.718 µs and 298.967 → 285.458 µs). Ordinary client bundle sizes and capture/read counters are unchanged; document/scope fixtures add 24/43 gzip bytes.Trusted raw HTML deliberately retains the robust parser: its 24.6 KB case improves from 133.401 to 82.955 µs against the reviewed implementation, but remains slower than the earlier unsafe regex (15.070 → 80.078 µs in that paired run). Tiny ready View retains a +0.583 µs cost against the earlier implementation; stream distributions track the plain control, with no speedup claimed. The combined server benchmark fixture adds 800 gzip bytes against
759330f3. Final source/dependency/fixture hashes, every timing sample and rejected intermediate runs are inreview-round-two.json.Risk / follow-ups
This expands the optional ViewTransition commit path substantially and adds a null-guarded host receiver adapter with a static guard for typed DOM accesses. Native capture barriers, overlapping owners, staged publication, interruption, hydration, rollback, and reentrancy have separate coverage. Feature-only projections and capture records add CPU and allocation cost. Whole-document observers and repeated owner discovery still have costs; a previously installed driver can stage batches without a currently mounted boundary. Active large-tree end-to-end CPU, browser paint cost, GC, and concurrent SSR throughput are not measured by the focused fixtures. A full host-operations-table rewrite remains a separate architectural change; this PR consolidates structural reads and guards the existing typed receiver seam.
Local core checks use an isolated configuration excluding the React differential setup,
tests/differential/**, andimperative-dom.test.ts; full repository checks and React parity run in CI. After merging main's TSRX migration, the configured registry returned HTTP 403 for its locked TSRX packages. The requester explicitly approved downloading those exact versions from npm's public registry with lockfile SHA-512 verification. Only the worktree's local dependency graph was repaired; no tracked registry or dependency configuration was changed. The install still stopped on unrelated[email protected], which was not fetched from an alternate registry.Provenance
agent-authored)Review feedback
Effect cleanup follow-up
Final head
ea346c0ceincorporates mainede01deec(native signal styles). The benchmark-list conflict preserves both sets of guards. Post-merge verification retains identical cleanup assets, compiled fixture inputs, all call counts, and semantic observations; source/merge provenance is recorded separately without rewriting the original measurements. 616 focused tests, 89 native browser cases, strict runtime/fixture types, 72 checker/workflow tests, and 43/43 benchmark guards pass again. Sync/formatting are current.Commit
c19852c37optimizes the installed-but-idle driver path.unmountScope,runScopeCleanups, anddeactivateScopecall staging methods only during an active staged capture. Active teardown/deactivation ordering and rollback remain intact; no new state or allocation is introduced.The unchanged effectful-list TSRX and JSX fixtures reproduce the regression after an actual completed native transition. Clearing/remounting 1,000 rows removes 2,000 function calls, and removing 100 scattered rows removes 200, in each dialect. Cold control counts remain identical. These are function-entry reductions, not latency claims. Feature-containing fixture bundles add 23 raw bytes each and +3/+5 gzip bytes. Other installed-driver lifecycle work remains.
The final baseline and candidate share exact compiler, fixture, compiled-input, dependency, harness and toolchain hashes. See cleanup evidence and limits and the adjacent committed measurement report. Baseline
ead781345passes semantic checks but breaches 18 of the 30 new guards; the optimized candidate passes all 30. The complete registered ViewTransition suite passes 43/43 guards. CI now runs the cleanup guard and uploads its results alongside js-framework work results.Local validation for this cleanup follow-up:
tsrx-tscpass. Corrected the browser fixture's missing JSON-safenestedTransitionfield.pnpm syncpass; generated outputs are current and the worktree is clean.Ordinary client benchmark regression
The reviewed
ab2c29e65failed the existing js-framework production-call guards even without ViewTransition imports. Inline stage selection for local receivers removes the identity helper from hot DOM operations. Complex receiver expressions still evaluate once before selecting the stage; the checker validates the exact receiver binding. Twelve immediate local captures remove the remaining per-row insertion calls without caching across component callbacks.The unchanged canonical guard now records TSRX 46,090 → 34,088 calls and JSX 60,209 → 46,167 calls per 1,000-row mount; main is 34,083/46,162 and the original limits remain 35,000/50,000. Both fixed repetitions pass with identical DOM/identity/event observations. A one-sample control confirms the new CI wrapper rejects both reviewed builds. The Chromium PR job now executes this guard and uploads its JSON on failure.
A warmed follow-up caught a remaining JSX selection cost from the 2,000 event-bundle updates per click. Guarding projection by active capture removes the idle optional-call assignment. In a fresh balanced comparison with 40 warmups and 80 samples per operation, final selection medians are 0.35/0.30 ms against main’s 0.30/0.40; swapping is 0.50/0.50 against 0.50/0.60. All identity, ordering and selection gates pass. The precise native/staging publication order is preserved, and final built assets match the measured prototype exactly. The shorter canonical sample still has a smaller JSX selection score difference (0.34/0.34 ms versus 0.22/0.28); the warmed comparison does not reproduce it, and early-run effects are not conclusively excluded.
Merged main’s style-spread optimization
fe1b2b7e6inb891b99f6. New main and final canonical assets are byte-identical to the measured baseline and candidate, with identical compiled fixture inputs; the separate equivalence report records updated source hashes. Strict types, the original guard, all 85 native cases and 112 style regressions pass after the merge. Document/scope bundle assets and native observations also remain identical. Historical timing hashes remain intact.Second-round history
Second-round feedback is addressed in
8c2fbf753, after merging mainbb11d0b3e:ownerDocument, with per-document deduplication. Cover staged iframe adoption and existing SSR styles in native Chromium.flushSyncbefore selecting capture owners and priority. A bounded cascade falls back to normal commits; an urgent sibling makes the entire batch commit without animation.CI follow-up
ab2c29e65replaces a TypeScript parameter property in the raw-HTML wrapper with an explicit field assignment so Node's native type-stripping loader can import it. The six public loader regressions pass after reproducing the failures locally. Both standalone server transforms and the complete measured SSR bundle remain byte-identical; the equivalence evidence is recorded alongside the historical timing hashes.First-round history
Integrated the maintainer's supplied fixes from
d38e8477dand addressed the remaining review in9aa4d7621, with the measured SSR parser follow-up infc0dbf32b:undefined), and report native failures for newly entering roots.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
High Risk
Touches ViewTransition commit/staging, DOM receivers, SSR parsing, and effect cleanup on core rendering paths; regressions would affect animation correctness and ordinary client performance.
Overview
Aligns Octane
ViewTransitionwith React 19.3 (activation classes, type maps, staged DOM commits, elementscope="element", streamed Suspense reveals) and keeps ordinary renders cheap via inline native DOM receivers, active-capture-gated event projection, and no inactivestageTeardownduring effect/Activity/Suspense cleanup after a transition finishes.Adds a
view-transitionsbenchmark suite (bundle reachability, native capture/read budgets,dom-stageadapter work, scoped SSR/client fixtures) plus wrappers that run the canonical js-framework and effectful-list harnesses against selected Octane revisions. Shared lifecycle oracles move intoeffectful-list/contract.mjs.CI (Chromium browser lane) now runs deterministic js-framework work and effect-cleanup guards and uploads JSON artifacts;
benchmarks/baselines/ratios.jsonregisters ~40 ratio ceilings so optional driver/staging stay out of ordinary bundles and cleanup cannot regress.Patch bumps for
octaneand@octanejs/mcp-server; MCP exposes the new benchmark tools (per changeset).Reviewed by Cursor Bugbot for commit ea346c0. Bugbot is set up for automated code reviews on this repo. Configure here.