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 a18099f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(solid): sweep truncated fragments when hydration starts after parse
watchTruncation only armed its DOMContentLoaded listener when the runtime
booted with document.readyState === "loading". An entry that runs later
(a deferred module, or one that waits on a route chunk that lands after
DOMContentLoaded) never swept, so a truncated stream left its _fr
declarations pending and hydration never finished.
Under the in-render bootstrap (_$HY.s) every declaration and settle is a
parser-inserted script, so once parsing is over a pending _fr can only be
truncated. Run the same sweep at boot in that case: drop the records that can no
longer settle, reject the cut fragments, and a macrotask later reject the
refs a keyed consumer already took. Host-placed bootstraps keep the
current behavior.
A stream cut short no longer hangs hydration when the client runtime starts after the parser finished (#2958). The truncation sweep only armed when `hydrate()` ran while `document.readyState` was still `"loading"`. An entry that ran later, such as one waiting on a route module that arrives after `DOMContentLoaded`, or a deferred module entry, left every unsettled `_fr` declaration pending, so its `<Loading>` kept the fallback and hydration never ended. When the document carries the in-render bootstrap (`<HydrationScript />`, which declares `_$HY.s`), a runtime that boots after parsing now runs the same sweep at boot: the records that can no longer settle leave the registry, the cut fragments are rejected, and a macrotask later the refs a keyed consumer already took are rejected. Documents with a host-placed bootstrap (`generateHydrationScript()`) are unchanged.
0 commit comments