Repository navigation
fix(hydration): isolate native signal attribute diagnostics - #1238
Merged
domgan-oai merged 1 commit intoSep 22, 2026
Merged
domgan-oai merged 1 commit into
domgan-oai merged 1 commit into
Conversation
domgan-oai
marked this pull request as ready for review
September 22, 2026 14:06
5 of 6 tasks
domgan-oai
pushed a commit
that referenced
this pull request
Sep 23, 2026
…nders (#1282) When a mounted parent changes a dormant Hydrate boundary's captures or provided context before activation, the server HTML predates the client's state. Decide that by comparing the initial and current captures instead of rendering the child with its historical props, and repair attributes, class, style and text without mismatch diagnostics in dev and prod. Removes the development-only historical attribute probe (#1181) and the native-signal isolation built on it (#1238), which re-ran component bodies, state initializers, memo factories and getSnapshot with stale props. Co-authored-by: Claude Opus 5.5 <[email protected]>
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
useSignal$through an isolated, disposable built-in adapter. Lazy initializers and unknown native hooks remain conservative; comparison cannot publish reads, write signals, attach refs, or run effects.Validation
d9042265with the same final regression tests: 24 failed / 28 passed. Candidate: 52 / 52 passed, covering split and unsplit boundaries, development and production, true initial mismatches, later updates, local state, cleanup, and thrown comparisons.pnpm sync.signals/clientexports changes by +9 / +7 / +17 bytes (raw/gzip/Brotli) against upstream. User-facing signal exports/signatures are unchanged; the compiler-internal entrypoint gains a probe flag accessor. No CPU performance claim.pnpm format:check,pnpm typecheck, andpnpm testwere not run; scoped checks above were used. Local browser/device validation was not run; CI's own lanes are reported separately.Risk / follow-ups
The historical comparison is development-only. Function-valued initializers and arbitrary hook factories are intentionally not evaluated by this diagnostic path. Ready-triggered CI passes on
b02c7f8c(run); review is pending.Provenance
agent-authored)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Medium Risk
Touches development hydration diagnostics, native read collection, and
useSignal$initialization paths; production behavior is gated but runtime probe wiring is intricate and error-prone if teardown order regresses.Overview
Development-only deferred hydration diagnostics now replay preserved native signal history when comparing attributes, instead of treating the diagnostic pass like a live render that collects reads or throws on native hooks.
The historical probe pauses the native read driver lifecycle, enables write guards, and wires a native seed resolver from
nativeSeedRaw. Native read scopes, witnesses, and blockbeginRender/endRenderno-op whilehydrateAttributeProbeis active.useSignal$with a literal initial value may use a private diagnostic initializer andcreateDiagnosticLocalScopeso comparison state is disposable and isolated—no subscriptions, writes, refs, or effects on the live tree. Lazy function initializers and unknownnativeLocalHookfactories stay blocked.Cleanup restores adoption, guards, driver lifecycle, and diagnostic scopes even when the probe throws.
isNativeSignalDiagnosticProbe()is exposed for internal/compiler use. Regression coverage spans split/unsplit hydrate boundaries, attribute mismatches, local signal isolation, and throwing probes.Reviewed by Cursor Bugbot for commit b02c7f8. Bugbot is set up for automated code reviews on this repo. Configure here.