Repository navigation
feat(octane): commit prepared DOM per scope and hydrate with one cursor - #2036
domgan-oai wants to merge 47 commits into
Conversation
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (3 without a verdict)
Work counters (an increase fails this check):
36 other measured values are unchanged. Application bundle size (bytes)
4 other measured values are unchanged. Public-import reachability bundles (bytes)
30 other measured values are unchanged. |
Guard empty preparation pointers at compiled sites, copy only at changes, and publish eligible scopes directly while preserving delayed layout validation. Verify Suspense after its visible reveal, align generated Boolean source mappings and SVG attribute-order snapshots.
… admission Replace native DOM undo journals and staged proxies throughout compiled and generic rendering. Commit structures, bindings, refs and signals at accepted scope boundaries; retain async DOM and park one cursor across hydration retries. Cover keyed ownership, portals, early leases, controls and ViewTransitions.
| `${outputText}\n//# sourceURL=${id}?${mode}-fixture`, | ||
| ); | ||
| return evaluate(runtime, internalRuntime, HydrationRuntime, runtimeModules, {}) as T; | ||
| evaluate(requireFixture, exports); |
There was a problem hiding this comment.
Fixture loader drops dynamic imports
Medium Severity
The shared fixture evaluator now transpiles compiled modules to CommonJS and only resolves static require calls. A dynamic import() of a compiler-selected chunk, including a split <Hydrate> child, is left as a real import. That import does not go through requireFixture, so the registered runtimeModules entry is never returned.
Reviewed by Cursor Bugbot for commit 15dd2f3. Configure here.
…ions Count ordinary host and text bindings for sparse preparation and share each event group fallback without publishing DOM during prepare. Retain owner-only presence guards across reentrant setters. Skip clean signal refresh work and clean equal literal write batches after all lifecycle and candidate checks.
Integrate 0bb503f after GitHub refused to schedule checks. Preserve scope preparation and committed DOM writes for row and text paths while adopting cached Text nodes and Strong source restrictions. Keep suppressed hydration content clearing at commit. Local compiler 1253/1253 and text/host/hydration 1080/1080, source typecheck, sync and format pass.
…tries Prepare only-child node and value caches together for both scalar and structural updates. Publish them in the scope writer. Keep slow-path access to the accepted node so reversing an unfinished empty slot replaces its preparation without guessing DOM ownership. Cover narrow and wide compiled retries, typed input identity and held host props.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
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 4c46eb0. Configure here.
…ldren Release a prior form-owned textarea default only when incoming value and defaultValue no longer own the text, during child publication. Retire absent default tracking after accepted form controls. Cover dirty live input, empty/null/undefined handoffs and unrelated default-retaining updates in both CSR and hydration.
Preserve initial markerless hydration and admit subsequent render bodies through the existing owner-host prepare/commit slot. Retain mounted empty hosts while new bodies suspend, and cover the regression in dev and prod.
Keep octanejs#2036 on the patch release plan adopted in octanejs#2070. The computed release plan selects octane 0.13.6 and contains no minor or major updates; runtime and full bundle inputs are unchanged.
Retain both octanejs#2036 patch changesets above Octane 0.13.6 so the next computed version is 0.13.7. Verify public and hydration versions, suspended root recovery, release plan, and unchanged complete Oxc/esbuild bundles.
Preserve upstream table rows and cells using inert template context and the existing fragment cache. Keep custom-element upgrade order, the single hydration cursor and accepted-only DOM commits; include upstream MDX integration without restoring staged DOM.
…sh-writer guard (#2043) Work in progress, not for review: - suspense-preserves-dom gains #2036's probe: a resumed hidden primary that builds its ErrorBoundary must not mutate the page during render. It fails today: ownSlotAnchor inserts its comment into the connected range. - check-render-writes records whether each write's receiver was created in its function and whether that function tests for a frontier. Nothing enforces it yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t fresh writers that reach committed DOM (#2043) ownSlotAnchor minted its comment into the Block's parent at render. For a resumed hidden primary that builds a new slot (an ErrorBoundary behind a use()), that parent is the committed, connected range, so the render mutated the page. A committed Block's anchor now goes into a frontier that its commit inserts; fresh DOM still takes it in place. check-render-writes now also checks each 'fresh' writer's receivers. A write into a node the function made, a fragment, or a node its caller passed is fine. A write into a node read from runtime structure (a Block's parentNode, a slot's markers) needs the function to test for a frontier. The old ownSlotAnchor fails that rule. UNGUARDED_FRESH lists the nine writers still to fix, and the lint fails on a new one or a stale entry. suspense-preserves-dom pins the #2036 probe: the resumed child's render makes no mutation of the page. Co-Authored-By: Claude Opus 5.5 <[email protected]>


Summary
This PR now tracks integration of the original hydration and prepare/commit work with
next, after #2044 was merged there. The implementations overlap heavily. Carry forward independently reviewable remaining work as smaller PRs, using the hydration protocol and prepare/commit infrastructure already onnext.Each PR starts directly from
next, has its own changeset and focused regressions, and can be reviewed independently. This remains a tracker for work that has not yet been extracted; don't merge the old umbrella implementation alongside the extracted changes.Validation
The exact remote head shown by this tracker is still
f404ac01a, prepared againstmain. It is not validated as an integration withnext. The local integration resolves the conflict in favor ofnext's hydration v3, pending signals and prepared commit writers, with the extracted changes above ported on top. The signed local checkpoint is7edfbc760, with parentsf404ac01aandc8c0898ae; the clean worktree preserves the full original work. There is no DOM-journal restoration.Combined local integration versus pinned
nextc8c0898ae, complete production JS, gzip bytes:These are combined port results, not per-PR size attribution. Matched native runs preserve all 88 update counts and identities. Paired sampled-style changed-value timings are about 4% faster on Oxc and 1.6% faster on esbuild; equal-value timings remain within the A/A variation. All 12 provider scenarios retain correct affected leaves and zero untouched work; own providers improve about 14–21%, sibling providers about 13–22% relative to that pinned
next. There is modest bundle growth relative to the merged implementation.Local validation on the independent branches: 77 signal tests, 66 provider tests, 114 custom-host/structure tests, and 124 focused runtime plus 41 Chromium tests;
pnpm syncpasses on each. Current-head GitHub CI is being checked on each small PR. Those results do not establish CI on this umbrella head.Risk / follow-up
Retain the working signed
main-based history and the local integration for any further useful extractions. Re-run combined validation when the accepted individual PRs are onnext. If the remaining work is redundant withnext, close this tracker once the useful parts have landed.Provenance
Implementation: Codex task · host
com-79386.Note
High Risk
Touches core client rendering, hydration adoption, SSR/streaming error boundaries, and ViewTransition commit paths—behavior regressions would affect visible DOM, forms, and production bundle gates across the whole framework.
Overview
Replaces staged DOM / journal undo with per-scope prepare/commit: bindings, hosts, lists, portals, and signals publish only when a render is accepted, so suspended or discarded updates keep committed DOM, handlers, and user edits. Hydration drops
HydrationCapabilityandDOMStagein favor of a single native cursor (createHydrationAttempt), with runtime pieces split into modules such asruntime/dom-operations.ts.SSR/hydration contract shifts: server
@catch/ErrorBoundaryare client-only; server errors stay on the pending fallback and request client retry (CLIENT_RENDER_ARM_COMMENT) without serializing rejections. Hydratable output gainsoctane-hydration:1versioning; fulfilleduse()seeds remain, retired error codes 23, 45, 343.Tooling & benchmarks: removes
staged-dom:check; bundle gates trackcreateHydrationAttempt, binding-marker reachability via source maps, andunreferencedMarkerDeclarations; root-transaction and event-metadata benches exercise the unmodified runtime (DOM retention, listener churn). Docs, parity ledgers, and consumer SSR fixtures updated for the new markers and error behavior.Reviewed by Cursor Bugbot for commit 4927ee5. Bugbot is set up for automated code reviews on this repo. Configure here.