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 fd8b3df
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(web): stop loading useHead stylesheets from halting hydration (#3600)
* fix(web): stop loading useHead stylesheets from halting hydration
The waitAsset gate memo is created without an owner, and the hydrating
createMemo peeked a hydration id from that null owner. The gate is now
transparent, and useHead skips it while hydrating, since that content is
already visible.
A streamed boundary whose swap the server holds on a stylesheet ($dfs)
settled its _fr record before the swap ran. Resuming on the settle
claimed against a document without the content and rendered a second
copy, so the resume now waits for the swap.
* chore(web,size): finish #3600 — useHead hydration carve-out in JSDoc, size caps re-measured over #3606
Rebased over #3605/#3606. `useHead`'s JSDoc names the documented-behavior
carve-out: stylesheet reveal gating is skipped while `sharedConfig.hydrating`
is true (hydration claims DOM the browser already painted; the server gated
that paint), no FOUC introduced.
Size caps re-measured on the rebased head (matches CI byte-for-byte):
hydrating (no stores) 20,919 B (+36 over `next`'s 20,883) -> 20.95 KB;
hydrating + stores 31,155 B (+10 over 31,145) -> 31.2 KB. `next` at
ed60f05 already exceeds two caps — #3606 landed over #3605 unmeasured —
so the observe tier (17,455 B, 0 B from this PR) is bumped to 17.5 KB with
a note attributing it to #3606. `+ createStore` unchanged at 16,949.
Co-authored-by: Claude via Cursor <[email protected]>
---------
Co-authored-by: Ryan Carniato <[email protected]>
Co-authored-by: Claude via Cursor <[email protected]>
Fix `hydrate()` halting with `TypeError: Cannot read properties of null (reading '_config')` when a `useHead({ tag: "link", props: { rel: "stylesheet", href } })` sheet is still loading as hydration reaches it (the default with an async entry script), including on a late streamed boundary resume. The `waitAsset` gate memo is created without an owner, and the hydrating `createMemo` tried to peek a hydration id from that null owner; the gate is now `transparent`, so hydration never sees it. `useHead` also no longer gates stylesheets while hydrating: that content is already visible, and a pending read inside a boundary's claim window made the boundary render fresh DOM beside the server's.
7
+
8
+
A streamed `<Loading>` boundary whose fragment swap the server holds on a stylesheet (`$dfs`) now resumes when the swap lands, not when its `_fr` record settles. Resuming on the settle claimed against a document that did not have the content yet, then the delayed swap inserted a second copy.
0 commit comments