Skip to content

chore: merge main into next - #2087

Merged
trueadm merged 8 commits into
nextfrom
sync/main-into-next
Oct 15, 2026
Merged

trueadm merged 8 commits into
nextfrom
sync/main-into-next

Conversation

@trueadm

@trueadm trueadm commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Why

next must track main's fixes. #2077 and #2078 were found while working on #2044 and are already on next through it, so this merge mostly reconciles the two copies. #2076 needed re-expressing for the redesign.

Changes

Validation

  • octane, octane-prod, octane-signals* and website-unit, with the render-write guard on: 1,735 files, 48,530 tests
  • pnpm typecheck:files on runtime.ts and runtime.server.ts, plus render-writes:check
  • pnpm sync: clean
  • Repo-wide pnpm format:check and full pnpm test: left to CI
  • perf-review: no hot path touched; the emptied-Provider clear is one commit op per emptied Provider
  • concise-code: two small helpers shared by the two reset sites; I rejected a separate commit-time reset path

Risk / follow-ups

  • next and main stay in sync through periodic forward merges like this one.

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.


Note

Medium Risk
Touches core Provider reconciliation and DOM frontier teardown on the redesign branch; behavior is well-tested but incorrect commit/journal handling could duplicate or leak subtrees during transitions.

Overview
Merges main into the next runtime-redesign branch, reconciling conflict fixes from SSR scoped-children handling and release-note text while landing upstream behavior on the commit-based renderer.

Emptied Context Providers (#2076, re-expressed): When <Context> / CompiledContext children become null or undefined, prior subtree DOM is torn down and effects clean up instead of staying mounted. On next, clearing runs at commit (clearEmptiedProvider, resetProviderChildren) with journaled empty dialect so abandoned transitions still restore the old children; refilling after empty reuses the same frontier reset as a dialect flip. JSX and compiled providers share the expanded “had children before” reconcile path.

@octanejs/three Canvas: Switches to a Strong template and routes onCreated / onPointerMissed through effect events, with layout snapshots for event-source/target wiring—tests assert latest callbacks without re-running async root setup.

Also adds SSR scoped-children coverage, provider empty-child regression tests (sync, transition, hydration), and more resilient website dev SSR e2e warm-up (devtools trigger reload, MDX HMR retries).

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

o-alexandrov and others added 7 commits October 15, 2026 11:54
…2076)

* fix(octane): remove a .tsx Provider's children when they become null

* fix(octane): remove CompiledContext children when they become null

* fix(octane): keep CompiledContext's emptied dialect so a rolled-back transition can't duplicate its children
Main a9dfdf7 failed the website integration suite: the dev-SSR beforeAll
waited 120 s for the TanStack Devtools trigger on /devtools and skipped all 37
dev-SSR tests. The wait came with #2062 and has failed on main and two
branches since, while passing locally on every cold warm-up (~3.9 s).

The devtools client mounts after hydration from modules a cold dev server may
only discover on that first visit, and Vite recovers with a reload a slow
runner can miss. Wait 60 s, log what the first attempt saw, reload once, and
fail with the page errors if the trigger still never appears. The devtools
tests themselves still assert the trigger and panel on fresh loads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…wing (#2077)

A server module that reads module signals installs the native read collector
as it loads, and every later render in the process then collects its reads
for the hydration snapshot. A render that read a pending query through
snapshot(), such as an automatically streamed query, completed with a read it
could not seed and threw "A completed native server read has no serializable
ready value". On main 0bb503f, 28 of the 30 early-independent-intent cases
throw once that collector exists, while the same page renders in a server
that has loaded no such module.

A snapshot renders a pending or failed state as it is, without suspending.
The client resolves that state itself, or takes a stream's later delivery, so
the read now contributes no seed, which is also no invented ready one. A
completed value read of an unready source still throws.

The signals-hydration case that pinned the throw now asserts that contract:
the pending output renders with no hydration snapshot, adopts the same node,
and shows the result once the query resolves. The supplemental native DOM
smoke case says the same. The new streamed test loads a module-signal page,
renders a pending snapshot under streamed signals, hydrates while the client
is still pending, and takes the stream's result without a second fetch.

Co-authored-by: Claude Opus 5.5 <[email protected]>
…s hydrateRoot does (#2078)

* fix(octane): render a server element entry as its component's root, as hydrateRoot does

renderToString(<App />), and every other server renderer given an element,
rendered the element as a value its root returns (renderEntryValue), which
frames the component in a range of its own. hydrateRoot(container, <App />)
unwraps an element whose type is a component into the root's body and props,
as it does App itself, so the client root has no such range. When App returns
a component, a fragment, a Suspense boundary or a template, or renders its
children, the server's HTML did not match, and the root rendered on the
client with a recoverable error.

Each server renderer now reads its entry through renderEntry: a component
element renders as that component's root, with the props its descriptor
renders it with (descriptorProps, shared with ssrComponentDescriptor), and any
other value as before. The two entry forms produce the same HTML, and either
hydrates through either hydrateRoot form.

root-entry-forms pins every pairing of renderToString and
renderToReadableStream, each given App or <App />, with hydrateRoot given App
or <App />, for a root that returns host JSX, a template, a component, a
fragment, text, null, a Suspense boundary or its children, in dev and prod
compiles: 80 of its 256 cases fail before this change.

Client bundles are unchanged; the minified server runtime shrinks 234 B raw.

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

* fix(octane): read a server descriptor's children only after the scoped check

A scoped component descriptor's children getter resolves deferred children,
so reading it first ran them in the parent's scope before the component
entered.

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…wait a slow runner

Main 8318702 failed the website integration suite: "hot-updates
generated MDX twice while preserving the surrounding interactive page" timed
out waiting 20 s for an edit to reach the page. It also failed on
perf/runtime-size-redesign; it passes locally every time. Until 1622fa0
the /devtools warm-up flake skipped the whole dev-SSR block, which hid it.

Each edit now waits in 15 s rounds, re-writing the file between rounds in
case the watcher dropped a write that followed the previous one, for up to
60 s; the test's budget grows to 180 s. The assertions are unchanged: the
generated text updates, the sibling counter keeps its state, and no errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings #2076, #2077, #2078, #2080 and the website e2e test fixes into next.
#2076's emptied CompiledContext now clears its old children at commit, so the
render writes nothing and an abandoned transition keeps them; #2078's server
entry fix and #2077's snapshot fix were already on next through #2044.

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 chore PR: tooling, dependencies, repo maintenance labels Oct 15, 2026
@github-actions
github-actions Bot marked this pull request as draft October 15, 2026 12:37
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website-mcp afc7459 Commit Preview URL

Branch Preview URL
Oct 15 2026, 12:50 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
octane-website afc7459 Commit Preview URL

Branch Preview URL
Oct 15 2026, 12:52 PM

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Empty Provider remount writes live DOM
    • Fixed by restoring CHILDREN_DIALECT_SLOT to 2 in clearEmptiedProvider after resetScopeChildren wipes hooks, and by adding openScopeFrontier to resetProviderChildren so the incoming body renders off-document via a frontier, with CompiledContext saving and restoring endMarker to match the descriptor Provider path.

Create PR

Or push these changes by commenting:

@cursor push 1f901715d3
Preview (1f901715d3)
diff --git a/packages/octane/src/runtime.ts b/packages/octane/src/runtime.ts
--- a/packages/octane/src/runtime.ts
+++ b/packages/octane/src/runtime.ts
@@ -15649,7 +15649,7 @@
  * Clear a Provider scope whose children went away. Over committed DOM the
  * outgoing children leave at commit, after their cleanups, as a dialect flip's do.
  */
-function resetProviderChildren(scope: Scope): void {
+function resetProviderChildren(scope: Scope): Node | null | undefined {
 	const block = scope.block;
 	const parent = block.parentNode;
 	const live = ROOT_RENDER_TRANSACTION !== null && usesFrontier(block, parent);
@@ -15660,12 +15660,18 @@
 		block.startMarker !== null ? getNextSibling(block.startMarker) : getFirstChild(parent);
 	if (first !== end)
 		queueRootDeletion(null, first, end === null ? parent.lastChild : end.previousSibling);
+	return openScopeFrontier(scope, block, parent);
 }
 
 /** A Provider whose children went away clears them once its render commits. */
 function clearEmptiedProvider(scope: Scope): void {
-	if (!scope.block.disposed && scope.hooks?.get(CHILDREN_DIALECT_SLOT) === 2)
+	if (!scope.block.disposed && scope.hooks?.get(CHILDREN_DIALECT_SLOT) === 2) {
 		resetScopeChildren(scope);
+		// resetScopeChildren wipes the hooks map. Restore the empty dialect so a
+		// later body sees previous === 2 and takes the frontier/reset path rather
+		// than mounting as a first render into live DOM.
+		ensureHooks(scope).set(CHILDREN_DIALECT_SLOT, 2);
+	}
 }
 
 /** Record a Provider's children dialect; a dropped window restores the previous one. */
@@ -15701,15 +15707,20 @@
 	}
 	const dialect = (children as any)[CHILDREN_BODY] ?? children;
 	const previous = scope.hooks?.get(CHILDREN_DIALECT_SLOT);
+	let liveEnd: Node | null | undefined;
 	if (previous !== dialect) {
 		if (previous === 2) {
-			resetProviderChildren(scope);
+			liveEnd = resetProviderChildren(scope);
 			if (scope.block.disposed) return;
 		} else if (previous !== undefined) invalidateSharedBodyOutput(scope);
 		setChildrenDialect(scope, previous, dialect);
 	}
-	const output = renderSharedBody(children as ComponentBody, undefined, scope, undefined);
-	if (output != null) throw new TypeError(formatClientError(345));
+	try {
+		const output = renderSharedBody(children as ComponentBody, undefined, scope, undefined);
+		if (output != null) throw new TypeError(formatClientError(345));
+	} finally {
+		if (liveEnd !== undefined) scope.block.endMarker = liveEnd;
+	}
 }
 
 function initializeContext<T>(ctx: Context<T>, defaultValue: T): Context<T> {

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 189f545. Configure here.

Comment thread packages/octane/src/runtime.ts Resolved
@trueadm
trueadm marked this pull request as ready for review October 15, 2026 12:45
…h a frontier (#2043)

Clearing an emptied CompiledContext at commit dropped its hooks map, so the
empty dialect was lost; it is now kept. A refill's reset opens the scope's
frontier like a dialect flip, so its incoming body builds off-document.

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

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 20 value(s) increased
  • 🔴 bundle-reachability: 10 value(s) increased

Compares 98ce9c362, the merge commit's first parent with 8b7a51e95 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. 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 2.825 2.658 −1.6% −3.7% … +0.0% ⚪ within noise
octane-tsrx replace 6.658 6.375 ±0.0% −6.4% … +4.6% ⚪ within noise
octane-tsrx add 2.317 2.442 ±0.0% −0.0% … +4.3% ⚪ within noise
octane-tsrx update 0.092 0.095 +0.8% −3.5% … +3.8% ⚪ within noise
octane-tsrx select 0.006 0.006 −1.6% −3.8% … +0.6% ⚪ within noise
octane-tsrx swap 0.018 0.018 −3.5% −4.9% … −0.8% ⚪ within noise
octane-tsrx remove 0.015 0.015 −0.4% −3.4% … +2.7% ⚪ within noise
octane-tsrx runlots 22.742 22.775 −4.0% −8.8% … −1.1% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 −0.8% −1.6% … −0.3% ⚪ within noise
octane-tsrx clear 46.825 45.733 −1.4% −3.2% … −0.1% ⚪ within noise
octane-jsx run 4.075 4.133 −2.4% −4.1% … +1.4% ⚪ within noise
octane-jsx replace 7.125 7.258 +0.8% −2.1% … +3.0% ⚪ within noise
octane-jsx add 3.625 3.408 −1.3% −3.1% … ±0.0% ⚪ within noise
octane-jsx update 0.187 0.191 −0.3% −1.5% … +1.3% ⚪ within noise
octane-jsx select 0.098 0.097 +1.6% +0.0% … +2.6% ⚪ within noise
octane-jsx swap 0.138 0.146 +1.6% ±0.0% … +3.0% ⚪ within noise
octane-jsx remove 0.132 0.134 −1.3% −2.0% … +0.7% ⚪ within noise
octane-jsx runlots 26.958 28.367 −2.0% −4.3% … +3.5% ⚪ within noise
octane-jsx select_lots 0.950 0.967 +3.0% +0.6% … +5.2% ⚪ within noise
octane-jsx clear 50.708 49.792 −0.6% −3.4% … +2.7% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx bindings_js_raw 685,160 685,187 +27 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 226,480 226,484 +4 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 192,720 192,835 +115 (+0.1%) 🔴
octane-tsrx bindings_app_gzip 117,001 117,000 −1 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 97,038 97,045 +7 (+0.0%) 🔴
octane-tsrx bindings_fw_raw 330,845 330,872 +27 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 109,479 109,484 +5 (+0.0%) 🔴
octane-tsrx bindings_fw_brotli 95,682 95,790 +108 (+0.1%) 🔴
octane-tsrx wayfinder_js_raw 438,520 438,547 +27 (+0.0%) 🔴
octane-tsrx wayfinder_js_gzip 145,014 145,016 +2 (+0.0%) 🔴
octane-tsrx wayfinder_js_brotli 125,980 126,059 +79 (+0.1%) 🔴
octane-tsrx pagecraft_oxc_js_raw 544,306 544,333 +27 (+0.0%) 🔴
octane-tsrx pagecraft_oxc_js_gzip 171,545 171,552 +7 (+0.0%) 🔴
octane-tsrx pagecraft_oxc_js_brotli 145,448 145,445 −3 (−0.0%) 🟢
octane-tsrx pagecraft_esbuild_js_raw 576,763 576,790 +27 (+0.0%) 🔴
octane-tsrx pagecraft_esbuild_js_gzip 186,893 186,916 +23 (+0.0%) 🔴
octane-tsrx pagecraft_esbuild_js_brotli 158,634 158,537 −97 (−0.1%) 🟢
octane-tsrx full_fw_raw 522,644 523,182 +538 (+0.1%) 🔴
octane-tsrx full_fw_gzip 163,487 163,699 +212 (+0.1%) 🔴
octane-tsrx full_fw_brotli 138,759 138,782 +23 (+0.0%) 🔴
octane-jsx full_fw_raw 522,644 523,182 +538 (+0.1%) 🔴
octane-jsx full_fw_gzip 163,487 163,699 +212 (+0.1%) 🔴
octane-jsx full_fw_brotli 138,759 138,782 +23 (+0.0%) 🔴

70 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
binding-base-ui-esbuild raw 198,236 198,263 +27 (+0.0%) 🔴
binding-base-ui-esbuild gzip 66,886 66,888 +2 (+0.0%) 🔴
binding-base-ui-esbuild brotli 58,754 58,684 −70 (−0.1%) 🟢
binding-radix-esbuild raw 197,719 197,746 +27 (+0.0%) 🔴
binding-radix-esbuild gzip 66,552 66,570 +18 (+0.0%) 🔴
binding-radix-esbuild brotli 58,410 58,459 +49 (+0.1%) 🔴
binding-apollo-client-vite raw 321,342 321,369 +27 (+0.0%) 🔴
binding-apollo-client-vite gzip 101,006 101,015 +9 (+0.0%) 🔴
binding-apollo-client-vite brotli 89,025 88,814 −211 (−0.2%) 🟢
binding-apollo-client-esbuild raw 350,072 350,099 +27 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 113,912 113,919 +7 (+0.0%) 🔴
binding-apollo-client-esbuild brotli 100,101 100,194 +93 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 25,059 25,018 −41 (−0.2%) 🟢

110 other measured values are unchanged.

@trueadm
trueadm merged commit a8ac6e2 into next Oct 15, 2026
31 of 32 checks passed
@trueadm
trueadm deleted the sync/main-into-next branch October 15, 2026 13:03
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 chore PR: tooling, dependencies, repo maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants