Skip to content

fix(octane): resolve a component's signal handles from its Hydrate children - #1781

Merged
trueadm merged 17 commits into
mainfrom
fix/hydrate-children-signal-owner
Oct 5, 2026
Merged

trueadm merged 17 commits into
mainfrom
fix/hydrate-children-signal-owner

Conversation

@trueadm

@trueadm trueadm commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

What was wrong.

  • Compiled children written between <Hydrate> tags rendered in Hydrate's own signal frame, in the browser and on the server.
  • So a component's query$ read in them started a second request, and a derived$ read computed from cells the component never updated.
  • docs/signals.md says the children a component writes between another component's tags belong to its template.
  • fix(octane): resolve a component's signal handles from the children it passes #1774 covered <Suspense>, <ViewTransition>, <ErrorBoundary> and context providers, but not <Hydrate>, __HydrateCompiled or the permanently static form.

The stack. #1761 and #1773 are on main. #1774 was closed without merging, so this PR also carries #1774's change: the diff against main is #1774's children signal owner plus this Hydrate fix. Main's later budgets for #1783 (#1793, #1794) were sized without #1774's code, so this PR's growth is raised in the budget-only #1797. Merge #1797 first, then merge main into this PR.

Changes

  • Server: Hydrate and PermanentStaticHydrate are flagged with the pre-combined COMPONENT_FLAGS_AUTHOR_BOUNDARY, not an A | B argument, so their pure definitions still tree-shake. ssrComponent then links their frame to the owner markChildrenBlock recorded for the children, as fix(octane): resolve a component's signal handles from the children it passes #1774 does for the other boundaries.
  • Client:
    • createHydrateBoundaryBody defines a lazy CHILDREN_SIGNAL_OWNER getter on Hydrate's internal content try body. scopeSignalOwner already reads that property from a block's body, so the content owner links to the children's author when it is created.
    • A split boundary (__load/__data, children: null) has no children function. Its children are always written between its tags, so the getter returns the owner of the scope that rendered the boundary. On the server, the recorded owner is the same template.
    • Recorded owners take precedence, so children={props.children} forwarded into a split={false} boundary still reads its author's cells.
    • Nothing changes in scopeSignalOwner itself.
  • Tests (hydration/signal-declaration-owner.test.ts):
    • New frames() shapes: Hydrate, Hydrate row, forwarded Hydrate, split Hydrate, split Hydrate children (inside <Card>), and static Hydrate (when={never()}, server and hydration only).
    • A deferred activation case: condition(false) → condition(true), split and inline.
    • A handle prop read in a child's Hydrate children.
    • The client loader compiles a split boundary's ?octane-hydrate=N module from the same source.
    • The shared _server-fixture.ts resolves a dynamic import() through runtimeModules.
  • Docs and changeset: docs/signals.md lists <Hydrate>; added the octane patch changeset.

Validation

  • pnpm format:check: not run repo-wide; pnpm format:files:check passed on the changed files.
  • pnpm typecheck: not run repo-wide; pnpm typecheck:files passed on the changed files.
  • pnpm test: not run locally (machine load); CI runs it.
  • targeted tests:
    • vitest run --project octane packages/octane/tests/hydration/signal-declaration-owner.test.ts: 290 passed.
    • The same file in --project octane-prod: 580 passed, covering prod and strong compiles and __HydrateCompiled.
    • signal-instance-identity, independent-island-signal-identity, deferred-hydration, split-hydrate-local-bindings, suspense-hydrate (--project octane): 238 passed.
  • Pre-fix failures (dev):
    • Without the fix, 28 Hydrate cases fail: the browser starts 2 requests, and the server load is called 2 times.
    • The forwarded Hydrate, split Hydrate children, deferred and handle-prop cases also fail without the fix.
  • Each piece is load-bearing. Removing any one of these breaks only the intended cases:
    • the server flags;
    • the client getter;
    • the split fallback;
    • recorded-owner precedence (parent-only fails forwarded Hydrate).
  • Sizes: run-minimal.mjs --write-budgets and run.mjs --write-budgets octane-tsrx octane-jsx:
    • Only deferred-hydration grows: +125 raw / +30 gzip / −29 brotli, measured on the rebuilt stack.
    • App and JSX budgets are unchanged.
    • Reachability gates pass, including server-hooks.
    • The first design, a flag check inside scopeSignalOwner, cost 67–235 raw on every client bundle, so it was replaced.

Risk / follow-ups

  • Island capture path:
    • The split __data captures and CHILDREN_CAPTURES are unchanged.
    • The getter reads current props only when the content owner is first created.
    • Independent islands keep their own client root and can't capture parent-owned handles (OCTANE_HYDRATE_INDEPENDENT_OWNER_CAPTURE).
    • On the server, their frame now links to the author's owner, which affects resolution only for handles the island can't capture.
  • Fallback content: a Hydrate fallback renders in the pending arm, which still links to the Hydrate block as before.
  • Budgets: measured on main c3c0a3bcc0 with this branch, 69 raw and gzip values breach main's budgets; no brotli value does. ci(bench): raise byte budgets for the children and Hydrate signal owner fix #1797 raises each breached value to measured + 32, and with its files every minimal and app budget holds.

Provenance

  • An agent produced this diff (agent-authored)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Note

High Risk
Changes core signal owner linking for SSR, hydration, and boundary rendering; incorrect wiring could cause duplicate fetches, stale derived values, or hydration mismatches across many built-in paths.

Overview
Fixes signal cell ownership so a component's signal$ / derived$ / query$ resolve in the authoring component's cells when compiled children are rendered elsewhere—not in a duplicate frame owned by <Card>, boundaries, or <Hydrate>.

Runtime: markChildrenBlock stamps CHILDREN_SIGNAL_OWNER on compiled child renderers; client scopeSignalOwner and server ssrComponent link boundary/provider frames to that author. New COMPONENT_FLAG_AUTHOR_CHILDREN / COMPONENT_FLAGS_AUTHOR_BOUNDARY mark built-ins (Hydrate, Suspense, ViewTransition, ErrorBoundary, static Hydrate) that inline authored children. <Hydrate> adds a lazy owner getter on its content try body (split boundaries fall back to the parent scope; forwarded children keep the recorded author).

Docs/tests: docs/signals.md and patch changesets document the rule; signal-declaration-owner.test.ts covers children slots, boundaries, Hydrate variants, and hydration resume; _server-fixture resolves split Hydrate dynamic import().

Reviewed by Cursor Bugbot for commit 53c2cb3. Bugbot is set up for automated code reviews on this repo. Configure here.

trueadm and others added 10 commits October 5, 2026 12:54
… … }` blocks

A nested block got a signal instance of its own, so a component handle it
read resolved to a second cell: a second query request, and a value computed
from signals the component never updated. The block now links to the
template that renders it, as directive arms and keyed rows do, on the client
and the server. It still owns the declarations it evaluates. Fragment
renderers link to their component the same way, so a nested block in
returned JSX reads the component's cells below the root too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A host or fragment renderer copies the recipe of the scope it renders for,
including a nested block's `t:` site, so it was treated as a block and linked
past it to the block's parent. A block nested in that renderer then missed
the outer block's declarations and started its own query. Check the key
first: a renderer keeps its parent's key and links to it, and only a scope
that adds a segment of its own links to the scope that rendered it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nent

A hookless component's blocks hang off a DOM stand-in rather than its
scope, and the stand-in has no owner of its own. A renderer the component
renders, such as value-position JSX, therefore skipped the link, and a nested
block in it read a handle prop from a cell of its own. The stand-in records
the scope the component is registered on, so resolve the component's scope
from that scope's children. Arms inside a hookless component now link the
same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t passes

Compiled `.tsrx` children rendered in the receiving component's signal
instance, so `<Card>{record$.get()}</Card>` gave the read a cell of its own:
a second query in the browser and on the server, and derived reads computed
from signals the author never updated. `.tsx` children are evaluated by the
parent, so they already read the author's cells.

markChildrenBlock now records the owner the authoring template renders in.
On the client, a block whose body is those children, and a context provider
that renders them inline, link their owner to it. On the server, children
rendered in a slot link the same way, and Suspense, ViewTransition,
ErrorBoundary and context providers, which render them inline in their own
frame, carry a new capability bit so their owner links to the author.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ildren

The children a component writes between `<Hydrate>` tags are part of its
template, but Hydrate rendered them in a frame of its own on both sides, so a
read of the component's `query$` started a second request and a `derived$`
read computed from cells the component never updated.

- Server: flag `Hydrate` and `PermanentStaticHydrate` with the pre-combined
  `COMPONENT_FLAGS_AUTHOR_BOUNDARY`, so their frame links to the owner
  `markChildrenBlock` recorded for the children.
- Client: Hydrate's internal content try body exposes the same owner through a
  lazy `CHILDREN_SIGNAL_OWNER` getter, which `scopeSignalOwner` already reads.
  A split boundary has no children function, so its body links to the owner of
  the template rendering the boundary.
- Tests: Hydrate frames (inline, row, forwarded, split, split inside another
  component's children, permanently static), deferred activation, and a
  handle prop read in a child's Hydrate children. The shared fixture loader
  resolves a split boundary's dynamic import through `runtimeModules`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Oct 5, 2026
@trueadm
trueadm marked this pull request as ready for review October 5, 2026 13:14
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 38 value(s) increased within budget
  • 🔴 bundle-reachability: 68 value(s) increased within budget

Compares 49130566e, the merge commit's first parent with 2138a8a0c on the same runner. A byte value over its committed budget or any increase in a js-framework work counter fails this check. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 3.450 3.733 +2.2% −3.2% … +22.1% ⚪ within noise
octane-tsrx replace 9.808 9.850 −7.4% −14.7% … +14.6% ⚪ within noise
octane-tsrx add 3.183 3.050 −3.5% −13.0% … ±0.0% ⚪ within noise
octane-tsrx update 0.157 0.151 −5.9% −11.2% … +2.3% ⚪ within noise
octane-tsrx select 0.006 0.006 −0.3% −2.9% … +3.5% ⚪ within noise
octane-tsrx swap 0.037 0.037 +0.7% −1.8% … +1.4% ⚪ within noise
octane-tsrx remove 0.023 0.022 +2.8% −3.7% … +4.4% ⚪ within noise
octane-tsrx runlots 30.367 30.183 −3.2% −7.7% … +6.8% ⚪ within noise
octane-tsrx select_lots 0.006 0.007 +0.6% −1.1% … +2.9% ⚪ within noise
octane-tsrx clear 63.042 63.808 −0.1% −10.0% … +8.8% ⚪ within noise
octane-jsx run 4.600 4.417 +0.9% −7.8% … +7.8% ⚪ within noise
octane-jsx replace 10.667 9.533 −4.2% −15.5% … +4.0% ⚪ within noise
octane-jsx add 5.325 5.450 −0.9% −8.4% … +16.2% ⚪ within noise
octane-jsx update 0.413 0.447 −9.0% −17.0% … −1.5% ⚪ within noise
octane-jsx select 0.170 0.168 −0.6% −8.3% … +9.0% ⚪ within noise
octane-jsx swap 0.295 0.299 +4.1% +0.1% … +7.3% ⚪ within noise
octane-jsx remove 0.225 0.231 +1.3% −9.9% … +11.4% ⚪ within noise
octane-jsx runlots 40.600 39.942 −0.9% −4.6% … +5.8% ⚪ within noise
octane-jsx select_lots 2.167 2.109 +0.9% −12.1% … +11.1% ⚪ within noise
octane-jsx clear 69.433 72.558 +4.7% −7.5% … +11.9% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 121,294 121,442 +148 (+0.1%) 🔴
octane-tsrx js_gzip 40,118 40,170 +52 (+0.1%) 🔴
octane-tsrx js_brotli 35,492 35,464 −28 (−0.1%) 🟢
octane-tsrx app_gzip 2,435 2,433 −2 (−0.1%) 🟢
octane-tsrx app_brotli 2,129 2,125 −4 (−0.2%) 🟢
octane-tsrx fw_raw 114,159 114,307 +148 (+0.1%) 🔴
octane-tsrx fw_gzip 37,683 37,737 +54 (+0.1%) 🔴
octane-tsrx fw_brotli 33,363 33,339 −24 (−0.1%) 🟢
octane-tsrx todo_js_raw 132,015 132,163 +148 (+0.1%) 🔴
octane-tsrx todo_js_gzip 43,789 43,846 +57 (+0.1%) 🔴
octane-tsrx todo_js_brotli 38,546 38,508 −38 (−0.1%) 🟢
octane-tsrx todo_app_gzip 2,330 2,332 +2 (+0.1%) 🔴
octane-tsrx todo_app_brotli 1,986 1,989 +3 (+0.2%) 🔴
octane-tsrx todo_fw_raw 127,204 127,352 +148 (+0.1%) 🔴
octane-tsrx todo_fw_gzip 41,459 41,514 +55 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 36,560 36,519 −41 (−0.1%) 🟢
octane-tsrx chat_js_raw 130,654 130,802 +148 (+0.1%) 🔴
octane-tsrx chat_js_gzip 43,540 43,590 +50 (+0.1%) 🔴
octane-tsrx chat_js_brotli 38,382 38,347 −35 (−0.1%) 🟢
octane-tsrx chat_app_gzip 2,770 2,768 −2 (−0.1%) 🟢
octane-tsrx chat_app_brotli 2,459 2,450 −9 (−0.4%) 🟢
octane-tsrx chat_fw_raw 124,664 124,812 +148 (+0.1%) 🔴
octane-tsrx chat_fw_gzip 40,770 40,822 +52 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 35,923 35,897 −26 (−0.1%) 🟢
octane-tsrx weather_js_raw 169,192 169,340 +148 (+0.1%) 🔴
octane-tsrx weather_js_gzip 55,732 55,801 +69 (+0.1%) 🔴
octane-tsrx weather_js_brotli 48,648 48,727 +79 (+0.2%) 🔴
octane-tsrx weather_app_gzip 8,110 8,109 −1 (−0.0%) 🟢
octane-tsrx weather_app_brotli 6,907 6,892 −15 (−0.2%) 🟢
octane-tsrx weather_fw_raw 146,454 146,602 +148 (+0.1%) 🔴
octane-tsrx weather_fw_gzip 47,622 47,692 +70 (+0.1%) 🔴
octane-tsrx weather_fw_brotli 41,741 41,835 +94 (+0.2%) 🔴
octane-tsrx bindings_js_raw 716,387 716,538 +151 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 239,891 239,962 +71 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 204,255 204,250 −5 (−0.0%) 🟢
octane-tsrx bindings_app_gzip 121,383 121,370 −13 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 101,434 101,444 +10 (+0.0%) 🔴
octane-tsrx bindings_fw_raw 361,577 361,728 +151 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 118,508 118,592 +84 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 102,821 102,806 −15 (−0.0%) 🟢
octane-tsrx full_fw_raw 572,665 572,941 +276 (+0.0%) 🔴
octane-tsrx full_fw_gzip 175,485 175,572 +87 (+0.0%) 🔴
octane-tsrx full_fw_brotli 148,107 148,129 +22 (+0.0%) 🔴
octane-jsx js_raw 229,445 229,557 +112 (+0.0%) 🔴
octane-jsx js_gzip 73,372 73,416 +44 (+0.1%) 🔴
octane-jsx js_brotli 63,544 63,666 +122 (+0.2%) 🔴
octane-jsx app_gzip 2,936 2,935 −1 (−0.0%) 🟢
octane-jsx app_brotli 2,497 2,507 +10 (+0.4%) 🔴
octane-jsx fw_raw 220,986 221,098 +112 (+0.1%) 🔴
octane-jsx fw_gzip 70,436 70,481 +45 (+0.1%) 🔴
octane-jsx fw_brotli 61,047 61,159 +112 (+0.2%) 🔴
octane-jsx full_fw_raw 572,665 572,941 +276 (+0.0%) 🔴
octane-jsx full_fw_gzip 175,485 175,572 +87 (+0.0%) 🔴
octane-jsx full_fw_brotli 148,107 148,129 +22 (+0.0%) 🔴

6 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 110,028 110,172 +144 (+0.1%) 🔴
cli-spa-starter gzip 37,232 37,283 +51 (+0.1%) 🔴
cli-spa-starter brotli 32,603 32,649 +46 (+0.1%) 🔴
root-static-specialized raw 78,663 78,811 +148 (+0.2%) 🔴
root-static-specialized gzip 26,148 26,205 +57 (+0.2%) 🔴
root-static-specialized brotli 23,301 23,352 +51 (+0.2%) 🔴
root-chained-jsx raw 80,699 80,847 +148 (+0.2%) 🔴
root-chained-jsx gzip 26,693 26,748 +55 (+0.2%) 🔴
root-chained-jsx brotli 23,781 23,833 +52 (+0.2%) 🔴
root-static raw 205,668 205,784 +116 (+0.1%) 🔴
root-static gzip 65,574 65,597 +23 (+0.0%) 🔴
root-static brotli 56,860 56,942 +82 (+0.1%) 🔴
root-static-local raw 78,666 78,814 +148 (+0.2%) 🔴
root-static-local gzip 26,135 26,189 +54 (+0.2%) 🔴
root-static-local brotli 23,380 23,346 −34 (−0.1%) 🟢
hooks-state raw 90,726 90,874 +148 (+0.2%) 🔴
hooks-state gzip 30,161 30,219 +58 (+0.2%) 🔴
hooks-state brotli 26,845 26,899 +54 (+0.2%) 🔴
prop-attributes raw 91,205 91,353 +148 (+0.2%) 🔴
prop-attributes gzip 30,231 30,300 +69 (+0.2%) 🔴
prop-attributes brotli 26,910 26,920 +10 (+0.0%) 🔴
context raw 105,129 105,280 +151 (+0.1%) 🔴
context gzip 34,823 34,891 +68 (+0.2%) 🔴
context brotli 30,800 30,907 +107 (+0.3%) 🔴
hydrate-root raw 170,900 171,016 +116 (+0.1%) 🔴
hydrate-root gzip 54,203 54,245 +42 (+0.1%) 🔴
hydrate-root brotli 47,311 47,398 +87 (+0.2%) 🔴
deferred-hydration raw 234,416 234,692 +276 (+0.1%) 🔴
deferred-hydration gzip 74,141 74,246 +105 (+0.1%) 🔴
deferred-hydration brotli 63,943 63,983 +40 (+0.1%) 🔴
suspense-transition raw 161,400 161,516 +116 (+0.1%) 🔴
suspense-transition gzip 51,794 51,843 +49 (+0.1%) 🔴
suspense-transition brotli 45,344 45,389 +45 (+0.1%) 🔴
server-render raw 65,328 65,499 +171 (+0.3%) 🔴
server-render gzip 22,539 22,597 +58 (+0.3%) 🔴
server-render brotli 20,362 20,337 −25 (−0.1%) 🟢
component-owned-effects raw 83,179 83,323 +144 (+0.2%) 🔴
component-owned-effects gzip 27,444 27,501 +57 (+0.2%) 🔴
component-owned-effects brotli 24,514 24,526 +12 (+0.0%) 🔴
binding-hooks raw 89,242 89,390 +148 (+0.2%) 🔴
binding-hooks gzip 29,880 29,936 +56 (+0.2%) 🔴
binding-hooks brotli 26,607 26,601 −6 (−0.0%) 🟢
binding-base-ui-vite raw 215,928 216,040 +112 (+0.1%) 🔴
binding-base-ui-vite gzip 69,127 69,203 +76 (+0.1%) 🔴
binding-base-ui-vite brotli 59,912 60,029 +117 (+0.2%) 🔴
binding-base-ui-esbuild raw 213,844 213,958 +114 (+0.1%) 🔴
binding-base-ui-esbuild gzip 69,078 69,130 +52 (+0.1%) 🔴
binding-base-ui-esbuild brotli 59,894 59,995 +101 (+0.2%) 🔴
binding-aria-esbuild brotli 2,978 2,979 +1 (+0.0%) 🔴
binding-radix-vite raw 217,844 217,956 +112 (+0.1%) 🔴
binding-radix-vite gzip 69,710 69,775 +65 (+0.1%) 🔴
binding-radix-vite brotli 60,442 60,539 +97 (+0.2%) 🔴
binding-radix-esbuild raw 215,719 215,833 +114 (+0.1%) 🔴
binding-radix-esbuild gzip 69,653 69,715 +62 (+0.1%) 🔴
binding-radix-esbuild brotli 60,520 60,596 +76 (+0.1%) 🔴
binding-mantine-hooks-vite raw 92,546 92,694 +148 (+0.2%) 🔴
binding-mantine-hooks-vite gzip 30,726 30,776 +50 (+0.2%) 🔴
binding-mantine-hooks-vite brotli 27,382 27,388 +6 (+0.0%) 🔴
binding-mantine-hooks-esbuild raw 92,167 92,317 +150 (+0.2%) 🔴
binding-mantine-hooks-esbuild gzip 30,884 30,940 +56 (+0.2%) 🔴
binding-mantine-hooks-esbuild brotli 27,509 27,524 +15 (+0.1%) 🔴
binding-apollo-client-vite raw 360,895 361,046 +151 (+0.0%) 🔴
binding-apollo-client-vite gzip 113,175 113,235 +60 (+0.1%) 🔴
binding-apollo-client-vite brotli 98,885 98,879 −6 (−0.0%) 🟢
binding-apollo-client-esbuild raw 363,799 363,948 +149 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 115,401 115,484 +83 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 100,528 100,615 +87 (+0.1%) 🔴
binding-usehooks-ts-vite raw 93,327 93,475 +148 (+0.2%) 🔴
binding-usehooks-ts-vite gzip 30,966 31,033 +67 (+0.2%) 🔴
binding-usehooks-ts-vite brotli 27,566 27,634 +68 (+0.2%) 🔴
binding-usehooks-ts-esbuild raw 92,933 93,083 +150 (+0.2%) 🔴
binding-usehooks-ts-esbuild gzip 31,097 31,153 +56 (+0.2%) 🔴
binding-usehooks-ts-esbuild brotli 27,708 27,696 −12 (−0.0%) 🟢

32 other measured values are unchanged.

trueadm and others added 4 commits October 5, 2026 19:07
…nto fix/children-signal-owner

# Conflicts:
#	packages/octane/src/runtime.ts
…signal-owner

# Conflicts:
#	docs/signals.md
#	packages/octane/src/runtime.server.ts
#	packages/octane/src/runtime.ts
#	packages/octane/tests/hydration/signal-declaration-owner.test.ts
…signal-owner

# Conflicts:
#	packages/octane/tests/hydration/signal-declaration-owner.test.ts
trueadm added a commit that referenced this pull request Oct 5, 2026
…er fix (#1797)

#1781 lands #1774's children signal owner and the Hydrate children fix on
top of main c3c0a3b. #1773's raises for #1774 were used up by #1783's
budgets (#1793, #1794), which were sized without #1774's code. Measured on
main + #1781: 69 values breach, all raw or gzip; brotli fits everywhere.
Each breached value goes to measured + 32; no other value moves.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 5, 2026 22:06 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website October 5, 2026 22:06 Inactive
@vercel

vercel Bot commented Oct 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
octane-website Skipped Skipped Oct 5, 2026 10:06pm UTC
octane-website-mcp Skipped Skipped Oct 5, 2026 10:06pm UTC

Request Review

@trueadm
trueadm merged commit 8aeb6c0 into main Oct 5, 2026
30 of 33 checks passed
@trueadm
trueadm deleted the fix/hydrate-children-signal-owner branch October 5, 2026 23:42
trueadm added a commit that referenced this pull request Oct 6, 2026
Measured on the branch merged with main 8aeb6c0 (#1781): every createRoot
scenario and app shrinks now that hydration code stays out of clients that
never hydrate. Values are min(main, measured + headroom); the two hydrating
scenarios that grew are raised separately in a budget-only pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 6, 2026
… client-render fallback) (#1784)

* wip(hydration): throw HydrationMismatch from adopt instead of recovering per site

Adds the plan for matching React 19's hydration fallback and the first
mechanism step: a HydrationMismatch control error (code 339, React's message)
that the Suspense, Hydrate and root owners already handle by discarding the
server DOM and rendering on the client. adopt's repair branches now throw, and
the dev-only static attribute/markup compare warns instead of deciding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch from control-flow arms and lists

An @if/@switch slot, a list, or a component call that finds what the server
rendered for another arm no longer frames, rebuilds, holds or discards it in
place. A missing branch or list range, a nested arm pair that does not span
its slot, unclaimed content left at an arm's tail, a server arm where the
client renders an empty one, a list whose server arm differs (items vs
@empty), fewer or more server items, and a component hole whose walk found
an element instead of its range all throw HydrationMismatch, so the nearest
Suspense arm, Hydrate island or the root renders on the client.

Deletes the recovery machinery that became unreachable: markerless and held
hydrating branches (markerlessCursor, renderMarkerless, holdMarkerlessBranch,
heldBranchEnd and the list holds), rebuilt roots and fragments (insertRoot's
replacement path, resumeAt, replaces, sweepRebuiltTail, rebuildFragment,
placeRebuilt), the per-site list discards (discardItems, discardListArm,
discardLeftoverItems, reportRebuiltRange) and retired error code 56.

Keeps what matching content still needs: holeOpen's framing (a returned
Activity's children hydrate through it), and in-place adoption of a frameless
call below a passthrough root, whose owner shifts the server ranges one level.
A dormant island whose captures changed falls back without reporting, and a
Suspense arm that falls back publishes its held diagnostics.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch for missing ranges, unclaimed tails and root shapes

A component call without its server range, server content left after a
component's or a list's content, an unadoptable value in an adopted or lent
range, server text where a renderable or only-child hole renders an element,
component or list, a runtime host whose server node differs, an unframed root
shape that is not plain text or null, and an island's unclaimed remainder all
throw HydrationMismatch now, so the nearest Suspense arm, Hydrate island or
the root renders on the client instead of repairing the site.

A root keeps unmatched siblings left in its container, as React does:
hydrateRoot no longer sweeps or reports its remainder. A root's fallback
publishes the mismatch's dev warning, which its never-committed attempt
would otherwise drop.

Deletes the recovery machinery that became unreachable: unframed replays and
their suspended claims, in-place discards and lent ranges (lend, claimLent,
settleLent), the rebuilt-range and rebuilt-host records (HYDRATION_REBUILT,
HYDRATION_REBUILT_HOSTS, remember, firstAtRangeEnd), discard,
reclaimOwnedHost, abandonRoot and the abandoned state, reportStructural,
and retires error codes 51, 52, 53 and 55.

Keeps what matching content still needs: in-place adoption of a call whose
body matches the server node it stands at (renderInPlace, renderUnframed's
framing), tail detection for adopted ranges (claims, settleClaim), the
quiet build of items that render nothing into an empty range, and the
returned-component range borrow that lets a component adopt server text it
returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch for text and keep server attributes

A server text that differs from the client's no longer gets patched to the
client value: htext, htextSwap, hempty, binding-view text, a child slot's
adopted text and an only-child text host's unclaimed content all throw
HydrationMismatch, so the nearest Suspense arm, Hydrate island or the root
renders on the client. Texts equal after the HTML parser's normalization,
and texts under the host's suppressHydrationWarning, keep the server text.
A textarea's text is set to the client's, as React sets its default value.
A text that a render-phase update renders again before the pass ends is
compared once those updates settle, as React re-runs a component that
updates itself before it compares the output.

Attributes, class, style and raw HTML are never patched while hydrating: an
adopted element keeps the server's value until the client next changes it.
Development compares them and publishes one "won't be patched up" warning
per hydration pass (settleValues), which also carries the static template
differences; production compares nothing. An element the client built still
takes the client's values. Under captures that changed before a dormant
boundary activated, a differing text or attribute falls the boundary back
unreported instead of being repaired.

A runtime host's server child that no client child adopts is a mismatch
too, except inside <noscript>, whose server content parses as text.

Deletes the value-repair machinery: recordTextMismatch, flushTextWarnings
and the text warning queue, repaired and journalRepair, keepsServerValue,
repairHTML, allowClass, queueClass, flushClassWrites, applyStyle,
discardUnclaimedText, warnHydrationValueMismatch and
warnHydrationKeptServerValue, and retires error codes 54, 61 and 62.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): fall back islands, leases, seeds and replays like a boundary

A <Hydrate> island, a Suspense arm and the root now discard everything a
failed hydration attempt left behind, as React deletes a failed boundary's
server DOM:

- Early host bindings: a mismatch inside a revisioned presentation throws
  HydrationMismatch instead of refusing the lease (PresentationAdoptionMiss
  stays for refusals that are not mismatches). A host removed with the
  boundary's DOM is retired at the root's commit, and a host moved off a
  site in the discarded DOM is retired when the fallback commits
  (markHydrationDiscard), so its cleanup runs once and it stops writing.
- Seeds: useSeed records the thenable outcomes it writes. A boundary that
  falls back restores them, and a root attempt journals them, so the client
  render reads client data.
- Replays: an island drops captured intent whose target a fallback
  discarded instead of resolving it into the client-rendered DOM.
- Root: a fallback clears an <html>, <head> or <body> container sparingly,
  keeping scripts, styles and stylesheet links. The root container and
  <html>, <head> and <body> skip server elements of another tag and leave
  them in place, in compiled adoption and in descriptor children.
- onRecoverableError reports once per boundary that falls back instead of
  once per root per microtask.
- A Block that an island or arm hydration creates inside an ordinary root
  transaction keeps its adopted server DOM when that transaction rolls back,
  as a root's hydrating attempt does. A staged presentation rejection used
  to delete the island's adopted DOM, which per-site recovery rebuilt and a
  fallback now discarded.

Deletes repairedServerParents and the repaired-parent exemption in host
leases, which only per-site recovery needed. The suspended-attempt undo log
(save, rollback, speculative) stays: matching content still inserts fresh
markers and builds empty ranges, and a nested arm's fallback inside a
speculative attempt must be restored for a retry to find its streamed
payload. A Document container still clears whole, since the renderer has no
host singletons.

Rewrites the Hydration section of docs/differences-from-react.md to state
React parity and updates docs/ssr.md and docs/deferred-hydration.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): rewrite per-site hydration tests to React 19 outcomes

Each rewritten case asserts what React 19.2.7 does for the same fixture,
checked with a React-vs-Octane hydration oracle: a failed Suspense/@Try arm or
Hydrate island is client-rendered while its siblings keep their nodes, a root
without a boundary is client-rendered, attributes keep server values, and one
recoverable error is reported per failed boundary or root. Tests that pinned
only deleted per-site mechanisms are removed. Remaining failures assert React's
outcome where the runtime still diverges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): keep the server DOM until a root's client render commits

A root whose hydration fails now renders on the client beside the server
DOM and removes it only when that render commits, as React does: a
suspended or rolled-back fallback leaves the server nodes in place (never
detached), the dev warning and the single onRecoverableError report publish
with that commit, a fallback that ends in an uncaught error reports nothing,
and one whose render (root, Suspense arm or Hydrate island) catches an error
reports only the caught error. Element containers keep renderer-owned
<style data-octane> sidecars; a document's root element is restored on
rollback. An error thrown while a hydration adopts server DOM now fails the
nearest fallback owner even under a catch arm (new error 340, with the
thrown error as cause), while errors from client-rendered content still
reach catch arms. Production no longer reads the root source for a
fragment-root mismatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): fall back server catch arms, pending arms and cross-component updates like React

A server catch arm whose content does not match the client's now fails
the nearest fallback owner instead of logging "catch body threw, no outer
tryBlock" and leaving an empty range: a catch arm rethrows the mismatch,
and a @Try with @pending that adopts its server catch arm is that owner
itself (discards its server DOM and the attempt's seeds, renders on the
client as a dehydrated boundary, reports once unless that render catches).

renderToString of a suspended @Try now marks the @pending arm
(<!--oct-client:N-->, new error 341), as React's renderToString writes
<!--$!-->: the client renders only that boundary and reports once, or
reports only the caught error when its render catches one. A boundary
whose hydration failed no longer restarts the Suspense reveal throttle
when it shows @pending, as React's dehydrated boundary does not, so its
content reveals as soon as its data resolves. Presentation-binding views
keep adopting their pending arm.

The ErrorBoundary component now renders on the server through ssrTry, so
a caught arm carries the catch marker and the client adopts the server
fallback instead of reporting a false mismatch.

An update that a render schedules for another component, which the server
ignores, applies after the hydration it interrupts, as in React: the
hydration drain leaves cross-component updates queued, and a hookless
child rendered in its parent's block (componentSlotLite) calling a parent
setter is a cross-component update, warned in development with the
child's name.

try-hole-reader: a root fallback whose client render suspends and then
catches reports only the caught error. The React 19.2.7 oracle shows 0
recoverable and 1 caught for a root fallback that suspends then catches,
and 1 recoverable for a boundary that commits its fallback first; the
test now expects that instead of 1 recoverable for the root cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bench): gate createRoot-only bundles on retaining no hydration code

A client that only calls createRoot never hydrates, so its production bundle
must ship none of the hydration-only declarations in hydration-free-gates.mjs
and no module under packages/octane/src/hydration/. run-hydration-free.mjs
builds the #1785 public-root probe, the hydration-free minimal fixtures and the
js-framework octane-tsrx app under Vite's default oxc minifier and esbuild's
`minify: true`, and reads retention from each bundle's source map, so
minifier inlining and mangling cannot hide retained code. Hydrating controls
must retain every deny-listed declaration, and each name must still be a
top-level declaration of its source, so the list cannot go stale.

esbuild never folds a module flag, so esbuild bundles are not held to the six
`foldOnly` state cells and accessors (currentHydration, activeHydration, ...),
only to the hydration bodies, which must move where client code cannot reach
them.

The gate fails on the current runtime: every createRoot-only bundle retains
16-22 of the 23 deny-listed declarations. It runs in the shard 1/4 job next
to the bundle budgets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): let suspensions precede mismatches and client-render updated boundaries like React

React runs a component's whole body before it hydrates any host that body
renders, so a body that suspends keeps the server HTML even where a host
would not have matched. A compiled body adopts its template's roots first
and evaluates its holes after, so a template adoption that fails now defers
its mismatch (adoptOrDefer): the body continues on the client into detached
DOM, reading seeds as the hydration would, until React's order reaches a
host (the template's bag after its holes when it starts with a host, or the
next template clone). A suspension before then wins: a Suspense arm's attempt
and the root roll back and retry as for any suspension, and a Hydrate island
discards the attempt (a new undo log restores what it changed) and adopts
afresh when the wakeable settles, instead of resuming a leaf that rendered
on the client. The warning is logged only when the mismatch is reached, and
an application error the continuation throws fails the owner as the deferred
mismatch, whose client render throws it again.

New inputs that reach a Suspense arm whose hydration is suspended (root.render
or a parent render with new children) client-render the arm with no
recoverable error, as React 19 does, instead of hydrating with the new props.
A query owner that a mismatched or superseded attempt started is claimed by
the arm's client render, so the browser load runs once.

A runtime (createElement) host whose server element has fewer children than
the client's is a missing node and fails the nearest owner, as in React;
<noscript> content stays exempt.

A markerless @if/@switch arm whose first render threw after inserting one
element (a child of a single-root component suspended) no longer self-marks
with that element, so its later siblings render after it when it resumes;
this reproduced with createRoot alone (suspended-arm-sibling-order test).

Tests: returned-jsx-query-resume's restart scenario and
suspense-parent-render-query now expect React 19.2.7's outcome for an update
reaching a suspended dehydrated boundary (fallback shown, server output
discarded, 0 recoverable errors; probed with a standalone react-dom script
and the oracle's --rerender), not a hydration-with-new-props report.
suspended-clone-mismatch gains host-first, setup-suspending and
mark-then-leaf order cases checked with the oracle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): adopt calls without a range in place and catch walk failures like React

- A component call whose server range is absent (another arm's or another
  component's markup) renders in place of the server node at its position and
  adopts it when the DOM matches, as React compares only the DOM. A call at a
  template hole that renders nothing leaves no claimant for that node, and an
  anchorless call that renders nothing leaves it to the next sibling.
  Control-flow blocks keep divergence (1): an @if/@switch without its server
  range is still a mismatch.
- An only-child renderable hole whose server host is empty, or holds text,
  is a mismatch for an element, component or list value; a component value
  renders first, so a suspension keeps the server HTML.
- suppressHydrationWarning on an only-child text host keeps any server content
  until the next text change replaces it; an element where a sibling text
  hole's server text belongs is structural and falls back.
- An adopted template root whose server element lacks the elements its
  compiled walk reaches is a HydrationMismatch, and an error thrown while
  hydrating fails the nearest fallback owner (error 340), so a walk failure
  never escapes hydrateRoot as a TypeError.
- A falling-back island removes the server nodes after its range in its
  wrapper and disposes the attempt without detaching refs that never attached.
- A root that renders nothing leaves unmatched root-container children in
  place, and a hoisted head element is claimed with the client's attributes
  written and server-only attributes kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): ship no hydration code to clients that only call createRoot

The hydration-free gate (run-hydration-free.mjs) now passes: no createRoot-only
bundle retains any of its 23 hydration-only declarations, under Vite's default
minifier or esbuild.

- hydration-flag.ts, an import-free module, holds `hydrating` (true exactly
  while a pass's currentHydration is set) and a sticky `hydrationStarted` for
  state that outlives a pass. Only hydration code writes them, through
  swapHydration and installHydrationDriver, so Rolldown with oxc folds every
  guard in a client-only bundle. Client-reachable sites read the flag directly
  and only as a condition: oxc folds a module flag only where `undefined` and
  `false` agree, so a value position uses `hydrating ? x : false`. The shadowing
  `hydrating` locals are renamed.
- esbuild folds no flag, so hydration bodies move where client code holds no
  reference: setHTML's adoption becomes HydrationCapability.adoptHTML, and
  preserved <Hydrate> activations, native-adoption releases, presentation and
  lease work in shared commit and unmount paths go through a HydrationDriver
  that hydration installs. The binding-view presentation ABI keeps its bodies
  behind an early `hydrationStarted` guard instead, so hydrating apps without
  binding views do not gain them.
- isAdoptionControl tests a brand assigned in the NativeAdoptionMiss and
  PresentationAdoptionMiss constructors, so client bundles keep neither class.
- The early control bridge in signals/early-values.ts is no longer a top-level
  statement: hydrateRoot and every reader of early values install it first.
  The inline writer queues edits until then; a test pins both the first-reader
  and the module-capture order.
- dangerouslySetInnerHTML hydration matches React 19 (#1785 and the maintainer
  decision): production compares and normalizes nothing and records nothing,
  so the next render that passes an `__html` object rewrites adopted HTML;
  development compares only to warn. Stale captures still compare, inside the
  capability. trusted-html.test.ts follows react-dom 19.2.7's outcome.
- The gate's source-map oracle is column-precise. oxc joins adjacent variable
  statements and later drops a declarator its folding made unused, keeping the
  `var` keyword mapped to that declarator's line; a line-granular oracle charged
  a surviving declaration to the removed state cell. The deny-list is unchanged.
- Budgets are lowered for every improved scenario. hydrate-root and
  deferred-hydration grow (+1.7 kB raw, +0.55-0.61 kB gzip under esbuild minify)
  and are reported, not raised.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): fall back for a host's unclaimed server tail and pin the arm-range divergence

- An appended component call that renders nothing leaves the server node at
  the cursor for the next call appended to the same host. When no later call
  claims it, the host ends with server content the client never rendered, so
  the owning scope's render is now a mismatch, and the nearest fallback owner
  renders on the client as React does when it completes the host.
  (reconnecting-wave4c "can distinguish an empty component from a dom node",
  a regression from 331c81a.)
- Seven adoption tests asserted React's silent adoption of an @if branch with
  no server range. That contradicts the intentional arm-range divergence, which
  markerless-arm-retry already pins. They now assert the root fallback, are
  marked OCTANE DIVERGENCE, and still exercise the swaps afterwards.
- Production's dangerouslySetInnerHTML adoption compares raw strings, and only
  for stale server values, so the HTML normalizers are development-only and
  leave production hydrating bundles.
- docs/differences-from-react.md names both intentional hydration divergences
  (arm ranges, production template checks) and the React 19 raw-HTML behaviour.
- Changeset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(hydration): expect a root fallback for #1772's suspended stale-neighbor early host

With React 19 fallback, stale server content beside an early host is a
mismatch found before the sibling suspends. The root keeps the server DOM
until its client render commits, and the early host's lease ends with that
DOM, whether or not other code removed the stale node meanwhile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): replace an <html> container's head and body on a root fallback

A root that fell back while hydrating into an <html> element kept the
server's <head> and <body> (collectSparingly recursed into them as React's
clearContainerSparingly does), and the client render then appended its own,
leaving two heads and two bodies with document.body pointing at the stale
server body. React avoids that by reusing the kept elements as host
singletons; Octane has none.

Treat an <html> container as a Document container is treated: the fallback
discards the server's <head> and <body> with everything in them, and removes
them up front so the head entries the client render places in document.head
land in the client's <head>; a rollback restores them. A <head> or <body>
container still keeps its scripts, styles and stylesheet links, and
docs/differences-from-react.md now says so precisely.

The Float resource comment no longer claims resources are never removed: a
root fallback discards the ones in the server DOM it clears, as React's
clearContainer does for an element container, and a test pins that parity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): keep independent islands through a root fallback

A root that fell back for a mismatch discarded every container child,
independent <Hydrate> wrappers included, and the client render of an
independent Hydrate mounted a fresh, empty wrapper. The island's own root
still owned the removed wrapper, so its live DOM and state were lost, and a
dormant island could never activate.

The fallback's client render now adopts each server island wrapper by
boundary id, as hydration would have, and the commit discards only the
server nodes around the islands it adopted. A rollback of that render moves
the wrappers back. For the ids to match, every fallback attempt restarts the
root's ID counter (a retry after a suspension used to continue it), and a
rolled-back root attempt restores the id-count attribute it removed from an
adopted Hydrate wrapper, so the attempt that replaces it reserves the same
ids.

A Suspense arm or <Hydrate> island that falls back outside any hydration
pass now also clears the thrown-error record when its client render throws,
so a later root that throws the same error object while adopting still
falls back as React's does instead of treating it as a client error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): fail the owner for a rangeless Hydrate wrapper and discard abandoned attempts' seeds

A Hydrate island that adopted a server element without its boundary's
marker range emptied the element and mounted on the client in place:
per-site recovery with no report, no root journal entry and no discard of
the leases and replays in the replaced DOM. The server opens every
ordinary wrapper with that range, so such an element is something else the
server rendered there. It is now a HydrationMismatch for the enclosing
owner, as React's parent fails for a Suspense boundary whose server marker
is missing (oracle: root fallback, one recoverable error): the enclosing
Suspense arm or the root renders on the client and reports once, and
development names the component that renders the island.

A Hydrate island attempt that restarts after a deferred mismatch, and a
Suspense arm attempt that suspends, kept the outcomes their seeds wrote to
thenables: the restart never discarded them, and the arm handed them to an
enclosing hydration that commits. A retry then recorded the server value
as the thenable's prior state, so a later fallback restored server data
into the client render of a request that every attempt shares. Both
discard the attempt's seeds now, and the retry seeds afresh.
initial-suspense-hydrate's rejected-retry case now expects that client
render to wait for the client's data, as React's would.

keepsText records its undo for a Hydrate island attempt (undoable) as
save() does, not only for a speculative arm attempt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): keep the early control bridge and NativeAdoptionMiss out of createRoot bundles that use signals

- Signal cells no longer install the early control bridge on every read.
  A renderer and the document owner now associate owners with their document
  (associateSignalOwnerDocument) without claiming the inline writer's queue.
  Only hydration entry points claim it: hydrateRoot, a streamed document's
  owner registration (registerSignalOwnerDocument) and the module control
  capture. Queued pre-hydration edits still reach the first cell created after
  that claim (early-control-handoff.test.ts).
- The hydration-free gate gains create-root-signals under Vite and esbuild.
  That fixture also showed the signal engine keeping NativeAdoptionMiss: it now
  tests a brand (isNativeAdoptionMiss) and throws through nativeAdoptionMiss,
  whose class installHydrationDriver supplies before any resolver exists.
- The gate passes again: attributeUnchanged (from #1762) reads activeHydration
  only behind the `hydrating` flag, and the dev-only adoptHTML normalizers
  leave the deny-list, since no production control can retain them. The
  bridge's stale gate comment is corrected.
- Development once again lists the static differences of each fragment root
  that adoption matches ("won't be patched up"), through one dev-only helper,
  unpatchedStatics, which never changes what is adopted. fragmentRootMatches
  uses its partialStyles argument for that check again.
- The root fallback no longer reads the outer pass's staleServerValues after
  swapHydration restored it. A root's server output never predates its state.
- Stale comments about per-site repair and rebuilds now describe the
  boundary or root fallback (runtime.ts, runtime.server.ts, and the
  onRecoverableError line in docs/differences-from-react.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): lower 102 byte budgets for the hydration-free client bundles

Measured on the branch merged with main 8aeb6c0 (#1781): every createRoot
scenario and app shrinks now that hydration code stays out of clients that
never hydrate. Values are min(main, measured + headroom); the two hydrating
scenarios that grew are raised separately in a budget-only pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(hydration): pin early-host lease refusal after a suspended root and early branch retry

Adds two behavior-root regressions for the React 19 hydration fallback:

- An early-bound root-level host whose third-party root neighbor is removed
  while hydration is suspended refuses its lease when hydration resumes. The
  root reports that refusal to onUncaughtError once (the retry() wrapper),
  nothing falls back or commits, and the early owner stays live. With the
  neighbor unchanged, the host hands off and the sibling stays in place.
- A branch the early owner switched since the server rendered is not a
  mismatch: hydration keeps the early DOM, reports nothing, and adopts it once
  a later publication renders the client's branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(parity): point the React conformance ledger at the rewritten hydration tests

Fifteen ledger entries cited hydration test names that this PR renamed when
the tests moved to React 19 outcomes. The attribute case (Per :245) is no
longer a documented divergence: an adopted element keeps its server
attributes with a development warning, as in React, so it is covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bindings): hydrate real server output in the tiptap and resizable-panels tests

- tiptap hydrated hand-written markup without Octane's hydration markers,
  which are part of the hydration protocol. Its tests now hydrate the shell
  the server renders (renderHydrationFixture gains a tiptap entry).
- resizable-panels rendered the server without storage and hydrated with it.
  As in React 19, hydration keeps a mismatched attribute's server value, so
  the server now reads the same storage, as a cookie- or database-backed
  LayoutStorage does, and the restored layout is adopted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(parity): re-pin the hydration SSR helper hash in tanstack-pacer's parity manifest

renderHydrationFixture gained a tiptap entry; the pacer manifest pins that
support file's sha256.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): retry a suspended call without a server range afresh

A Hydrate island resumes a suspended attempt at the block that suspended,
which rendered the body of a call without a server range of its own outside
renderUnframed: an in-place body no longer adopted the server node (the island
fell back where React adopts) and a body where the server rendered nothing
built without reporting. A suspension that escapes renderUnframed now marks
the attempt, and the island discards it and adopts afresh once the data
arrives (DeferredHydrationSuspension), as React retries a dehydrated
boundary; the root and Suspense arms already retry afresh.

A client-built cursor at an unframed call is an earlier sibling's markers,
past the server's last node, so the server rendered nothing more there: the
call hydrates against nothing, as React does, instead of building without a
report. The replay mode for it is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(audit): describe React 19 boundary fallback in the Redact hydration-recovery entry

RDX-HYD-006 cited two per-site recovery tests this PR rewrote. Octane now
follows React 19 rather than Redact's nearest-host recovery: the nearest
Suspense, @Try or <Hydrate> boundary, or the root, renders on the client.
The entry's references, contract and rationale say so; the audit doc is
regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): compare the text a render-phase update settles on, and framed text in empty holes

A component that updates itself while its template renders is rendered
again before the pass ends, and React compares only the output that
render settles on. Two cases still decided on the first render's text:

- Where the server rendered no text (htext, htextSwap, binding-view and
  child-slot empty paths), keepsText had no node to defer on and threw a
  mismatch at once, even when the settled text was empty too. The hole
  now creates its empty Text node first (newText), which stands for the
  server's empty text, so the comparison waits for settleValues.
- A first render that matched the server text was never recorded, so a
  settled text that differed was patched in place, unreported. An equal
  text now records too while a block on the render stack has an update
  queued (QUEUE is empty in the common pass, which skips the walk).

hempty unwrapped only an empty server frame, so a text-only
<!--[-->text<!--]--> frame over an empty client value was structural
content that suppressHydrationWarning could not keep, unlike the same
bare text. Both now unwrap as in htext (shared textFrameEnd/unframe). As
in React, an empty string compares as the host's text content, which
suppression keeps; null, undefined or a boolean hydrate no child, so a
server text there is a mismatch suppression does not hide, bare or
framed.

describeHydrationNode names an empty Text node "nothing".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): skip foreign comments where a root hydrates, and restore an unfinished arm a discarded attempt removed

The root container and <html>, <head> and <body> skipped only consecutive
server elements of another tag, so a comment that a third party inserted
there made the root fall back. React 19 skips every comment but its own
boundary markers (react-dom 19.2.7: no fallback for a comment before the
root, between <head> and <body>, or beside a foreign element; a text node
still falls back). skipForeign now steps over comments other than range
markers, from the cursor itself, and the document-singleton descriptor walk
steps over comments. A text node still ends the search.

takeNativeFreshArm removed a renderToString boundary's unfinished @pending
arm before the client render without recording the change. An attempt that
was then discarded, the root's when a later sibling suspended or an
enclosing Suspense arm's, left the boundary empty, and its retry found no
marker, so the root fell back with a mismatch instead of reporting the
unfinished boundary. It now records the parent first (save), so a discarded
attempt restores the server arm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 6, 2026
…t 19 (#1808)

* wip(hydration): throw HydrationMismatch from adopt instead of recovering per site

Adds the plan for matching React 19's hydration fallback and the first
mechanism step: a HydrationMismatch control error (code 339, React's message)
that the Suspense, Hydrate and root owners already handle by discarding the
server DOM and rendering on the client. adopt's repair branches now throw, and
the dev-only static attribute/markup compare warns instead of deciding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch from control-flow arms and lists

An @if/@switch slot, a list, or a component call that finds what the server
rendered for another arm no longer frames, rebuilds, holds or discards it in
place. A missing branch or list range, a nested arm pair that does not span
its slot, unclaimed content left at an arm's tail, a server arm where the
client renders an empty one, a list whose server arm differs (items vs
@empty), fewer or more server items, and a component hole whose walk found
an element instead of its range all throw HydrationMismatch, so the nearest
Suspense arm, Hydrate island or the root renders on the client.

Deletes the recovery machinery that became unreachable: markerless and held
hydrating branches (markerlessCursor, renderMarkerless, holdMarkerlessBranch,
heldBranchEnd and the list holds), rebuilt roots and fragments (insertRoot's
replacement path, resumeAt, replaces, sweepRebuiltTail, rebuildFragment,
placeRebuilt), the per-site list discards (discardItems, discardListArm,
discardLeftoverItems, reportRebuiltRange) and retired error code 56.

Keeps what matching content still needs: holeOpen's framing (a returned
Activity's children hydrate through it), and in-place adoption of a frameless
call below a passthrough root, whose owner shifts the server ranges one level.
A dormant island whose captures changed falls back without reporting, and a
Suspense arm that falls back publishes its held diagnostics.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch for missing ranges, unclaimed tails and root shapes

A component call without its server range, server content left after a
component's or a list's content, an unadoptable value in an adopted or lent
range, server text where a renderable or only-child hole renders an element,
component or list, a runtime host whose server node differs, an unframed root
shape that is not plain text or null, and an island's unclaimed remainder all
throw HydrationMismatch now, so the nearest Suspense arm, Hydrate island or
the root renders on the client instead of repairing the site.

A root keeps unmatched siblings left in its container, as React does:
hydrateRoot no longer sweeps or reports its remainder. A root's fallback
publishes the mismatch's dev warning, which its never-committed attempt
would otherwise drop.

Deletes the recovery machinery that became unreachable: unframed replays and
their suspended claims, in-place discards and lent ranges (lend, claimLent,
settleLent), the rebuilt-range and rebuilt-host records (HYDRATION_REBUILT,
HYDRATION_REBUILT_HOSTS, remember, firstAtRangeEnd), discard,
reclaimOwnedHost, abandonRoot and the abandoned state, reportStructural,
and retires error codes 51, 52, 53 and 55.

Keeps what matching content still needs: in-place adoption of a call whose
body matches the server node it stands at (renderInPlace, renderUnframed's
framing), tail detection for adopted ranges (claims, settleClaim), the
quiet build of items that render nothing into an empty range, and the
returned-component range borrow that lets a component adopt server text it
returns.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): throw HydrationMismatch for text and keep server attributes

A server text that differs from the client's no longer gets patched to the
client value: htext, htextSwap, hempty, binding-view text, a child slot's
adopted text and an only-child text host's unclaimed content all throw
HydrationMismatch, so the nearest Suspense arm, Hydrate island or the root
renders on the client. Texts equal after the HTML parser's normalization,
and texts under the host's suppressHydrationWarning, keep the server text.
A textarea's text is set to the client's, as React sets its default value.
A text that a render-phase update renders again before the pass ends is
compared once those updates settle, as React re-runs a component that
updates itself before it compares the output.

Attributes, class, style and raw HTML are never patched while hydrating: an
adopted element keeps the server's value until the client next changes it.
Development compares them and publishes one "won't be patched up" warning
per hydration pass (settleValues), which also carries the static template
differences; production compares nothing. An element the client built still
takes the client's values. Under captures that changed before a dormant
boundary activated, a differing text or attribute falls the boundary back
unreported instead of being repaired.

A runtime host's server child that no client child adopts is a mismatch
too, except inside <noscript>, whose server content parses as text.

Deletes the value-repair machinery: recordTextMismatch, flushTextWarnings
and the text warning queue, repaired and journalRepair, keepsServerValue,
repairHTML, allowClass, queueClass, flushClassWrites, applyStyle,
discardUnclaimedText, warnHydrationValueMismatch and
warnHydrationKeptServerValue, and retires error codes 54, 61 and 62.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): fall back islands, leases, seeds and replays like a boundary

A <Hydrate> island, a Suspense arm and the root now discard everything a
failed hydration attempt left behind, as React deletes a failed boundary's
server DOM:

- Early host bindings: a mismatch inside a revisioned presentation throws
  HydrationMismatch instead of refusing the lease (PresentationAdoptionMiss
  stays for refusals that are not mismatches). A host removed with the
  boundary's DOM is retired at the root's commit, and a host moved off a
  site in the discarded DOM is retired when the fallback commits
  (markHydrationDiscard), so its cleanup runs once and it stops writing.
- Seeds: useSeed records the thenable outcomes it writes. A boundary that
  falls back restores them, and a root attempt journals them, so the client
  render reads client data.
- Replays: an island drops captured intent whose target a fallback
  discarded instead of resolving it into the client-rendered DOM.
- Root: a fallback clears an <html>, <head> or <body> container sparingly,
  keeping scripts, styles and stylesheet links. The root container and
  <html>, <head> and <body> skip server elements of another tag and leave
  them in place, in compiled adoption and in descriptor children.
- onRecoverableError reports once per boundary that falls back instead of
  once per root per microtask.
- A Block that an island or arm hydration creates inside an ordinary root
  transaction keeps its adopted server DOM when that transaction rolls back,
  as a root's hydrating attempt does. A staged presentation rejection used
  to delete the island's adopted DOM, which per-site recovery rebuilt and a
  fallback now discarded.

Deletes repairedServerParents and the repaired-parent exemption in host
leases, which only per-site recovery needed. The suspended-attempt undo log
(save, rollback, speculative) stays: matching content still inserts fresh
markers and builds empty ranges, and a nested arm's fallback inside a
speculative attempt must be restored for a retry to find its streamed
payload. A Document container still clears whole, since the renderer has no
host singletons.

Rewrites the Hydration section of docs/differences-from-react.md to state
React parity and updates docs/ssr.md and docs/deferred-hydration.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): rewrite per-site hydration tests to React 19 outcomes

Each rewritten case asserts what React 19.2.7 does for the same fixture,
checked with a React-vs-Octane hydration oracle: a failed Suspense/@Try arm or
Hydrate island is client-rendered while its siblings keep their nodes, a root
without a boundary is client-rendered, attributes keep server values, and one
recoverable error is reported per failed boundary or root. Tests that pinned
only deleted per-site mechanisms are removed. Remaining failures assert React's
outcome where the runtime still diverges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): keep the server DOM until a root's client render commits

A root whose hydration fails now renders on the client beside the server
DOM and removes it only when that render commits, as React does: a
suspended or rolled-back fallback leaves the server nodes in place (never
detached), the dev warning and the single onRecoverableError report publish
with that commit, a fallback that ends in an uncaught error reports nothing,
and one whose render (root, Suspense arm or Hydrate island) catches an error
reports only the caught error. Element containers keep renderer-owned
<style data-octane> sidecars; a document's root element is restored on
rollback. An error thrown while a hydration adopts server DOM now fails the
nearest fallback owner even under a catch arm (new error 340, with the
thrown error as cause), while errors from client-rendered content still
reach catch arms. Production no longer reads the root source for a
fragment-root mismatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): fall back server catch arms, pending arms and cross-component updates like React

A server catch arm whose content does not match the client's now fails
the nearest fallback owner instead of logging "catch body threw, no outer
tryBlock" and leaving an empty range: a catch arm rethrows the mismatch,
and a @Try with @pending that adopts its server catch arm is that owner
itself (discards its server DOM and the attempt's seeds, renders on the
client as a dehydrated boundary, reports once unless that render catches).

renderToString of a suspended @Try now marks the @pending arm
(<!--oct-client:N-->, new error 341), as React's renderToString writes
<!--$!-->: the client renders only that boundary and reports once, or
reports only the caught error when its render catches one. A boundary
whose hydration failed no longer restarts the Suspense reveal throttle
when it shows @pending, as React's dehydrated boundary does not, so its
content reveals as soon as its data resolves. Presentation-binding views
keep adopting their pending arm.

The ErrorBoundary component now renders on the server through ssrTry, so
a caught arm carries the catch marker and the client adopts the server
fallback instead of reporting a false mismatch.

An update that a render schedules for another component, which the server
ignores, applies after the hydration it interrupts, as in React: the
hydration drain leaves cross-component updates queued, and a hookless
child rendered in its parent's block (componentSlotLite) calling a parent
setter is a cross-component update, warned in development with the
child's name.

try-hole-reader: a root fallback whose client render suspends and then
catches reports only the caught error. The React 19.2.7 oracle shows 0
recoverable and 1 caught for a root fallback that suspends then catches,
and 1 recoverable for a boundary that commits its fallback first; the
test now expects that instead of 1 recoverable for the root cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bench): gate createRoot-only bundles on retaining no hydration code

A client that only calls createRoot never hydrates, so its production bundle
must ship none of the hydration-only declarations in hydration-free-gates.mjs
and no module under packages/octane/src/hydration/. run-hydration-free.mjs
builds the #1785 public-root probe, the hydration-free minimal fixtures and the
js-framework octane-tsrx app under Vite's default oxc minifier and esbuild's
`minify: true`, and reads retention from each bundle's source map, so
minifier inlining and mangling cannot hide retained code. Hydrating controls
must retain every deny-listed declaration, and each name must still be a
top-level declaration of its source, so the list cannot go stale.

esbuild never folds a module flag, so esbuild bundles are not held to the six
`foldOnly` state cells and accessors (currentHydration, activeHydration, ...),
only to the hydration bodies, which must move where client code cannot reach
them.

The gate fails on the current runtime: every createRoot-only bundle retains
16-22 of the 23 deny-listed declarations. It runs in the shard 1/4 job next
to the bundle budgets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): let suspensions precede mismatches and client-render updated boundaries like React

React runs a component's whole body before it hydrates any host that body
renders, so a body that suspends keeps the server HTML even where a host
would not have matched. A compiled body adopts its template's roots first
and evaluates its holes after, so a template adoption that fails now defers
its mismatch (adoptOrDefer): the body continues on the client into detached
DOM, reading seeds as the hydration would, until React's order reaches a
host (the template's bag after its holes when it starts with a host, or the
next template clone). A suspension before then wins: a Suspense arm's attempt
and the root roll back and retry as for any suspension, and a Hydrate island
discards the attempt (a new undo log restores what it changed) and adopts
afresh when the wakeable settles, instead of resuming a leaf that rendered
on the client. The warning is logged only when the mismatch is reached, and
an application error the continuation throws fails the owner as the deferred
mismatch, whose client render throws it again.

New inputs that reach a Suspense arm whose hydration is suspended (root.render
or a parent render with new children) client-render the arm with no
recoverable error, as React 19 does, instead of hydrating with the new props.
A query owner that a mismatched or superseded attempt started is claimed by
the arm's client render, so the browser load runs once.

A runtime (createElement) host whose server element has fewer children than
the client's is a missing node and fails the nearest owner, as in React;
<noscript> content stays exempt.

A markerless @if/@switch arm whose first render threw after inserting one
element (a child of a single-root component suspended) no longer self-marks
with that element, so its later siblings render after it when it resumes;
this reproduced with createRoot alone (suspended-arm-sibling-order test).

Tests: returned-jsx-query-resume's restart scenario and
suspense-parent-render-query now expect React 19.2.7's outcome for an update
reaching a suspended dehydrated boundary (fallback shown, server output
discarded, 0 recoverable errors; probed with a standalone react-dom script
and the oracle's --rerender), not a hydration-with-new-props report.
suspended-clone-mismatch gains host-first, setup-suspending and
mark-then-leaf order cases checked with the oracle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): adopt calls without a range in place and catch walk failures like React

- A component call whose server range is absent (another arm's or another
  component's markup) renders in place of the server node at its position and
  adopts it when the DOM matches, as React compares only the DOM. A call at a
  template hole that renders nothing leaves no claimant for that node, and an
  anchorless call that renders nothing leaves it to the next sibling.
  Control-flow blocks keep divergence (1): an @if/@switch without its server
  range is still a mismatch.
- An only-child renderable hole whose server host is empty, or holds text,
  is a mismatch for an element, component or list value; a component value
  renders first, so a suspension keeps the server HTML.
- suppressHydrationWarning on an only-child text host keeps any server content
  until the next text change replaces it; an element where a sibling text
  hole's server text belongs is structural and falls back.
- An adopted template root whose server element lacks the elements its
  compiled walk reaches is a HydrationMismatch, and an error thrown while
  hydrating fails the nearest fallback owner (error 340), so a walk failure
  never escapes hydrateRoot as a TypeError.
- A falling-back island removes the server nodes after its range in its
  wrapper and disposes the attempt without detaching refs that never attached.
- A root that renders nothing leaves unmatched root-container children in
  place, and a hoisted head element is claimed with the client's attributes
  written and server-only attributes kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip(hydration): ship no hydration code to clients that only call createRoot

The hydration-free gate (run-hydration-free.mjs) now passes: no createRoot-only
bundle retains any of its 23 hydration-only declarations, under Vite's default
minifier or esbuild.

- hydration-flag.ts, an import-free module, holds `hydrating` (true exactly
  while a pass's currentHydration is set) and a sticky `hydrationStarted` for
  state that outlives a pass. Only hydration code writes them, through
  swapHydration and installHydrationDriver, so Rolldown with oxc folds every
  guard in a client-only bundle. Client-reachable sites read the flag directly
  and only as a condition: oxc folds a module flag only where `undefined` and
  `false` agree, so a value position uses `hydrating ? x : false`. The shadowing
  `hydrating` locals are renamed.
- esbuild folds no flag, so hydration bodies move where client code holds no
  reference: setHTML's adoption becomes HydrationCapability.adoptHTML, and
  preserved <Hydrate> activations, native-adoption releases, presentation and
  lease work in shared commit and unmount paths go through a HydrationDriver
  that hydration installs. The binding-view presentation ABI keeps its bodies
  behind an early `hydrationStarted` guard instead, so hydrating apps without
  binding views do not gain them.
- isAdoptionControl tests a brand assigned in the NativeAdoptionMiss and
  PresentationAdoptionMiss constructors, so client bundles keep neither class.
- The early control bridge in signals/early-values.ts is no longer a top-level
  statement: hydrateRoot and every reader of early values install it first.
  The inline writer queues edits until then; a test pins both the first-reader
  and the module-capture order.
- dangerouslySetInnerHTML hydration matches React 19 (#1785 and the maintainer
  decision): production compares and normalizes nothing and records nothing,
  so the next render that passes an `__html` object rewrites adopted HTML;
  development compares only to warn. Stale captures still compare, inside the
  capability. trusted-html.test.ts follows react-dom 19.2.7's outcome.
- The gate's source-map oracle is column-precise. oxc joins adjacent variable
  statements and later drops a declarator its folding made unused, keeping the
  `var` keyword mapped to that declarator's line; a line-granular oracle charged
  a surviving declaration to the removed state cell. The deny-list is unchanged.
- Budgets are lowered for every improved scenario. hydrate-root and
  deferred-hydration grow (+1.7 kB raw, +0.55-0.61 kB gzip under esbuild minify)
  and are reported, not raised.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): fall back for a host's unclaimed server tail and pin the arm-range divergence

- An appended component call that renders nothing leaves the server node at
  the cursor for the next call appended to the same host. When no later call
  claims it, the host ends with server content the client never rendered, so
  the owning scope's render is now a mismatch, and the nearest fallback owner
  renders on the client as React does when it completes the host.
  (reconnecting-wave4c "can distinguish an empty component from a dom node",
  a regression from 331c81a.)
- Seven adoption tests asserted React's silent adoption of an @if branch with
  no server range. That contradicts the intentional arm-range divergence, which
  markerless-arm-retry already pins. They now assert the root fallback, are
  marked OCTANE DIVERGENCE, and still exercise the swaps afterwards.
- Production's dangerouslySetInnerHTML adoption compares raw strings, and only
  for stale server values, so the HTML normalizers are development-only and
  leave production hydrating bundles.
- docs/differences-from-react.md names both intentional hydration divergences
  (arm ranges, production template checks) and the React 19 raw-HTML behaviour.
- Changeset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(hydration): expect a root fallback for #1772's suspended stale-neighbor early host

With React 19 fallback, stale server content beside an early host is a
mismatch found before the sibling suspends. The root keeps the server DOM
until its client render commits, and the early host's lease ends with that
DOM, whether or not other code removed the stale node meanwhile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): replace an <html> container's head and body on a root fallback

A root that fell back while hydrating into an <html> element kept the
server's <head> and <body> (collectSparingly recursed into them as React's
clearContainerSparingly does), and the client render then appended its own,
leaving two heads and two bodies with document.body pointing at the stale
server body. React avoids that by reusing the kept elements as host
singletons; Octane has none.

Treat an <html> container as a Document container is treated: the fallback
discards the server's <head> and <body> with everything in them, and removes
them up front so the head entries the client render places in document.head
land in the client's <head>; a rollback restores them. A <head> or <body>
container still keeps its scripts, styles and stylesheet links, and
docs/differences-from-react.md now says so precisely.

The Float resource comment no longer claims resources are never removed: a
root fallback discards the ones in the server DOM it clears, as React's
clearContainer does for an element container, and a test pins that parity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): keep independent islands through a root fallback

A root that fell back for a mismatch discarded every container child,
independent <Hydrate> wrappers included, and the client render of an
independent Hydrate mounted a fresh, empty wrapper. The island's own root
still owned the removed wrapper, so its live DOM and state were lost, and a
dormant island could never activate.

The fallback's client render now adopts each server island wrapper by
boundary id, as hydration would have, and the commit discards only the
server nodes around the islands it adopted. A rollback of that render moves
the wrappers back. For the ids to match, every fallback attempt restarts the
root's ID counter (a retry after a suspension used to continue it), and a
rolled-back root attempt restores the id-count attribute it removed from an
adopted Hydrate wrapper, so the attempt that replaces it reserves the same
ids.

A Suspense arm or <Hydrate> island that falls back outside any hydration
pass now also clears the thrown-error record when its client render throws,
so a later root that throws the same error object while adopting still
falls back as React's does instead of treating it as a client error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): fail the owner for a rangeless Hydrate wrapper and discard abandoned attempts' seeds

A Hydrate island that adopted a server element without its boundary's
marker range emptied the element and mounted on the client in place:
per-site recovery with no report, no root journal entry and no discard of
the leases and replays in the replaced DOM. The server opens every
ordinary wrapper with that range, so such an element is something else the
server rendered there. It is now a HydrationMismatch for the enclosing
owner, as React's parent fails for a Suspense boundary whose server marker
is missing (oracle: root fallback, one recoverable error): the enclosing
Suspense arm or the root renders on the client and reports once, and
development names the component that renders the island.

A Hydrate island attempt that restarts after a deferred mismatch, and a
Suspense arm attempt that suspends, kept the outcomes their seeds wrote to
thenables: the restart never discarded them, and the arm handed them to an
enclosing hydration that commits. A retry then recorded the server value
as the thenable's prior state, so a later fallback restored server data
into the client render of a request that every attempt shares. Both
discard the attempt's seeds now, and the retry seeds afresh.
initial-suspense-hydrate's rejected-retry case now expects that client
render to wait for the client's data, as React's would.

keepsText records its undo for a Hydrate island attempt (undoable) as
save() does, not only for a speculative arm attempt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): keep the early control bridge and NativeAdoptionMiss out of createRoot bundles that use signals

- Signal cells no longer install the early control bridge on every read.
  A renderer and the document owner now associate owners with their document
  (associateSignalOwnerDocument) without claiming the inline writer's queue.
  Only hydration entry points claim it: hydrateRoot, a streamed document's
  owner registration (registerSignalOwnerDocument) and the module control
  capture. Queued pre-hydration edits still reach the first cell created after
  that claim (early-control-handoff.test.ts).
- The hydration-free gate gains create-root-signals under Vite and esbuild.
  That fixture also showed the signal engine keeping NativeAdoptionMiss: it now
  tests a brand (isNativeAdoptionMiss) and throws through nativeAdoptionMiss,
  whose class installHydrationDriver supplies before any resolver exists.
- The gate passes again: attributeUnchanged (from #1762) reads activeHydration
  only behind the `hydrating` flag, and the dev-only adoptHTML normalizers
  leave the deny-list, since no production control can retain them. The
  bridge's stale gate comment is corrected.
- Development once again lists the static differences of each fragment root
  that adoption matches ("won't be patched up"), through one dev-only helper,
  unpatchedStatics, which never changes what is adopted. fragmentRootMatches
  uses its partialStyles argument for that check again.
- The root fallback no longer reads the outer pass's staleServerValues after
  swapHydration restored it. A root's server output never predates its state.
- Stale comments about per-site repair and rebuilds now describe the
  boundary or root fallback (runtime.ts, runtime.server.ts, and the
  onRecoverableError line in docs/differences-from-react.md).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci(bench): lower 102 byte budgets for the hydration-free client bundles

Measured on the branch merged with main 8aeb6c0 (#1781): every createRoot
scenario and app shrinks now that hydration code stays out of clients that
never hydrate. Values are min(main, measured + headroom); the two hydrating
scenarios that grew are raised separately in a budget-only pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(hydration): pin early-host lease refusal after a suspended root and early branch retry

Adds two behavior-root regressions for the React 19 hydration fallback:

- An early-bound root-level host whose third-party root neighbor is removed
  while hydration is suspended refuses its lease when hydration resumes. The
  root reports that refusal to onUncaughtError once (the retry() wrapper),
  nothing falls back or commits, and the early owner stays live. With the
  neighbor unchanged, the host hands off and the sibling stays in place.
- A branch the early owner switched since the server rendered is not a
  mismatch: hydration keeps the early DOM, reports nothing, and adopts it once
  a later publication renders the client's branch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(parity): point the React conformance ledger at the rewritten hydration tests

Fifteen ledger entries cited hydration test names that this PR renamed when
the tests moved to React 19 outcomes. The attribute case (Per :245) is no
longer a documented divergence: an adopted element keeps its server
attributes with a development warning, as in React, so it is covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(bindings): hydrate real server output in the tiptap and resizable-panels tests

- tiptap hydrated hand-written markup without Octane's hydration markers,
  which are part of the hydration protocol. Its tests now hydrate the shell
  the server renders (renderHydrationFixture gains a tiptap entry).
- resizable-panels rendered the server without storage and hydrated with it.
  As in React 19, hydration keeps a mismatched attribute's server value, so
  the server now reads the same storage, as a cookie- or database-backed
  LayoutStorage does, and the restored layout is adopted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(parity): re-pin the hydration SSR helper hash in tanstack-pacer's parity manifest

renderHydrationFixture gained a tiptap entry; the pacer manifest pins that
support file's sha256.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): retry a suspended call without a server range afresh

A Hydrate island resumes a suspended attempt at the block that suspended,
which rendered the body of a call without a server range of its own outside
renderUnframed: an in-place body no longer adopted the server node (the island
fell back where React adopts) and a body where the server rendered nothing
built without reporting. A suspension that escapes renderUnframed now marks
the attempt, and the island discards it and adopts afresh once the data
arrives (DeferredHydrationSuspension), as React retries a dehydrated
boundary; the root and Suspense arms already retry afresh.

A client-built cursor at an unframed call is an earlier sibling's markers,
past the server's last node, so the server rendered nothing more there: the
call hydrates against nothing, as React does, instead of building without a
report. The replay mode for it is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(audit): describe React 19 boundary fallback in the Redact hydration-recovery entry

RDX-HYD-006 cited two per-site recovery tests this PR rewrote. Octane now
follows React 19 rather than Redact's nearest-host recovery: the nearest
Suspense, @Try or <Hydrate> boundary, or the root, renders on the client.
The entry's references, contract and rationale say so; the audit doc is
regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): compare the text a render-phase update settles on, and framed text in empty holes

A component that updates itself while its template renders is rendered
again before the pass ends, and React compares only the output that
render settles on. Two cases still decided on the first render's text:

- Where the server rendered no text (htext, htextSwap, binding-view and
  child-slot empty paths), keepsText had no node to defer on and threw a
  mismatch at once, even when the settled text was empty too. The hole
  now creates its empty Text node first (newText), which stands for the
  server's empty text, so the comparison waits for settleValues.
- A first render that matched the server text was never recorded, so a
  settled text that differed was patched in place, unreported. An equal
  text now records too while a block on the render stack has an update
  queued (QUEUE is empty in the common pass, which skips the walk).

hempty unwrapped only an empty server frame, so a text-only
<!--[-->text<!--]--> frame over an empty client value was structural
content that suppressHydrationWarning could not keep, unlike the same
bare text. Both now unwrap as in htext (shared textFrameEnd/unframe). As
in React, an empty string compares as the host's text content, which
suppression keeps; null, undefined or a boolean hydrate no child, so a
server text there is a mismatch suppression does not hide, bare or
framed.

describeHydrationNode names an empty Text node "nothing".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(hydration): skip foreign comments where a root hydrates, and restore an unfinished arm a discarded attempt removed

The root container and <html>, <head> and <body> skipped only consecutive
server elements of another tag, so a comment that a third party inserted
there made the root fall back. React 19 skips every comment but its own
boundary markers (react-dom 19.2.7: no fallback for a comment before the
root, between <head> and <body>, or beside a foreign element; a text node
still falls back). skipForeign now steps over comments other than range
markers, from the cursor itself, and the document-singleton descriptor walk
steps over comments. A text node still ends the search.

takeNativeFreshArm removed a renderToString boundary's unfinished @pending
arm before the client render without recording the change. An attempt that
was then discarded, the root's when a later sibling suspended or an
enclosing Suspense arm's, left the boundary empty, and its retry found no
marker, so the root fell back with a mismatch instead of reporting the
unfinished boundary. It now records the parent first (save), so a discarded
attempt restores the server arm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): project a hydrated form control's client value like React 19

Hydrating an <input value>, <textarea value>, or a checkbox's checked or
defaultChecked returned early for an adopted element, so a value the client
renders differently from the server was never applied: a controlled input kept
showing the server's value while its state held another.

React 19.2.7's initInput/initTextarea write only the client value's reset
baseline while hydrating (the value attribute, the textarea's content, the
checked attribute). An unedited input or textarea follows it through the
platform's dirty-value flag, a pre-hydration edit survives, and checkedness is
detached and kept. Octane now does the same by falling through to the existing
equality-guarded baseline writes, so a matching hydration still writes nothing.
Unlike React, a pre-hydration textarea edit is kept, as in an input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(octane): keep an adopted control clean across a discarded hydration attempt

An adopted setValue journaled the live value, and a discarded hydrating
attempt restored it through the IDL setter, which marks the control dirty.
The retry's baseline-only write then left an unedited input or textarea on the
server's value. An adopted control's live value is never written, so its
journal record now leaves it out: restoring the default alone moves an
unedited control back without dirtying it.

The hydration lookups use the ternary form of the flag guard, which Vite folds
out of createRoot-only bundles, and stay within every size budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

2 inactive deployments
Preview – octane-website-mcp — 53c2cb3f Deployed Oct 5, 2026 by vercel[bot]
Preview – octane-website — 53c2cb3f Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant