Skip to content

fix: support signals in the website playground - #1021

Merged
leonidaz merged 4 commits into
mainfrom
fix/playground-signals
Sep 9, 2026
Merged

leonidaz merged 4 commits into
mainfrom
fix/playground-signals

Conversation

@leonidaz

@leonidaz leonidaz commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The playground rejected octane/signals and octane/signals/client as unavailable. Bundle both entries alongside the existing runtime, allow their imports, and map them to sandbox-local blobs so signal hooks share the preview's runtime singleton.

Add a Signals example under Basics in both TSRX and TSX, demonstrating shared state, a derived value, and a component-local signal. Import-policy regressions cover both entry points, and the browser scenario selects the actual example from the dropdown and checks its interactive values.

Validation

  • Targeted playground tests: 46 passed across playground-modules.test.ts, playground-runtime.test.ts, and playground.test.ts (website-unit). Both new import tests failed before the fix with the reported rejection.

  • Scoped tsrx-tsc check for the five changed files, including the browser harness declaration file.

  • Formatting check for all changed files.

  • pnpm sync.

  • Full repository tests and typechecking were not run locally. The new browser scenario was added but its local run was stopped before completion at the user's request; CI will validate it.

  • Signals example checks: 5 passed (playground-examples.test.ts -t signals).

  • Focused Chromium smoke check using the actual preview engine and sandbox: both TSRX and TSX variants render and update shared, derived, and local signals. The full website dropdown scenario remains for CI.

  • Scoped typecheck and formatting for the example and updated browser test.

Risk / follow-ups

The playground runtime manifest grows from 127,533 to 137,338 gzip bytes (+9,805 bytes), measured consistently across three builds of each version. Both entries use the existing code-split bundle; no core runtime or compiler source changes.

Provenance

  • An agent produced this diff (agent-authored)

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


Note

Low Risk
Scoped to website playground bundling, import policy, and examples; sandbox boundary rules are tightened with tests and no auth or data-path changes.

Overview
The website playground now supports octane/signals and octane/signals/client instead of rejecting those imports.

The playground runtime build adds both as code-split esbuild entries (alongside octane, octane/react, etc.), and the sandbox import map wires them to the same local blob singletons as the rest of the runtime. The module graph allowlist and docs comments are updated so only client signal entry points pass the security boundary (octane/signals/server stays blocked).

A new Signals Basics example (createScope, shared/derived signals, useSignal$) is in the dropdown in TSRX and TSX. Unit tests assert bare specifiers for the two paths; a Playwright scenario selects that example and checks shared, derived, and local counters update on click.

The shipped runtime manifest grows by ~10KB gzip; no changes to core Octane compiler packages.

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

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
octane-website-mcp Skipped Skipped Sep 9, 2026 6:26pm UTC

Request Review

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent fix PR: bug fix labels Sep 9, 2026
@leonidaz
leonidaz marked this pull request as ready for review September 9, 2026 18:14

@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: Signal test omits required scopeKey
    • The playground signals e2e payload now calls createScope({ scopeKey: 'shared' }), which satisfies the required nonempty scopeKey so the sandbox can mount.

Create PR

Or push these changes by commenting:

@cursor push ac8a6097df
Preview (ac8a6097df)
diff --git a/website/tests/ssr-hydration.e2e.test.ts b/website/tests/ssr-hydration.e2e.test.ts
--- a/website/tests/ssr-hydration.e2e.test.ts
+++ b/website/tests/ssr-hydration.e2e.test.ts
@@ -2600,7 +2600,7 @@
 							name: 'App.tsrx',
 							source: `import { createScope } from 'octane/signals';
 import { useSignal$ } from 'octane/signals/client';
-const scope = createScope();
+const scope = createScope({ scopeKey: 'shared' });
 const shared$ = scope.signal$('count', 0);
 export default function App() @{
 	const local$ = useSignal$(10);

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

Reviewed by Cursor Bugbot for commit 32121a0. Configure here.

Comment thread website/tests/ssr-hydration.e2e.test.ts Resolved
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp September 9, 2026 18:26 Inactive
@leonidaz leonidaz added the deploy-preview Deploy website and MCP previews for the latest PR commit label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Vercel previews for 3ceb3e8 via deploy-preview-pr-1021 (deployment commit 6584373):

Project Preview Status
Website Open preview SUCCESS
MCP website Open preview INACTIVE

github-actions Bot pushed a commit that referenced this pull request Sep 9, 2026
Authorized-by: @leonidaz
Source: 3ceb3e8
Run: 34390563236/undefined
@leonidaz leonidaz removed the deploy-preview Deploy website and MCP previews for the latest PR commit label Sep 9, 2026
@leonidaz
leonidaz merged commit 8934401 into main Sep 9, 2026
34 of 35 checks passed
@leonidaz
leonidaz deleted the fix/playground-signals branch September 9, 2026 19:04

This branch was previously deployed

1 inactive deployment
Preview – octane-website-mcp — 3ceb3e82 Deployed Sep 9, 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