Skip to content

fix(octane): resolve a component's signal handles from its nested @{ … } blocks - #1761

Merged
trueadm merged 8 commits into
mainfrom
fix/nested-block-signal-owner
Oct 5, 2026
Merged

trueadm merged 8 commits into
mainfrom
fix/nested-block-signal-owner

Conversation

@trueadm

@trueadm trueadm commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A nested @{ … } block in a component's template now resolves the component's signal$, derived$ and query$ handles to the component's own cells, as directive arms and keyed @for rows already do. On main, each block got cells of its own. It started a second request for every query it read, in the browser and on the server, and it computed derived values from signals the component never updated. Follow-up to #1755, whose risk section flagged this.

export function App({ load }) @{
	const count$ = signal$(1);
	const source$ = query$(() => 'source', load);
	const label$ = derived$(() => count$.get() + source$.get());
	<section>
		<button onClick={() => count$.set(count$.get() + 1)}>…</button>
		@{
			const [tick, setTick] = useState(0);
			const read = label$.snapshot();
			<output>{read.status === 'ready' ? read.value : read.status}</output>
		}
	</section>
}

On main, load runs twice. After a click the block shows 1value while the component's count is 2. Hydration also refetches the block's read instead of resuming the server's result.

Size budgets: covered by #1773 (merged 2026-10-05), which raised budgets for this PR and the stacked children fix #1774. This PR grows every client bundle by about 162 raw bytes; #1760, the original budget PR, is now redundant.

Why

The contract is the paragraph in docs/signals.md that begins "Module declarations resolve to request-local cells…". It covers three cases:

  • Directive arms and keyed rows: these "are part of its template: a handle the component declares resolves to the component's cell wherever the template or a derived computation reads it".
  • Component identity: "Only authored component invocations shape that identity".
  • Closures: "A function the body creates closes over the body's declarations".

A nested block is not an authored component invocation. It closes over the body's declarations and renders at its sibling position, so it is part of the component's template. Arms and rows were linked to their component by #1530. Nested blocks were missed because the runtime renders them through the bare-function childSlot path, which stamped a structural instance (the legacy segment). An instance with its own key never received an enclosingOwner. #1706's __declared lowering only sees authored functions, and a child-position block is a JSXCodeBlock until compile time.

Changes

  • Client (runtime.ts):
    • childSlot stamps a render function rendered as a child with a new 't:' invocation site (TEMPLATE_INVOCATION_SITE). It does so only inside the existing signals-enabled branch. Compiled {children} keep the plain site: they belong to the template that authored them, not the component rendering them (see Risk).
    • scopeSignalOwner gives such an owner an enclosingOwner: the owner of the scope that rendered it. For a lightweight component, that is its scope rather than its DOM stand-in. The block keeps its own instance key, so it still owns, retires and resumes the declarations it evaluates.
  • Fragment renderers (client):
    • A renderer's owner now links to its parent's owner, including a renderer inside a nested block (JSX the block evaluates as a value). The key is checked before the t: site, so the renderer links to that block rather than past it. A renderer is a _frag$N, or the host-descriptor renderer, recognized as a scope whose instance key equals its structural parent's.
    • Without this link, a nested block in JSX that a non-root component returns still started a second query. The server already renders renderers in their component's owner, so this makes the client match.
  • Hookless components (client): a hookless component's blocks hang off a DOM stand-in, which has no owner of its own. When the link target is a stand-in, scopeSignalOwner finds the component's scope in the children of the parent the stand-in records. This replaces the guard that dropped the link, so arms inside a hookless component link the same way.
  • Server (runtime.server.ts):
    • Both bare-function paths (ssrChildValue, ssrDescriptorPart) use the same site, so instance keys stay identical to the client.
    • ssrComponent passes the owner it renders inside to the frame's new owner.
    • serverSignalQueryAttemptObserver already walks enclosingOwner, so a block's read of the component's query observes, and later resumes, under the component's key.
  • Docs: docs/signals.md adds nested @{ … } blocks, including one in returned JSX, to the template rule and to "owns only the declarations it evaluates".
  • Changeset: octane patch.

Validation

  • pnpm format:check: not run repo-wide. format:files:check passed on every changed file.
  • pnpm typecheck: not run repo-wide. typecheck:files passed on runtime.ts, runtime.server.ts and the test.
  • pnpm test: not run locally; CI runs it.
  • targeted: packages/octane/tests/hydration/signal-declaration-owner.test.ts, 121/121 in octane after merging main (e233e4a, including perf(octane): stop shipping the signal binding runtime in apps without signals #1762's opaque-hole gating). hydration/signal-instance-identity.test.ts, which perf(octane): stop shipping the signal binding runtime in apps without signals #1762 changed, also passes (290 tests across both files). Before the size trim, it also passed in octane-prod (prod and strong).
    • New frames shapes block and row block cover each existing case: one browser query for setup plus template reads; the server query resumed with a setup read, and with template reads only.
    • New cases:
      • the reported shape: duplicate load plus stale count;
      • block declarations scoped to the block inside an arm;
      • a handle prop read in a child's nested block, which pins the lightweight-component path;
      • a query the block declares itself, resumed from the server;
      • a nested block in returned JSX, at the root and below another component, on the client and through hydration;
      • a block nested in its block's value JSX, on the client and through hydration (Bugbot's finding);
      • a handle prop read in a hookless child's value JSX (Bugbot's second finding).
  • Fails on main: against main's runtime, 31 of the file's 121 tests fail in octane (dev). The same cases also fail in octane-prod.
  • Pinned by mutations: each of these fails a named subset of the new tests:
    • the block borrows its parent's owner;
    • the server keeps the legacy segment;
    • the server drops the enclosing owner;
    • the lightweight-component parent is removed;
    • the renderer link is removed;
    • a renderer inside a block is treated as a block (the original head).
  • Not distinguished: the lifetime half of "keeps nested block declarations scoped to the block" passes even if a block borrows its component's owner, because declaration lifetime follows the declaring scope. That case fails on main through its captured read.
  • Bundle size: about +162 raw / +48 to +68 gzip on client bundles, +159 raw on server-render. Budgets were raised by ci(bench): raise byte budgets for the children signal owner fix #1773; with main merged (e166793), both --budgets commands pass.

Risk / follow-ups

  • Children are unchanged and still have this defect. In <Card>{record$.get()}</Card>, the children read the parent's record$ in a cell of their own: a second query on both sides. The children's owner should link to the component that authored them, not the one rendering them, so this needs a separate fix: either a creator owner recorded by markChildrenBlock, or __declared lowering for children JSX.
  • Render functions passed as values. A render-prop () => @{ … } that another component renders as {props.render} now links to that rendering component, for any reads that are not lexical method calls. Its lexical method calls still use fix(octane): resolve a body's signal declarations from the functions it creates #1706's __declared. Separately, a query read only through __declared is not observed by the server's streamed selection, so hydration reports error 267.
  • Renderer owners now carry an enclosingOwner. This only changes how reads that resolve in a renderer's owner pick their cell.
  • Instance keys: the key segment for declarations inside a bare render function changes from legacy to t: on both sides. Keys are per build, so no persisted seed is affected.

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

Medium Risk
Changes signal instance keys and owner resolution across client SSR and hydration; behavior shift is broad but scoped to template nesting and covered by expanded tests.

Overview
Nested @{ … } blocks in a component template now read the parent component's signal$, derived$, and query$ handles from the component's cells, matching directive arms and keyed @for rows. Previously each block got its own cells, which caused duplicate query$ loads and stale derived values on the client, server, and during hydration.

The client and server runtimes introduce a t: template invocation site for child render functions (excluding compiled {children} blocks), wire enclosingOwner so reads resolve through the rendering template, and extend fragment renderer / hookless-component owner linking so nested blocks in returned or value-position JSX share one query. docs/signals.md documents the rule; hydration tests cover blocks, child props, and SSR resume.

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

… … }` 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]>
@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 11:59

@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.

Autofix Details

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

  • ✅ Fixed: Renderer skips nested block owner
    • In stampSignalInstanceKey, a renderer inside a TEMPLATE_INVOCATION_SITE scope now keeps the parent scope itself as signalInstanceParent instead of inheriting the parent's parent, so scopeSignalOwner walks through the nested block instead of skipping it.

Create PR

Or push these changes by commenting:

@cursor push 5687c6c987
Preview (5687c6c987)
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
@@ -965,9 +965,15 @@
 	}
 	// A renderer adds no key segment: it carries its parent's identity, and
 	// stays unstamped below an unstamped parent so keys walk on through it.
+	// When the parent is a template block (nested `@{ … }`), keep the block
+	// itself as the parent so scopeSignalOwner still walks through it.
 	const parent = key.parentScope;
 	const renderer = key.invocationSite === RENDERER_INVOCATION_SITE;
-	scope.signalInstanceParent = renderer ? parent.signalInstanceParent : parent;
+	scope.signalInstanceParent = renderer
+		? parent.signalInstanceSite === TEMPLATE_INVOCATION_SITE
+			? parent
+			: parent.signalInstanceParent
+		: parent;
 	scope.signalInstanceSite = renderer ? parent.signalInstanceSite : key.invocationSite;
 	scope.signalInstanceValue = renderer ? parent.signalInstanceValue : key.key;
 	scope.signalInstanceHasKey = renderer ? parent.signalInstanceHasKey : key.hasKey;

diff --git a/packages/octane/tests/hydration/signal-declaration-owner.test.ts b/packages/octane/tests/hydration/signal-declaration-owner.test.ts
--- a/packages/octane/tests/hydration/signal-declaration-owner.test.ts
+++ b/packages/octane/tests/hydration/signal-declaration-owner.test.ts
@@ -473,6 +473,42 @@
 		);
 	});
 
+	// A host descriptor inside a nested block creates a renderer. An inner
+	// nested block rendered through that host must still resolve the outer
+	// block's signals, not skip past the block to the component.
+	it.each(MODES)(
+		"reads the outer block's signal from an inner block through a host ($name)",
+		async ({ dev, strong }) => {
+			const view = await mountClient(
+				`import { query$, signal$ } from 'octane/signals';
+export function App(props) @{
+ const source$ = query$(() => 'source', props.load);
+ <section>
+  <output>{source$.snapshot().status as string}</output>
+  @{
+   const outer$ = signal$(0);
+   <div>
+    @{
+     const inner = source$.snapshot();
+     <p><output>{\`\${inner.status === 'ready' ? inner.value : inner.status}:\${outer$.get()}\`}</output></p>
+    }
+   </div>
+  }
+ </section>
+}`,
+				{ dev, strong },
+			);
+			try {
+				expect(view.requests).toHaveLength(1);
+				await view.settleAll('ready');
+				expect(view.texts()).toEqual(['ready', 'ready:0']);
+				expect(view.requests).toHaveLength(1);
+			} finally {
+				view.unmount();
+			}
+		},
+	);
+
 	// Returned JSX renders through a fragment renderer, which carries the
 	// instance of the component it renders for. A nested block inside it still
 	// reads that component's cells, at the root or below another component.

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

Comment thread packages/octane/src/runtime.ts Resolved
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 41 value(s) increased within budget
  • 🔴 bundle-reachability: 72 value(s) increased within budget

Compares 2aac5bb17, the merge commit's first parent with 470764f54 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 4.650 5.033 +6.8% −1.8% … +22.1% ⚪ within noise
octane-tsrx replace 13.225 12.783 +0.4% −4.5% … +6.6% ⚪ within noise
octane-tsrx add 4.167 3.975 −2.1% −9.3% … +15.9% ⚪ within noise
octane-tsrx update 0.217 0.202 −4.7% −13.5% … +4.0% ⚪ within noise
octane-tsrx select 0.009 0.009 +4.8% −4.0% … +14.0% ⚪ within noise
octane-tsrx swap 0.057 0.051 −3.0% −12.2% … +5.4% ⚪ within noise
octane-tsrx remove 0.028 0.030 +0.3% −6.0% … +9.8% ⚪ within noise
octane-tsrx runlots 40.275 38.108 −2.1% −10.5% … +3.3% ⚪ within noise
octane-tsrx select_lots 0.008 0.008 +6.6% +1.0% … +12.3% ⚪ within noise
octane-tsrx clear 55.458 52.975 −2.8% −8.5% … +1.3% ⚪ within noise
octane-jsx run 3.975 4.333 +2.4% −1.2% … +5.1% ⚪ within noise
octane-jsx replace 8.083 8.083 −1.2% −2.5% … +1.2% ⚪ within noise
octane-jsx add 3.708 3.508 −0.0% −2.8% … +0.0% ⚪ within noise
octane-jsx update 0.285 0.294 +0.7% −1.4% … +2.5% ⚪ within noise
octane-jsx select 0.152 0.152 +1.1% +0.3% … +2.8% ⚪ within noise
octane-jsx swap 0.274 0.270 −0.6% −6.9% … +1.8% ⚪ within noise
octane-jsx remove 0.209 0.217 +0.6% −1.5% … +6.2% ⚪ within noise
octane-jsx runlots 35.550 34.817 −1.8% −6.7% … +2.5% ⚪ within noise
octane-jsx select_lots 2.775 2.274 −5.4% −12.4% … +2.5% ⚪ within noise
octane-jsx clear 52.183 56.050 +6.3% −2.4% … +9.2% ⚪ within noise

All 64 work counters are unchanged.

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 120,210 120,372 +162 (+0.1%) 🔴
octane-tsrx js_gzip 39,749 39,805 +56 (+0.1%) 🔴
octane-tsrx js_brotli 35,116 35,193 +77 (+0.2%) 🔴
octane-tsrx app_gzip 2,435 2,434 −1 (−0.0%) 🟢
octane-tsrx app_brotli 2,127 2,125 −2 (−0.1%) 🟢
octane-tsrx fw_raw 113,075 113,237 +162 (+0.1%) 🔴
octane-tsrx fw_gzip 37,314 37,371 +57 (+0.2%) 🔴
octane-tsrx fw_brotli 32,989 33,068 +79 (+0.2%) 🔴
octane-tsrx todo_js_raw 130,931 131,093 +162 (+0.1%) 🔴
octane-tsrx todo_js_gzip 43,410 43,461 +51 (+0.1%) 🔴
octane-tsrx todo_js_brotli 38,147 38,198 +51 (+0.1%) 🔴
octane-tsrx todo_app_gzip 2,330 2,332 +2 (+0.1%) 🔴
octane-tsrx todo_fw_raw 126,120 126,282 +162 (+0.1%) 🔴
octane-tsrx todo_fw_gzip 41,080 41,129 +49 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 36,158 36,209 +51 (+0.1%) 🔴
octane-tsrx chat_js_raw 129,570 129,732 +162 (+0.1%) 🔴
octane-tsrx chat_js_gzip 43,126 43,169 +43 (+0.1%) 🔴
octane-tsrx chat_js_brotli 37,992 38,062 +70 (+0.2%) 🔴
octane-tsrx chat_app_gzip 2,769 2,768 −1 (−0.0%) 🟢
octane-tsrx chat_app_brotli 2,458 2,451 −7 (−0.3%) 🟢
octane-tsrx chat_fw_raw 123,580 123,742 +162 (+0.1%) 🔴
octane-tsrx chat_fw_gzip 40,357 40,401 +44 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 35,534 35,611 +77 (+0.2%) 🔴
octane-tsrx weather_js_raw 168,108 168,270 +162 (+0.1%) 🔴
octane-tsrx weather_js_gzip 55,385 55,446 +61 (+0.1%) 🔴
octane-tsrx weather_js_brotli 48,322 48,339 +17 (+0.0%) 🔴
octane-tsrx weather_app_gzip 8,110 8,109 −1 (−0.0%) 🟢
octane-tsrx weather_app_brotli 6,907 6,905 −2 (−0.0%) 🟢
octane-tsrx weather_fw_raw 145,370 145,532 +162 (+0.1%) 🔴
octane-tsrx weather_fw_gzip 47,275 47,337 +62 (+0.1%) 🔴
octane-tsrx weather_fw_brotli 41,415 41,434 +19 (+0.0%) 🔴
octane-tsrx bindings_js_raw 715,285 715,465 +180 (+0.0%) 🔴
octane-tsrx bindings_js_gzip 239,481 239,539 +58 (+0.0%) 🔴
octane-tsrx bindings_js_brotli 204,088 204,213 +125 (+0.1%) 🔴
octane-tsrx bindings_app_gzip 121,381 121,370 −11 (−0.0%) 🟢
octane-tsrx bindings_app_brotli 101,572 101,639 +67 (+0.1%) 🔴
octane-tsrx bindings_fw_raw 360,475 360,655 +180 (+0.0%) 🔴
octane-tsrx bindings_fw_gzip 118,100 118,169 +69 (+0.1%) 🔴
octane-tsrx bindings_fw_brotli 102,516 102,574 +58 (+0.1%) 🔴
octane-tsrx full_fw_raw 571,501 571,682 +181 (+0.0%) 🔴
octane-tsrx full_fw_gzip 175,058 175,136 +78 (+0.0%) 🔴
octane-tsrx full_fw_brotli 147,927 147,743 −184 (−0.1%) 🟢
octane-jsx js_raw 228,343 228,523 +180 (+0.1%) 🔴
octane-jsx js_gzip 72,989 73,054 +65 (+0.1%) 🔴
octane-jsx js_brotli 63,287 63,256 −31 (−0.0%) 🟢
octane-jsx app_brotli 2,497 2,499 +2 (+0.1%) 🔴
octane-jsx fw_raw 219,884 220,064 +180 (+0.1%) 🔴
octane-jsx fw_gzip 70,053 70,118 +65 (+0.1%) 🔴
octane-jsx fw_brotli 60,790 60,757 −33 (−0.1%) 🟢
octane-jsx full_fw_raw 571,501 571,682 +181 (+0.0%) 🔴
octane-jsx full_fw_gzip 175,058 175,136 +78 (+0.0%) 🔴
octane-jsx full_fw_brotli 147,927 147,743 −184 (−0.1%) 🟢

8 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
cli-spa-starter raw 108,944 109,106 +162 (+0.1%) 🔴
cli-spa-starter gzip 36,831 36,891 +60 (+0.2%) 🔴
cli-spa-starter brotli 32,241 32,350 +109 (+0.3%) 🔴
root-static-specialized raw 77,397 77,559 +162 (+0.2%) 🔴
root-static-specialized gzip 25,722 25,782 +60 (+0.2%) 🔴
root-static-specialized brotli 22,925 23,023 +98 (+0.4%) 🔴
root-chained-jsx raw 79,433 79,595 +162 (+0.2%) 🔴
root-chained-jsx gzip 26,269 26,329 +60 (+0.2%) 🔴
root-chained-jsx brotli 23,443 23,477 +34 (+0.1%) 🔴
root-static raw 204,566 204,746 +180 (+0.1%) 🔴
root-static gzip 65,149 65,219 +70 (+0.1%) 🔴
root-static brotli 56,509 56,538 +29 (+0.1%) 🔴
root-static-local raw 77,400 77,562 +162 (+0.2%) 🔴
root-static-local gzip 25,709 25,768 +59 (+0.2%) 🔴
root-static-local brotli 22,972 22,975 +3 (+0.0%) 🔴
hooks-state raw 89,460 89,622 +162 (+0.2%) 🔴
hooks-state gzip 29,727 29,785 +58 (+0.2%) 🔴
hooks-state brotli 26,446 26,497 +51 (+0.2%) 🔴
prop-attributes raw 89,939 90,101 +162 (+0.2%) 🔴
prop-attributes gzip 29,806 29,863 +57 (+0.2%) 🔴
prop-attributes brotli 26,484 26,590 +106 (+0.4%) 🔴
context raw 103,863 104,025 +162 (+0.2%) 🔴
context gzip 34,410 34,460 +50 (+0.1%) 🔴
context brotli 30,451 30,567 +116 (+0.4%) 🔴
hydrate-root raw 169,820 169,982 +162 (+0.1%) 🔴
hydrate-root gzip 53,830 53,889 +59 (+0.1%) 🔴
hydrate-root brotli 46,982 47,034 +52 (+0.1%) 🔴
deferred-hydration raw 233,337 233,499 +162 (+0.1%) 🔴
deferred-hydration gzip 73,759 73,820 +61 (+0.1%) 🔴
deferred-hydration brotli 63,672 63,690 +18 (+0.0%) 🔴
suspense-transition raw 160,316 160,478 +162 (+0.1%) 🔴
suspense-transition gzip 51,432 51,483 +51 (+0.1%) 🔴
suspense-transition brotli 45,055 45,187 +132 (+0.3%) 🔴
server-render raw 65,169 65,328 +159 (+0.2%) 🔴
server-render gzip 22,467 22,539 +72 (+0.3%) 🔴
server-render brotli 20,230 20,362 +132 (+0.7%) 🔴
component-owned-effects raw 81,913 82,075 +162 (+0.2%) 🔴
component-owned-effects gzip 27,004 27,053 +49 (+0.2%) 🔴
component-owned-effects brotli 24,075 24,126 +51 (+0.2%) 🔴
binding-hooks raw 87,976 88,138 +162 (+0.2%) 🔴
binding-hooks gzip 29,456 29,504 +48 (+0.2%) 🔴
binding-hooks brotli 26,212 26,261 +49 (+0.2%) 🔴
binding-base-ui-vite raw 214,826 215,006 +180 (+0.1%) 🔴
binding-base-ui-vite gzip 68,758 68,800 +42 (+0.1%) 🔴
binding-base-ui-vite brotli 59,572 59,676 +104 (+0.2%) 🔴
binding-base-ui-esbuild raw 212,768 212,944 +176 (+0.1%) 🔴
binding-base-ui-esbuild gzip 68,668 68,742 +74 (+0.1%) 🔴
binding-base-ui-esbuild brotli 59,529 59,692 +163 (+0.3%) 🔴
binding-aria-esbuild brotli 2,979 2,978 −1 (−0.0%) 🟢
binding-radix-vite raw 216,742 216,922 +180 (+0.1%) 🔴
binding-radix-vite gzip 69,292 69,361 +69 (+0.1%) 🔴
binding-radix-vite brotli 60,170 60,225 +55 (+0.1%) 🔴
binding-radix-esbuild raw 214,643 214,819 +176 (+0.1%) 🔴
binding-radix-esbuild gzip 69,275 69,326 +51 (+0.1%) 🔴
binding-radix-esbuild brotli 60,242 60,276 +34 (+0.1%) 🔴
binding-mantine-hooks-vite raw 91,280 91,442 +162 (+0.2%) 🔴
binding-mantine-hooks-vite gzip 30,289 30,339 +50 (+0.2%) 🔴
binding-mantine-hooks-vite brotli 26,922 27,008 +86 (+0.3%) 🔴
binding-mantine-hooks-esbuild raw 90,929 91,087 +158 (+0.2%) 🔴
binding-mantine-hooks-esbuild gzip 30,452 30,512 +60 (+0.2%) 🔴
binding-mantine-hooks-esbuild brotli 27,104 27,199 +95 (+0.4%) 🔴
binding-apollo-client-vite raw 359,793 359,973 +180 (+0.1%) 🔴
binding-apollo-client-vite gzip 112,786 112,857 +71 (+0.1%) 🔴
binding-apollo-client-vite brotli 98,422 98,552 +130 (+0.1%) 🔴
binding-apollo-client-esbuild raw 362,722 362,899 +177 (+0.0%) 🔴
binding-apollo-client-esbuild gzip 115,028 115,115 +87 (+0.1%) 🔴
binding-apollo-client-esbuild brotli 100,203 100,265 +62 (+0.1%) 🔴
binding-usehooks-ts-vite raw 92,061 92,223 +162 (+0.2%) 🔴
binding-usehooks-ts-vite gzip 30,535 30,595 +60 (+0.2%) 🔴
binding-usehooks-ts-vite brotli 27,181 27,260 +79 (+0.3%) 🔴
binding-usehooks-ts-esbuild raw 91,695 91,853 +158 (+0.2%) 🔴
binding-usehooks-ts-esbuild gzip 30,669 30,719 +50 (+0.2%) 🔴
binding-usehooks-ts-esbuild brotli 27,321 27,390 +69 (+0.3%) 🔴

32 other measured values are unchanged.

trueadm and others added 4 commits October 5, 2026 13:12
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]>

@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: Lite renderer drops enclosing owner
    • Added a liteScope back-reference on LiteBlockImpl so that scopeSignalOwner can resolve through the stand-in to the owning scope when a renderer's parentBlock is a LiteBlockImpl, instead of dropping the enclosingOwner link.

Create PR

Or push these changes by commenting:

@cursor push b0867e403b
Preview (b0867e403b)
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
@@ -1131,6 +1131,8 @@
 					scope.signalInstanceSite === TEMPLATE_INVOCATION_SITE ? scope.signalInstanceParent : null;
 			if (parent !== null && !(parent instanceof LiteBlockImpl))
 				identity.enclosingOwner = scopeSignalOwner(parent) as SignalRendererOwnerIdentity;
+			else if (parent instanceof LiteBlockImpl)
+				identity.enclosingOwner = scopeSignalOwner(parent.liteScope) as SignalRendererOwnerIdentity;
 			// A retry owner must not keep an abandoned renderer tree alive. This
 			// existing opaque identity object is also its own facade-state token.
 			identity.instanceOwner = identity;
@@ -11849,8 +11851,13 @@
 	declare signalInstanceValue: unknown;
 	declare signalInstanceHasKey: boolean;
 	declare signalInstanceResolved: string | undefined;
+	// Back-reference to the lite scope whose block this stand-in is. A renderer
+	// child's parentBlock is this stand-in, and scopeSignalOwner needs the scope
+	// to resolve the enclosing owner (the lite scope is not reachable from the
+	// parentBlock chain alone).
+	declare liteScope: Scope;
 
-	constructor(parentNode: Node, endMarker: Node | null, parentBlock: Block) {
+	constructor(parentNode: Node, endMarker: Node | null, parentBlock: Block, liteScope: Scope) {
 		this.parentNode = parentNode;
 		this.endMarker = endMarker;
 		this.parentBlock = parentBlock;
@@ -11862,6 +11869,7 @@
 		this.signalInstanceValue = undefined;
 		this.signalInstanceHasKey = false;
 		this.signalInstanceResolved = undefined;
+		this.liteScope = liteScope;
 	}
 }
 
@@ -11980,7 +11988,7 @@
 				endMarker = hydration.parkAtHole((inPlace = anchor));
 			}
 		}
-		scope.block = new LiteBlockImpl(host, endMarker, parentScope.block) as unknown as Block;
+		scope.block = new LiteBlockImpl(host, endMarker, parentScope.block, scope) as unknown as Block;
 		stampSignalInstance(scope, parentScope, invocationSite);
 		if (adoptedOpen !== null && adoptedClose !== null) {
 			hydration!.liteRanges.set(scope, {

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

Reviewed by Cursor Bugbot for commit f5f44d5. Configure here.

Comment thread packages/octane/src/runtime.ts Resolved
…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]>
trueadm added a commit that referenced this pull request Oct 5, 2026
#1761 now resolves a hookless component's scope from its DOM stand-in, so a
renderer the component renders links to it: 75 more raw bytes in client
owner creation. Only raised values; no budget is lowered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 5, 2026
…rement

The CI runner measures #1761's bindings app at 204,213 total brotli bytes,
6 over the committed budget. The local measurement fits, because brotli
output differs slightly between environments; raw and gzip match exactly.
Set it to CI's measurement + 256.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 6:35pm UTC
octane-website-mcp Skipped Skipped Oct 5, 2026 6:35pm UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website October 5, 2026 18:35 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp October 5, 2026 18:35 Inactive
@trueadm
trueadm merged commit 9c84293 into main Oct 5, 2026
57 of 60 checks passed
@trueadm
trueadm deleted the fix/nested-block-signal-owner branch October 5, 2026 20:39
trueadm added a commit that referenced this pull request Oct 5, 2026
#1761 (#1793)

#1782 measured the #1764 fix on its own, and #1760 measured #1761 on its
own. With #1761 now on main, adding the fix overruns 47 budgets by up to
about 135 raw bytes. Each value is measured on main 9c84293 with the fix
applied, plus the standard headroom.

Co-authored-by: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 5, 2026
Budgets move by the measured esbuild-to-Oxc difference on the same
source (budget - max(0, esbuild - oxc)), so the methodology change
lowers 131 values, keeps 28, raises none, and leaves the headroom #1782
granted to #1783 in place. The baseline, ratio guards and website
summary are recomputed from the merged source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm added a commit that referenced this pull request Oct 6, 2026
* ci(bench): measure bundle sizes with Vite 8's default minifier

The bundle-size and bundle-reachability harnesses forced Vite's
`minify: 'esbuild'`. That mode turns Rolldown's own minifier off, and with
it the dead-code elimination that removes branches guarded by a
never-written module flag, so the numbers were not what a Vite app ships.

- run.mjs builds every framework with `minify: 'oxc'` (Vite 8's default
  client minifier), still identical settings for every target.
- run-minimal.mjs builds its Vite scenarios with `'oxc'`; the esbuild
  bundler scenarios keep esbuild's `minify: true`. The async-identity
  encoder check accepts Oxc's template-literal quotes.
- Every budget is ratcheted down (144 lowered, 15 unchanged, 0 raised),
  the bundle-size baseline is re-recorded, the 18 cross-framework ratio
  guards are re-cut, and the website summary and copy follow.

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

* ci(bench): re-measure the Oxc budgets on main with #1761 and #1782

Budgets move by the measured esbuild-to-Oxc difference on the same
source (budget - max(0, esbuild - oxc)), so the methodology change
lowers 131 values, keeps 28, raises none, and leaves the headroom #1782
granted to #1783 in place. The baseline, ratio guards and website
summary are recomputed from the merged source.

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

* test(website): compare home summary ceilings at stable precision

The smoke test rounds each summary row to 15 significant digits because
Math.log/exp can differ by one ULP between libc implementations, but it
compared the bundle-size range ends exactly. Those ends are geometric
means too: the recorded Solid ceiling was 0.9500824085923075 on macOS and
0.9500824085923076 on the Linux runner. Round them the same way.

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

* ci(bench): re-derive the Oxc budgets on main with #1766, #1768, #1770, #1772 and #1794

Same method as before: each budget is main's value minus the measured
esbuild-to-Oxc difference on the merged source, never raised (131
lowered, 28 unchanged). The baseline record and home summary follow the
new bytes; every ratio guard still holds with the ceilings already cut.

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

* ci(bench): re-derive the Oxc budgets on main with #1783

#1783 landed and spent the headroom #1782/#1793/#1794 granted it. Each
budget is again main's value minus the measured esbuild-to-Oxc
difference on the merged source (131 lowered, 28 unchanged, none
raised). The baseline record, home summary and refresh note follow.

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

* ci(bench): re-cut the cross-framework ratio guards after #1784

With #1784's hydrating flag folded by Oxc, Octane's totals shrink 8.5-10%
instead of about 5%, so the total-gzip ceilings had grown about 6% loose.
They are re-cut at about 1.5% headroom on the merged-source measurement;
application-code ceilings are unchanged. All 72 bundle-size guards hold.

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 — e1667937 Deployed Oct 5, 2026 by vercel[bot]
Preview – octane-website-mcp — e1667937 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