Skip to content

feat(islands): renderer-free island activation and islands-only routes - #1582

Merged
trueadm merged 4 commits into
mainfrom
feat/renderer-free-islands
Oct 2, 2026
Merged

trueadm merged 4 commits into
mainfrom
feat/renderer-free-islands

Conversation

@trueadm

@trueadm trueadm commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes #1514. Step 2 (zero-argument views) landed in #1568; this PR finishes steps 3–6. Pages whose interactive parts are signal-driven islands now activate those islands without the renderer, and a route can opt out of hydrating its shell.

Step What it does
3. Subscribed reads A binding view may read imported signals with x$.get() / x$.latest(fallback) in attributes, text, @if tests, @for items and block const declarations. The program subscribes to every source a preparation read and prepares again when one changes. The former #308 activation diagnostic now applies only where no program can subscribe (fixed scalar views, module-scope reads).
4. Mount-only effects useLayoutEffect(cb, []) / useEffect(cb, []) in a view's setup run once after activation, children before parents, under the program's signal owner. Their cleanup runs when the view leaves or the program is disposed.
5. @try in binding programs A new try region: a thrown thenable selects @pending, any other error selects @catch. @catch is sticky until its deferred reset runs, matching the renderer. Activation adopts whichever arm the server rendered, including a streamed swap. A boundary still streaming at activation is claimed, so its late segment can't replace live DOM.
6a. Renderer-free activation An independent <Hydrate> whose only child is a prop-less component imported from a project .tsrx module asks that module for its activator (?octane-island=). A zero-argument 'use dom bindings' view answers with __createBindingIslandActivator, which adopts the island's range and replays captured input. Any other component forwards to the unchanged renderer island module through a static re-export, so it pays no extra request.
6b. Islands-only routes new RenderRoute({ …, hydrate: 'islands' }) serves the same document with a second, renderer-free bootstrap (virtual:octane-islands). That entry handles capture, streamed signals, the document lifecycle, island registration, then preHydrate. The shell keeps its CSS but its page chunk is never preloaded.

Build check for islands mode. The build fails closed when the shell needs client work. That covers hooks, handlers, refs, controlled values, ordinary <Hydrate>, @try, signal reads and handle bindings, spreads, uncheckable components, and root boundaries. It also fails when the islands entry or preHydrate can reach the renderer. Rsbuild refuses the option for now.

Signal-chat pilot. Both routes are islands-only and all five islands are binding views. Metrics and the composer's ready flag moved to signals.

gzip-9, per script main @ 02e4eb0 this PR, islands route
Client JS on the page 160,586 B (156.8 KiB) 71,124 B (69.5 KiB), 18 scripts, every island activated
Renderer chunk 98,222 B, loaded not loaded

That is −56%, inside the issue's 70 KiB ceiling. The KiB unit matches the issue's baseline: its "156.4 KB" is this same main build. The new e2e journey enforces the ceiling.

Two runtime fixes found by the pilot:

  • Owner retirement: retiring a document's signal owner on pagehide notified live bindings synchronously, before islands were disposed, and threw ScopeDisposedError Version Packages #151. A committed binding now treats that as the end of its data and stops quietly with its last DOM. This also covers plain step-2 views over module signals.
  • Replay events: cloneHydrationReplayEvent moved out of runtime.ts into hydration/replay-event.ts, so the renderer-free activator can replay events without the renderer.

Decisions taken from the earlier plan

  1. Pending or failed read outside @try: keep the last DOM and stay subscribed. A failure before the first commit throws from activation. A later failure goes to reportError.
  2. ready flag: moved to a module signal set by the mount effect, rather than lowering useState or treating ready as a constant. useState stays a diagnostic in binding views.
  3. Island selection: automatic, through the child view's own module, with a renderer fallback.
  4. Islands-only mode: two entries, opted into per route with hydrate: 'islands', Vite-only. The original plan proposed two PRs (6a and 6b); this one PR delivers both.
  5. Metrics: rewritten on signals.

Validation

  • pnpm format:check: not run repo-wide. pnpm format:files ran on every changed file.
  • pnpm typecheck: not run in full. Clean: typecheck:files on every changed TypeScript file in packages/octane/src, plus octane-tsc for app-core, vite-plugin-octane, rsbuild-plugin-octane and examples/signal-chat.
  • pnpm test: not run in full; CI runs it.
  • targeted tests, after rebasing on main:
    • octane project: 12 files, 538 tests. Covers behavior-root, hydration/independent-island*, independent-parent, early-independent-intent, compiler/islands-shell, binding-handoff, scalar-dom-bindings, streaming-ssr, suspense-hydrate and range-boundary.
    • vite-plugin: islands-route and production, 22 tests. Before the rebase, plugin, render-route and dev-build-metadata also passed (45 tests).
    • node --test benchmarks/scoped-signals/bundle-boundaries.test.mjs: 33 pass. benchmarks/bundle-size/minimal-gates.test.mjs: 6 pass.
    • rsbuild-plugin: the new islands refusal test.
    • signal-chat Playwright: production preview 14/14, including the new budget journey; dev server 13/13. The budget journey lives in e2e/islands-budget.spec.ts, which the Playwright config loads only for the production preview.
  • Mutation checks: I broke each guarded behaviour and the matching tests failed. The behaviours: read collection, mount effects, the sticky catch, the streamed-boundary claim, reuse of an adopted catch arm, owner retirement, island selection, the per-route template swap, the shell check, and the renderer-reachability check.

Bundle cost for existing binding views. @try support, mount effects and the read tracker are compiler-selected capabilities, like list, so programs that don't use them don't carry them. What remains in the lean structural adopter is the glue plus the retirement fix every program needs: +327 B gzip (8,694 → 9,021, esbuild, minified, gzip-9). Scalar views are unchanged (3,418 → 3,424).

Renderer cost. The renderer has to treat a @try binding range as balanced: y0–y2 in server HTML, and a bare y in a binding view's client template before the region selects an arm. One guarded regular-expression test in isBindingOpenComment does this. It costs 49 raw bytes in root-chained-jsx (85,938 → 85,987; gzip-9 28,504 → 28,534; brotli 25,309 → 25,327). Its committed budget rises to 86,016 / 28,544 / 25,344, because main sat 14 raw bytes under the old one. The other budgeted scenarios stay within their budgets.

Risk / follow-ups

  • Islands-only mode is an author opt-in with a conservative build check, not a proof. Automatic shell inertness, a none mode, client navigation into an islands-only route, and Rsbuild support remain proposed in docs/hydration-islands-plan.md.
  • Captured input during a suspended activation. A binding island whose first preparation suspends outside @try keeps its server DOM. Its handlers are not installed until data arrives, so input captured before activation is replayed with no listener and is lost.
  • Custom signal owners. Delegated binding handlers still run without restoring a custom signal owner (a pre-existing step-2 limitation). Islands should keep their state in module or document signals.
  • Thin budget margin. The signal-chat islands page sits 556 B under the 70 KiB budget, so unrelated growth in shared code could fail the new e2e journey.
  • Pre-existing renderer behaviour, not changed here. The ordinary renderer reports a hydration mismatch in dev when it hydrates a buffered (renderToString) @try pending fallback while the client read is still pending. This happens with or without 'use dom bindings'.

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 hydration/bootstrap, compiler-selected island activators, and binding runtime semantics (subscribed reads, @Try, lifecycle); build-time shell checks are conservative but misclassification could break islands-only pages or leave interactive shell code unloaded.

Overview
This PR finishes renderer-free independent island activation and adds an explicit hydrate: 'islands' route mode so the server shell never loads the Octane renderer.

DOM binding programs gain subscribed imported reads (count$.get() / .latest()), @try/@pending/@catch (including streamed-boundary claim and server arm adoption), block const declarations, and mount-only useLayoutEffect/useEffect with []. Retiring the signal owner ends programs quietly instead of throwing. An independent <Hydrate> whose only child is a prop-less 'use dom bindings' view from a project .tsrx module activates via __createBindingIslandActivator and a compiler ?octane-island= indirection; other islands still load the renderer chunk.

App bootstrap adds create_islands_entry_source (virtual:octane-islands): shared prelude with the full hydrate entry, but no hydrateRoot or route/layout import. Production serves islands routes with a swapped bootstrap script, skips page-chunk modulepreload, and analyzeIslandsShell fails the Vite build when the shell needs hooks, handlers, signals, ordinary Hydrate, etc.

signal-chat is the pilot (both routes islands-only, panels on bindings); a production Playwright spec enforces no renderer/runtime hydrate chunks and a 70 KiB gzip-9 JS budget. Replay event cloning moves to hydration/replay-event.ts so the binding activator does not import the renderer.

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

Binding programs subscribe to imported signal reads, run mount-only effects,
and lower @try/@pending/@catch, so whole islands compile as binding views. An
independent island whose only child is a zero-argument binding view activates
through that view's program without the renderer, and RenderRoute's
hydrate: 'islands' serves the server-rendered shell with a renderer-free
bootstrap. signal-chat runs islands-only.

Closes #1514

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm marked this pull request as ready for review October 2, 2026 17:35
@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability labels Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark report

  • 🔴 bundle-size: 28 value(s) increased
  • 🔴 bundle-reachability: 36 value(s) increased

Compares 02e4eb0ac with 26ce0aa26 on the same runner. Timing verdicts require a change beyond the combined margin of error (at least 5%) and one 0.1ms timer tick, with the fastest sample also moving beyond that margin. Workflow run

js-framework: 1k/10k row operations (ms, lower is better)

All 20 timed operations (20 within noise)
target operation base head Δ noise
octane-tsrx run 4.41 4.26 −3.4% ±34% ⚪ within noise
octane-tsrx replace 9.83 9.15 −6.9% ±33% ⚪ within noise
octane-tsrx add 4.20 3.98 −5.2% ±24% ⚪ within noise
octane-tsrx update 0.64 0.59 −7.8% ±73% ⚪ within noise
octane-tsrx select 0.22 0.22 +0.0% ±38% ⚪ within noise
octane-tsrx swap 0.48 0.56 +16.7% ±28% ⚪ within noise
octane-tsrx remove 0.49 0.52 +6.1% ±39% ⚪ within noise
octane-tsrx runlots 36.45 38.45 +5.5% ±15% ⚪ within noise
octane-tsrx select_lots 0.25 0.28 +12.0% ±52% ⚪ within noise
octane-tsrx clear 45.87 49.06 +7.0% ±26% ⚪ within noise
octane-jsx run 4.03 4.40 +9.2% ±22% ⚪ within noise
octane-jsx replace 9.87 10.60 +7.4% ±22% ⚪ within noise
octane-jsx add 3.60 3.98 +10.6% ±21% ⚪ within noise
octane-jsx update 0.66 0.83 +25.8% ±51% ⚪ within noise
octane-jsx select 0.45 0.51 +13.3% ±53% ⚪ within noise
octane-jsx swap 0.86 0.87 +1.2% ±66% ⚪ within noise
octane-jsx remove 0.79 0.88 +11.4% ±43% ⚪ within noise
octane-jsx runlots 33.44 36.56 +9.3% ±15% ⚪ within noise
octane-jsx select_lots 2.69 2.90 +7.8% ±27% ⚪ within noise
octane-jsx clear 48.93 49.55 +1.3% ±24% ⚪ within noise

Application bundle size (bytes)

target metric base head Δ
octane-tsrx js_raw 126,733 126,782 +49 (+0.0%) 🔴
octane-tsrx js_gzip 41,933 41,957 +24 (+0.1%) 🔴
octane-tsrx js_brotli 36,926 36,941 +15 (+0.0%) 🔴
octane-tsrx app_gzip 2,563 2,562 −1 (−0.0%) 🟢
octane-tsrx app_brotli 2,226 2,224 −2 (−0.1%) 🟢
octane-tsrx fw_raw 119,221 119,270 +49 (+0.0%) 🔴
octane-tsrx fw_gzip 39,370 39,395 +25 (+0.1%) 🔴
octane-tsrx fw_brotli 34,700 34,717 +17 (+0.0%) 🔴
octane-tsrx todo_js_raw 141,632 141,681 +49 (+0.0%) 🔴
octane-tsrx todo_js_gzip 46,754 46,781 +27 (+0.1%) 🔴
octane-tsrx todo_js_brotli 40,931 40,979 +48 (+0.1%) 🔴
octane-tsrx todo_app_gzip 2,476 2,477 +1 (+0.0%) 🔴
octane-tsrx todo_app_brotli 2,119 2,116 −3 (−0.1%) 🟢
octane-tsrx todo_fw_raw 136,522 136,571 +49 (+0.0%) 🔴
octane-tsrx todo_fw_gzip 44,278 44,304 +26 (+0.1%) 🔴
octane-tsrx todo_fw_brotli 38,812 38,863 +51 (+0.1%) 🔴
octane-tsrx chat_js_raw 140,877 140,926 +49 (+0.0%) 🔴
octane-tsrx chat_js_gzip 46,731 46,756 +25 (+0.1%) 🔴
octane-tsrx chat_js_brotli 40,996 41,070 +74 (+0.2%) 🔴
octane-tsrx chat_app_gzip 2,978 2,979 +1 (+0.0%) 🔴
octane-tsrx chat_app_brotli 2,633 2,638 +5 (+0.2%) 🔴
octane-tsrx chat_fw_raw 134,224 134,273 +49 (+0.0%) 🔴
octane-tsrx chat_fw_gzip 43,753 43,777 +24 (+0.1%) 🔴
octane-tsrx chat_fw_brotli 38,363 38,432 +69 (+0.2%) 🔴
octane-tsrx weather_js_raw 177,447 177,496 +49 (+0.0%) 🔴
octane-tsrx weather_js_gzip 58,013 58,036 +23 (+0.0%) 🔴
octane-tsrx weather_js_brotli 50,370 50,503 +133 (+0.3%) 🔴
octane-tsrx weather_app_brotli 7,582 7,596 +14 (+0.2%) 🔴
octane-tsrx weather_fw_raw 150,712 150,761 +49 (+0.0%) 🔴
octane-tsrx weather_fw_gzip 48,968 48,991 +23 (+0.0%) 🔴
octane-tsrx weather_fw_brotli 42,788 42,907 +119 (+0.3%) 🔴

14 other measured values are unchanged.

Public-import reachability bundles (bytes)

target metric base head Δ
capture-only raw 11,357 11,406 +49 (+0.4%) 🔴
capture-only gzip 4,360 4,388 +28 (+0.6%) 🔴
capture-only brotli 3,898 3,924 +26 (+0.7%) 🔴
cli-spa-starter raw 116,425 116,474 +49 (+0.0%) 🔴
cli-spa-starter gzip 39,304 39,331 +27 (+0.1%) 🔴
cli-spa-starter brotli 34,306 34,341 +35 (+0.1%) 🔴
root-chained-jsx raw 85,938 85,987 +49 (+0.1%) 🔴
root-chained-jsx gzip 28,504 28,534 +30 (+0.1%) 🔴
root-chained-jsx brotli 25,309 25,327 +18 (+0.1%) 🔴
prop-attributes raw 97,390 97,439 +49 (+0.1%) 🔴
prop-attributes gzip 32,371 32,398 +27 (+0.1%) 🔴
prop-attributes brotli 28,719 28,721 +2 (+0.0%) 🔴
context raw 110,283 110,332 +49 (+0.0%) 🔴
context gzip 36,508 36,532 +24 (+0.1%) 🔴
context brotli 32,306 32,326 +20 (+0.1%) 🔴
hydrate-root raw 164,499 164,548 +49 (+0.0%) 🔴
hydrate-root gzip 52,553 52,577 +24 (+0.0%) 🔴
hydrate-root brotli 45,699 45,706 +7 (+0.0%) 🔴
deferred-hydration raw 227,262 227,315 +53 (+0.0%) 🔴
deferred-hydration gzip 72,179 72,192 +13 (+0.0%) 🔴
deferred-hydration brotli 62,238 62,325 +87 (+0.1%) 🔴
suspense-transition raw 166,795 166,840 +45 (+0.0%) 🔴
suspense-transition gzip 53,606 53,631 +25 (+0.0%) 🔴
suspense-transition brotli 46,785 46,835 +50 (+0.1%) 🔴
binding-mantine-hooks-vite raw 98,025 98,074 +49 (+0.0%) 🔴
binding-mantine-hooks-vite gzip 32,594 32,623 +29 (+0.1%) 🔴
binding-mantine-hooks-vite brotli 28,959 28,970 +11 (+0.0%) 🔴
binding-mantine-hooks-esbuild raw 97,615 97,664 +49 (+0.1%) 🔴
binding-mantine-hooks-esbuild gzip 32,770 32,798 +28 (+0.1%) 🔴
binding-mantine-hooks-esbuild brotli 29,066 29,110 +44 (+0.2%) 🔴
binding-usehooks-ts-vite raw 98,658 98,707 +49 (+0.0%) 🔴
binding-usehooks-ts-vite gzip 32,745 32,771 +26 (+0.1%) 🔴
binding-usehooks-ts-vite brotli 29,089 29,140 +51 (+0.2%) 🔴
binding-usehooks-ts-esbuild raw 98,237 98,286 +49 (+0.0%) 🔴
binding-usehooks-ts-esbuild gzip 32,921 32,945 +24 (+0.1%) 🔴
binding-usehooks-ts-esbuild brotli 29,220 29,226 +6 (+0.0%) 🔴

69 other measured values are unchanged.

@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 3 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: Shell check skips independent={false} Hydrate
    • The attribute check now inspects the value—bare independent and independent={true} return early as independent islands, while independent={false} correctly falls through to report an ordinary Hydrate that needs the renderer.
  • ✅ Fixed: Shell check misses non-function exports
    • The root-seeding loop now resolves export { Name } re-export specifiers, export default Identifier references, and export const Name = function/arrow VariableDeclaration inits to their function bodies, so the walk covers all export forms.
  • ✅ Fixed: Shell check misses wrapped signal reads
    • Signal-read detection now matches OptionalCallExpression alongside CallExpression, peels TYPE_WRAPPERS on the callee before checking for MemberExpression/OptionalMemberExpression, and the controlled value/checked literal test also unwraps TS wrappers before the Literal comparison.

Create PR

Or push these changes by commenting:

@cursor push a08aa9b7d8
Preview (a08aa9b7d8)
diff --git a/packages/octane/src/compiler/islands-shell.js b/packages/octane/src/compiler/islands-shell.js
--- a/packages/octane/src/compiler/islands-shell.js
+++ b/packages/octane/src/compiler/islands-shell.js
@@ -83,7 +83,36 @@
 			functions.set(declaration.id.name, declaration);
 			const name = statement.type === 'ExportDefaultDeclaration' ? 'default' : declaration.id.name;
 			if (exported && (exports === null || exports.includes(name))) roots.push(declaration);
+		} else if (exported && declaration?.type === 'VariableDeclaration') {
+			for (const declarator of declaration.declarations ?? []) {
+				const init = declarator.init;
+				if (
+					declarator.id?.type === 'Identifier' &&
+					init &&
+					(init.type === 'FunctionExpression' || init.type === 'ArrowFunctionExpression')
+				) {
+					functions.set(declarator.id.name, init);
+					if (exports === null || exports.includes(declarator.id.name)) roots.push(init);
+				}
+			}
 		}
+		if (statement.type === 'ExportNamedDeclaration') {
+			for (const specifier of statement.specifiers ?? []) {
+				if (specifier.exportKind === 'type') continue;
+				const exportedName = specifier.exported?.name ?? specifier.exported?.value;
+				if (exports !== null && !exports.includes(exportedName)) continue;
+				const fn = functions.get(specifier.local?.name);
+				if (fn) roots.push(fn);
+			}
+		} else if (
+			statement.type === 'ExportDefaultDeclaration' &&
+			declaration?.type === 'Identifier'
+		) {
+			if (exports === null || exports.includes('default')) {
+				const fn = functions.get(declaration.name);
+				if (fn) roots.push(fn);
+			}
+		}
 	}
 	const problems = [];
 	const components = new Map();
@@ -107,7 +136,21 @@
 			const attributes = opening.attributes ?? [];
 			if (tag !== null && octane(tag, 'Hydrate')) {
 				// An independent island activates on its own; it is not shell work.
-				if (attributes.some((attribute) => attributeName(attribute) === 'independent')) return;
+				// Bare `independent` and `independent={true}` are independent;
+				// `independent={false}` is an ordinary boundary that needs the renderer.
+				if (
+					attributes.some((attribute) => {
+						if (attributeName(attribute) !== 'independent') return false;
+						if (attribute.value == null) return true;
+						let expr =
+							attribute.value.type === 'JSXExpressionContainer'
+								? attribute.value.expression
+								: attribute.value;
+						while (TYPE_WRAPPERS.has(expr?.type)) expr = expr.expression;
+						return !(expr?.type === 'Literal' && expr.value === false);
+					})
+				)
+					return;
 				report(node, 'an ordinary <Hydrate> needs the renderer to hydrate its children');
 			} else if (tag !== null && /^[A-Z]/.test(tag) && !octane(tag, 'Fragment')) {
 				const local = functions.get(tag);
@@ -137,10 +180,13 @@
 				else if (
 					(name === 'value' || name === 'checked') &&
 					CONTROLLED.has(tag ?? '') &&
-					attribute.value?.type === 'JSXExpressionContainer' &&
-					attribute.value.expression.type !== 'Literal'
-				)
-					report(attribute, `a controlled ${JSON.stringify(name)} needs the renderer`);
+					attribute.value?.type === 'JSXExpressionContainer'
+				) {
+					let expr = attribute.value.expression;
+					while (TYPE_WRAPPERS.has(expr?.type)) expr = expr.expression;
+					if (expr?.type !== 'Literal')
+						report(attribute, `a controlled ${JSON.stringify(name)} needs the renderer`);
+				}
 			}
 		} else if (node.type === 'JSXTryExpression' || node.type === 'TryStatement') {
 			report(node, '@try recovery needs the renderer; move it into an independent island');
@@ -149,11 +195,16 @@
 			/\$$/.test(nameOf(node.expression) ?? '')
 		) {
 			report(node, 'a signal handle binding needs client code the shell never loads');
-		} else if (node.type === 'CallExpression') {
+		} else if (node.type === 'CallExpression' || node.type === 'OptionalCallExpression') {
 			const callee = node.callee;
 			const name = nameOf(callee);
+			let peeled = callee;
+			while (TYPE_WRAPPERS.has(peeled?.type)) peeled = peeled.expression;
 			const member =
-				callee?.type === 'MemberExpression' && !callee.computed ? callee.property.name : null;
+				(peeled?.type === 'MemberExpression' || peeled?.type === 'OptionalMemberExpression') &&
+				!peeled.computed
+					? peeled.property.name
+					: null;
 			if (name !== null && /^use(?:[A-Z0-9_]|$)/.test(name))
 				report(node, `hook ${name}() needs the renderer`);
 			else if (name !== null && SIGNAL_DECLARATIONS.has(name))

diff --git a/packages/octane/tests/compiler/islands-shell.test.ts b/packages/octane/tests/compiler/islands-shell.test.ts
--- a/packages/octane/tests/compiler/islands-shell.test.ts
+++ b/packages/octane/tests/compiler/islands-shell.test.ts
@@ -64,4 +64,59 @@
 		expect(analyzeIslandsShell(source, '/src/Page.tsrx', ['Uses']).problems[0].line).toBe(2);
 		expect(analyzeIslandsShell(source, '/src/Page.tsrx', null).problems).toHaveLength(2);
 	});
+
+	it('rejects independent={false} Hydrate as ordinary shell work', () => {
+		const { problems } = analyzeIslandsShell(
+			shell('<Hydrate independent={false} when={interaction()}><Island /></Hydrate>'),
+			'/src/Page.tsrx',
+		);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/ordinary <Hydrate>/);
+	});
+
+	it('accepts independent={true} Hydrate', () => {
+		const { problems } = analyzeIslandsShell(
+			shell('<Hydrate independent={true} when={interaction()}><Island /></Hydrate>'),
+			'/src/Page.tsrx',
+		);
+		expect(problems).toEqual([]);
+	});
+
+	it('checks exports authored as export { Name }', () => {
+		const source = `import { Hydrate } from 'octane';
+function App() @{ <button onClick={() => {}}>Click</button> }
+export { App }`;
+		const { problems } = analyzeIslandsShell(source, '/src/Page.tsrx', ['App']);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/"onClick" needs client code/);
+	});
+
+	it('checks exports authored as export default Identifier', () => {
+		const source = `import { Hydrate } from 'octane';
+function App() @{ <button onClick={() => {}}>Click</button> }
+export default App`;
+		const { problems } = analyzeIslandsShell(source, '/src/Page.tsrx', ['default']);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/"onClick" needs client code/);
+	});
+
+	it('checks exports authored as export const Name = arrow', () => {
+		const source = `import { Hydrate } from 'octane';
+export const App = (props) => @{ <button onClick={() => {}}>Click</button> }`;
+		const { problems } = analyzeIslandsShell(source, '/src/Page.tsrx', ['App']);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/"onClick" needs client code/);
+	});
+
+	it('rejects an optional signal read like count$?.get()', () => {
+		const { problems } = analyzeIslandsShell(
+			shell('<p>{String(count$?.get()) as string}</p>'),
+			'/src/Page.tsrx',
+		);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/\.get\(\) read/);
+	});
+
+	it('rejects a signal read through a TS-wrapped callee', () => {
+		const { problems } = analyzeIslandsShell(
+			shell('<p>{String((count$ as any).get()) as string}</p>'),
+			'/src/Page.tsrx',
+		);
+		expect(problems.map((p) => p.message).join('\n')).toMatch(/\.get\(\) read/);
+	});
 });

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

Reviewed by Cursor Bugbot for commit aabf31b. Configure here.

trueadm and others added 3 commits October 2, 2026 18:51
- Run the signal-chat JavaScript budget journey from its own spec, which
  the Playwright config loads only against the production preview, rather
  than skipping it in development.
- Recognize only server-rendered `@try` arms (`y0`-`y2`) as balanced binding
  opens and spell the check compactly; the renderer pays 39 raw bytes for
  the new marker, so the root-chained-jsx budget rises to cover it.
- Pin the example E2E shard balance for the added journey.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Treat only a bare `independent` or `independent={true}` <Hydrate> as an
  island, matching the compiler; `independent={false}` is an ordinary
  boundary that needs the renderer.
- Follow every export form to the component it renders: anonymous default
  functions, default-exported identifiers, export lists, function-valued
  consts, and relative re-exports. An export the source cannot resolve
  (a wrapped component, a package or star re-export, a missing name) is a
  problem rather than a silent pass.
- Detect signal reads through a cast or non-null callee and computed
  `['get']`-style members, and check arrow components' expression bodies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A binding view's client template writes an empty `@try` range as
`[b;id;site;y`, before the region selects an arm. Building that region on
the client balances the range with the same open-comment grammar, so
rejecting a bare `y` made any `@try` created after activation throw #286
(signal-chat's stop/resume journey). Accept `y` and `y0`-`y2` again, in
one guarded regular-expression test that keeps the renderer cost small,
and raise root-chained-jsx's raw budget one step to cover it.

The initial-document-signals island fixture now resolves its island
module's requests as a bundler would: the prop-less child's island
request forwards to the renderer island module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@trueadm
trueadm merged commit 53db436 into main Oct 2, 2026
31 checks passed
@trueadm
trueadm deleted the feat/renderer-free-islands branch October 2, 2026 18:47
trueadm added a commit that referenced this pull request Oct 3, 2026
#1582 (53db436) gave ssrTry a `slot` arrow that labels a
presentation-binding view's arm. ssrTry evaluated that arrow on every call,
even when no binding marker was passed. The ssr-final-replay work suite counts
closure expressions evaluated under ssrTry. Its stream-32-1 target rose from
13,728 to 14,784, exactly one more per call across 1,056 calls, which breaches
the wave-budget guard.

The labeller is now the module-level ssrTryArm(content, arm, bindingMarker).
MARKERS is still read at call time and the emitted HTML is unchanged.
stream-32-1 measures 13,728 again.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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 feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renderer-free island activation: binding-view gates and an islands-only route mode

1 participant