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 abce6f2
Browse filesBrowse the repository at this point in the historyBrowse files
committed
fix(solid-router): name the canonical arrival in the initial observe record
The client's initial record was declared in RouterProvider and read
`router.latestLocation` as its frame closed, before the Transitioner
committed the canonical form of the arrival (search defaults, trailing
slash): `/about` arriving on a route whose search validates to
`/about?tab=info` was named `/about`, and the next navigation's `from`
was a location the record never named.
Solid Router declares the arrival around building its context, the
normalization of an empty arrival included, and reads `to` at settle, so
the record names the normalized location (its `observe-navigation` spec,
"an empty arrival normalized onto the base path is one initial record").
Declare the client's arrival around the Transitioner's establishing work
(canonicalization included) and name the location it established;
RouterProvider keeps the server's declaration around the load.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
Copy file name to clipboardExpand all lines: .changeset/solid-router-observe-initial-route.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
'@tanstack/solid-router': patch
3
3
---
4
4
5
-
Observe tier (Solid's dev and observe builds only): the router declares the route the document arrived on, with the same `OBSERVE.attribution.withOrigin` call it makes for every navigation, around the work in `RouterProvider`that establishes its initial match (`initial: true`on the ref), on both sides. On the client this is the first `"navigation"` record (`initial: true`, `at` the document's navigation start, no write to wait for), kept out of `feedback().navigations`; on the server the same declaration names the request's `"render"` record (`RenderEvent.route`: the matched route's `fullPath`, the path and search, the params), read when the render settles, so a render whose provider ran the load names the location it resolved. A consumer naming page loads and requests by route (`/users/$id` rather than one name per user) had this for every navigation but the first; now it has the first too.
5
+
Observe tier (Solid's dev and observe builds only): the router declares the route the document arrived on, with the same `OBSERVE.attribution.withOrigin` call it makes for every navigation (`initial: true` on the ref), around the work that establishes its initial match — the Transitioner's on the client, `RouterProvider`'s load on the server. On the client this is the first `"navigation"` record (`initial: true`, `at` the document's navigation start, no write to wait for), kept out of `feedback().navigations`; on the server the same declaration names the request's `"render"` record (`RenderEvent.route`: the matched route's `fullPath`, the path and search, the params), read when the render settles, so a render whose provider ran the load names the location it resolved. A consumer naming page loads and requests by route (`/users/$id` rather than one name per user) had this for every navigation but the first; now it has the first too.
6
6
7
-
The Transitioner committing the canonical form of the arrival location (search defaults, trailing slash) is part of the arrival, not a navigation: a router loaded before it mounted no longer records it as one, and the next navigation is dated from its own request rather than from that commit. Nothing changes in production, where `OBSERVE` is undefined.
7
+
The Transitioner committing the canonical form of the arrival location (search defaults, trailing slash) is part of the arrival, as in `@solidjs/router`: the initial record names the canonical location, a router loaded before it mounted no longer records the commit as a navigation, and the next navigation is dated from its own request rather than from that commit. Nothing changes in production, where `OBSERVE` is undefined.
0 commit comments