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 5f1a361
Browse filesBrowse the repository at this point in the historyBrowse files
committed
fix(solid-router): keep the requesting interaction across a useBlocker await
The Transitioner dated a navigation and captured its interaction when the
history notified. With a blocker registered, the history awaits the
blocker before it pushes, so the notification ran in a later task: the
interaction was gone from the stack and the record declared none, and a
navigation held until `proceed()` was dated from the confirm with no
interaction either. Solid Router has neither gap: its leave guard runs
synchronously inside navigate(), and a blocked navigation retried from the
confirm (`retry()`) navigates in the confirm's interaction.
Note the request (time, `currentOrigin()`) at `commitLocation`, before the
history is asked, for the history change it causes to take. A `useBlocker`
consulted synchronously as the first blocker holds it past the commit;
`proceed()` notes a new request in the interaction that proceeds, so the
navigation joins the confirm as Solid Router's `retry()` does; a blocker
that stops the navigation drops it; a commit that changed no history
releases it as it returns. Only on the client, only where `OBSERVE` is
defined.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
Observe tier (Solid's dev and observe builds only): a navigation that passes a `useBlocker` keeps the interaction that requested it and is dated from the request, though the history awaits the blocker before it changes; one the blocker holds until `proceed()` joins the interaction that proceeds and is dated from it, as `@solidjs/router`'s `retry()` makes it. The router notes the request at `commitLocation` for the history change to take. A navigation the blocker stops, or a request that changes no history (the same location reloading), leaves nothing noted behind. Nothing changes in production, where `OBSERVE` is undefined.
0 commit comments