Repository navigation
feat: stabilize signals and document automatic native reads - #997
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Type-only signal imports enable native reads
- Added importKind checks to nativeReadOptions so that import type declarations and inline type specifiers from signal modules no longer incorrectly enable native read mode, consistent with the existing guards in analyzeNativeReadDiagnostics.
Or push these changes by commenting:
@cursor push fb6131f3d7
Preview (fb6131f3d7)
diff --git a/packages/octane/src/compiler/native-read-diagnostics.js b/packages/octane/src/compiler/native-read-diagnostics.js
--- a/packages/octane/src/compiler/native-read-diagnostics.js
+++ b/packages/octane/src/compiler/native-read-diagnostics.js
@@ -79,7 +79,9 @@
if (
((node.type === 'Identifier' || node.type === 'JSXIdentifier') && node.name.endsWith('$')) ||
(node.type === 'ImportDeclaration' &&
- (node.source?.value === SIGNALS_MODULE || LOCAL_MODULES.has(node.source?.value))) ||
+ node.importKind !== 'type' &&
+ (node.source?.value === SIGNALS_MODULE || LOCAL_MODULES.has(node.source?.value)) &&
+ (node.specifiers ?? []).some((s) => s.importKind !== 'type')) ||
((node.type === 'MemberExpression' || node.type === 'OptionalMemberExpression') &&
String(propertyName(node.property, node.computed) ?? '').endsWith('$')) ||
(node.type === 'Property' &&You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 0dcc53c. Configure here.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Promote
octane/signalsto a stable API that works without a compiler option. Signal imports and the existing$capability naming convention automatically select native read tracking in full compilation, plain custom hooks, and editor diagnostics. Modules without signal capability syntax keep their ordinary compiler output.Add a Signals guide to the website, navigation, search, sitemap, and
llms.txt, with examples covering local/shared state, async queries, streams, retained values, memo dependencies, disposal, and SSR/hydration. Move the detailed reference todocs/signals.mdand retain a link from the experimental URL.Changes
nativeReadsoption and its app/Vite/Rspack/Rsbuild forwarding.Validation
main: 18,277 core/signal/integration tests passed across 1,060 files, plus 14 expected failures. Command:pnpm exec vitest run --project octane --project octane-prod --project 'octane-signals*' --project vite-plugin --project rspack-plugin --project rsbuild-plugin --project app-core --exclude '**/browser/**' --silent=passed-only./docs/signalspage also passed real-browser dev/prod SSR and hydration checks (2 tests) against a fresh production build.pnpm synccompleted.mainbyte-for-byte; recorded evidence.fed1ce550: lint/typecheck, all test and React-parity shards, Chromium and website integration, example builds, package validation, renderer compatibility, and provenance. Bugbot also passed; its type-only import finding is fixed and resolved.An earlier combined website run stalled and timed out; separate website unit/build runs and a later fresh-build browser run for the Signals guide passed.
pnpm typecheck:fileschooses plain TypeScript for core test files importing TSRX; an additional TSRX-aware test-only program reports pre-existing declaration/fixture errors also reproduced from the baseline. The supported source/API and website typecheck programs passed. Repo-widepnpm testandpnpm typecheckwere not run locally; CI covers the broader workspace.Risk / follow-ups
Automatic selection follows authored signal imports and
$capability syntax and preserves runtime capture throughout each selected module. Native rendering remains limited to DOM client/server. The benchmark comparison checks compiler output and bundles; it does not claim a browser timing improvement.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Compiler and config surface changes how every signals-capable module is compiled (whole-module native tracking from
$/imports), which is broad but covered by large test and byte-identical benchmark baselines.Overview
Promotes
octane/signalsto a stable API and drops the experimentalnativeReadscompiler/app/plugin option everywhere (app-core, Vite, Rspack, Rsbuild, bundler defaults).Compiler behavior change:
nativeReadOptionswalks the module AST and turns on native signal read tracking when it seesoctane/signalsimports (non–type-only) or$capability syntax (identifiers, members, properties)—not from build config. Full compile and plain hook slotting both use this; the oldOCTANE_NATIVE_READ_OPT_INpath is removed. Type-only signal imports stay off the native path so non-DOM renderers can still compile.Docs and site: Adds
docs/signals.md, a Signals guide on octanejs.dev, sitemap/search/llms.txtupdates, and turnsexperimental-scoped-signals.mdinto a redirect. Package READMEs and benchmark harnesses compare “ordinary” vs signal-capability fixtures (legacy compilers still getnativeReadswhen their types expose it).Tests and tooling run signal suites through the standard toolchain; new coverage includes quoted
read$props and automatic compilation without options.Reviewed by Cursor Bugbot for commit fed1ce5. Bugbot is set up for automated code reviews on this repo. Configure here.