You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9927ddd
Browse filesBrowse the repository at this point in the historyBrowse files
committed
fix(web,solid): a held container-trace fill hydrates like a resident one
Review of the document-face hold (FrameImpl.#argsUnprepared) along five
edges — hydration end before the load settles, id determinism, interruption
during the hold, record retention, snapshot consistency — each pinned by a
spec written against the branch first.
Three fixes, each the smallest change that makes the late claim match a
resident-at-t=0 run:
- solid: the container-trace materializer roots its projection under a
DETACHED root (runWithOwner(null, createRoot)). Rooted under the reading
owner, a resident materializer consumed one hydration id per trace during
the document pass while a late one (no ambient owner) consumed none, so a
sibling after the frame hydrated under different keys in the two runs.
- solid: materialized for a CLAIM, a replayed backlog beyond the snapshot
is parked until hydration ends (onHydrationEnd; a microtask when the
document's pass is over). The claim trusts the server markup, which shows
the snapshot — a text hole is never rewritten during a claim — so a trace
already past the markup left the DOM diverged for good, resident or late.
Same treatment hydrateStoreFromAsyncIterable gives its buffered backlog.
The frame marks adopt-time args: revive(value, claiming?) ->
reviveContainerTraces(value, claiming?) -> materializer(marker, claiming?).
- web/frames: an occurrence held on an unresolved ref or unprepared arg
mounts with the record it was HELD on (what the server interior was
rendered from) and applies a record that replaced it meanwhile (refetch,
rebind) as the args change it is — instead of claiming old markup with
new args.
Pins: test/hydration/container-trace-hold-*.spec.tsx (+ shared helpers).
One test.fails pin documents a pre-existing client/server id drift (a keyed
sibling after a frame: client adoptBoundary consumes no id, the server's
NoHydration owner consumes one), independent of the hold.
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Make a held (lazily materialized) container-trace fill hydrate like a resident one.
7
+
8
+
- The container-trace materializer creates its projection under a detached root. Created under the reading owner, a resident materializer consumed one hydration id per trace at t=0 while a late one (no ambient owner) consumed none, so the sibling after a frame hydrated under different keys in the two runs.
9
+
- A trace materialized for a claim (a frame's adopt-time mount, at t=0 or late) parks its replayed backlog beyond the snapshot until hydration ends (the same treatment the store-shaped async-iterable hydration gives its buffered backlog). The claim trusts the server's markup, which shows the snapshot; applying the backlog after the claim lets the DOM catch up with a store that moved past the markup — resident or late. A fresh mount folds the whole backlog at once, as before. The frame marks adopt-time args through a new optional second parameter: `FrameHostOptions.revive(value, claiming?)`, forwarded by `reviveContainerTraces(value, claiming?)` to the installed materializer (`setContainerTraceMaterializer((marker, claiming?) => …)`).
10
+
- A frame occurrence held on an unresolved ref or an unprepared arg now mounts with the record it was held on (the one the server interior was rendered from) and applies a record that replaced it meanwhile — refetch, address switch — as the args change it is, instead of claiming old markup with new args.
0 commit comments