Repository navigation
fix: diagnose eager imported signal samples in DOM bindings - #1304
Merged
domgan-oai merged 3 commits intoSep 24, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
September 24, 2026 12:31
This was referenced Oct 1, 2026
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
An imported signal's
count$.get()can pass the pure-projection gate in a DOMbinding view and leave the server text as an unsubscribed snapshot. Selected
binding artifacts now diagnose an actual canonical native read during activation
or a later source publication, with guidance to bind the handle directly or
provide an explicit
BindingSourcesample.The compiler follows imported receivers through pure setup aliases and fixed-prop
specialization, preserving original method receivers and optional short circuit.
Props samples, native event adapters, mount initializers, already subscribed
native attribute projections, pure foreign methods and ordinary renderer/SSR
compilation retain their existing behavior. Deferred provider configuration
callbacks keep their invocation contract. Includes behavioral regression
coverage, migration documentation and an Octane patch
changeset.
Refs #1284.
Validation
pnpm format:check(current-head CI)pnpm typecheck(current-head CI)pnpm test(all four current-head CI shards)packages/octane/tests/behavior-root.test.tsin developmentand production modes, including SSR, adoption, mount and later-publication
cleanup
node --checkfor both changed compiler files andverify-dist.mjsgit diff --checknode scripts/check-changesets.jsnode scripts/check-tsrx-module-decls.mjs(not a semantic typecheck)
esbuild 0.28.1 and alien-signals 3.2.0: scalar/declaration-facade/derived/pending
and failed reads, foreign Proxy/
this, optional fallback, foreign erroridentity, observer restoration and owner cancellation. Isolated graph excludes
client/server renderer modules. Does not test compiler/SSR/adoption.
octane/dom-binding-signals, with exact cached esbuild 0.28.1 and no resolveraliases: only the helper and canonical read-protocol contribute bytes; no
retained renderer modules. Isolated output is 449 raw / 333 gzip / 257 Brotli
bytes, not a matched route saving or a compiled binding/package-dist check.
Blocked local gates: exact pinned
@tsrx/[email protected]and@tsrx/[email protected]are unavailable from the protected Socket registry.The frozen install terminated with HTTP 403; registry, pins and lockfile are
preserved. With pinned pnpm 11.15.1 and the supported per-command
pnpm_config_verify_deps_before_run=warnsetting, which prevents unintendedauto-installs, the following required/targeted commands were attempted:
pnpm syncexited 1 duringreact-parity:lockfiles:generate:ERR_MODULE_NOT_FOUND: Cannot find package 'typescript' imported from scripts/binding-surface-policy.mjs. Its earlier fixture synchronizationproduced no tracked diff.
pnpm format:files:checkexited 1:spawnSync prettier ENOENT.pnpm typecheck:filesexited 1:spawnSync tsrx-tsc ENOENT.pnpm exec vitest run packages/octane/tests/behavior-root.test.ts --project=octane --project=octane-prodexited 1:Command "vitest" not found.Full current-head CI
passed on signed head
881a478b688e27ed206b718939be8500ba6da6b8: all 26 jobssucceeded, including real configured formatting/typecheck, all four test shards,
all four parity shards, browser/website lanes, examples, package/dist verification,
release validation, compatibility and full-suite provenance. The binding test
file passed all 195 tests in both
octaneandoctane-prodprojects, executingits SSR/adoption/mount/later-publication controls. Local package access remains
blocked. Integrated pre-fix reproduction, complete local sync and matched
compiler/runtime measurements remain unverified.
Risk / follow-ups
Each selected imported
.get()check adds a synchronous thunk and temporarynative-read observer, including for a pure foreign accessor on source publication.
The common renderer path and artifacts without those reads emit no diagnostic
helper. Representative compiler output, raw/gzip/Brotli graphs and runtime costs
still require matched measurement after approved package access.
Mixed props/import aliases, receivers containing props samples, mixed optional
chains and opaque provider callbacks remain outside this diagnostic slice.
Subscribed
.get/.latestand setup lowering remain later #1284 work; this PRdoes not close the broad issue.
Direct
.latest(fallback)is covered as an existing unsupported compilerdiagnostic, not claimed as a reproduced stale-read defect. Namespace/opaque
projection variants need further qualification.
The remaining #1284 roadmap also includes zero-argument exported views,
mount-only activation/cleanup, async arms with reset/error/cancellation ownership,
conditional control handles and genuine state-consumer migration, renderer-free
independent artifacts, an explicit islands-only route, signal-chat and
benchmark/fixture pilots, and final matched raw/gzip/Brotli graphs with semantic
and lifetime/allocation counters. Preserve merged #1286/#1288/#1289. The smaller
public signal entry remains intentionally deferred and Action registration
intentionally retained; neither is implemented here by copying core or adding a
public entry.
Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Changes compiled binding activation and source publication for views that sample imported signals via
.get(); misclassified reads could throw at runtime, though exclusions limit blast radius to the new diagnostic slice.Overview
Imported signal
.get()in DOM binding views no longer silently freezes as unsubscribed server text. The compiler classifies eager zero-arg.get()on imported receivers (including aliases, optional chains, and fixed-prop paths) and wraps those sites with runtime__assertBindingSnapshot, which throws during activation orBindingSourcepublication when the canonical native-read protocol observes a live signal read without a binding subscription.Unchanged paths include direct handle bindings (
count$ as string), props-basedprops.*.get()samples, pure foreign.get()methods, event/ref/mount adapter projectors (marked read-excluded), already-subscribed native attribute projections, deferred provider callbacks, and ordinary SSR.Docs and an Octane patch changeset describe the author contract;
verify-distnow requires the newoctane/dom-binding-signalsexport. Large behavior-root regression tests cover attach/mount, structure selection, mixed chains, StyleX projections, and later publication.Reviewed by Cursor Bugbot for commit 9be2fcd. Bugbot is set up for automated code reviews on this repo. Configure here.