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 abde9e6
Browse filesBrowse the repository at this point in the historyBrowse files
committed
feat(solid-router): declare the route the document arrived on to Solid's observe tier
The Solid adapter declared every navigation's match publish to the observe
tier, but the first page has no publish to wrap, so the route the page
loaded as was never declared, and on the server the request's "render"
record had a URL and no route. solid-js / @solidjs/web 2.0.0-rc.12 added
NavigationRef.initial and RenderEvent.route for exactly this; Solid Router
adopted them in solidjs/solid-router#623.
RouterContextProvider now wraps the work that establishes its initial
match (the ready memo, which on the server starts the load) in the same
call, with initial: true on the ref:
- Client: the engine opens the frame at the time origin and settles it as
the provider returns: the first "navigation" record, initial: true,
writes: 0, at: 0, no from; kept out of feedback().navigations.
- Server: there is no engine; the server entry's withOrigin files the ref
on the render, and the "render" record carries RenderEvent.route
({ name, to, params }), read at settle, after a provider-run load.
describeInitial shares describeRoute with describeNavigation; its fields
are getters over router.latestLocation.
The Transitioner's post-mount commit of the canonical arrival location
(search defaults, trailing slash) is the arrival's, not a navigation, the
TanStack form of #623's "an empty arrival normalized onto the base". With
the router loaded before mount, resolvedLocation was already set and that
commit was declared as a navigation from the arrival to itself; without
it, the arrival's history change left requestedAt set and the next real
navigation was dated from the mount. The commit is now marked, and every
non-pending publish answers the pending request, declared or not.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
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 pathname, 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
+
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.
0 commit comments