# @solidjs/router ## 1.0.0 ### Major Changes - Declare the router stable as 1.0.0. This is a version realignment, not a breaking change: the code is functionally identical to the 0.16 line, which has held API-stable for years, and `^1.0.0` finally gets normal caret semantics instead of the pinned-minor treatment resolvers give 0.x releases. It also aligns major numbers across the ecosystem — router 1.x pairs with Solid 1.x (and SolidStart 2.0), while the in-progress Solid 2 router moves from `1.0.0-next.*` to `2.0.0-next.*` prereleases under the `next` tag. ### Patch Changes - 1211a89: Restore scroll with a single scroll once routing settles, dropping the `ResizeObserver` that re-asserted the offset while the document was still growing (``, added in 0.16.3). Settling after the navigation commits is what makes the offset reachable, and it is the strategy every peer router ships (SvelteKit, TanStack Router, React Router, Next); TanStack's equivalent `MutationObserver` sits commented out in their source. The chase carried real downside for a case none of them try to cover: with no bound, a target that is never reachable (a list that is genuinely shorter now) left the observer connected for the life of the page, re-clamping the viewport to the bottom on every subsequent resize, and scroll-induced layout changes can feed it back into itself. It was also untestable in jsdom, which has no `ResizeObserver`, so the branch had no coverage. Content committing after the navigation settles — an image without reserved space, a boundary below the fold — now keeps whatever offset the document can hold. ## 0.16.3 ### Patch Changes - 31501fd: Add opt-in explicit scroll restoration for back/forward navigation: `` (#577). The browser's native same-document heuristic loses the saved offset when the destination route forces a layout while the document is still short — any component that measures itself on mount is enough to trigger it. When enabled the router sets `history.scrollRestoration = "manual"`, captures positions continuously keyed by the history entry depth it already tracks, persists them across reloads, and restores after the navigation settles — retrying as the document grows if the target offset isn't reachable yet, cancelled by the first user scroll. Off by default on 0.x; no behavior changes unless enabled. ## 0.16.2 ### Patch Changes - 676db85: fix #451 - dispose per-route roots when the route tree unmounts; leaked roots stayed subscribed to route matches and crashed with `TypeError: ... (evaluating 'match().path')` on a later navigation (e.g. when a `` in the root component hid the outlet during login/logout flows) - cae1d15: Fix a batch of long-standing bugs: - `useSubmission().retry` was always a no-op due to an operator-precedence bug (#504) - disposing an older owner no longer unregisters a newer action bound to the same URL, which caused forms to fall through to native submission after revalidation (#542) - `useBeforeLeave` listeners now observe `defaultPrevented` set by other listeners (#530) - `` active state now ignores trailing slashes on `href` (#532) - `useCurrentMatches` returns a copy so user mutation can't corrupt router state (#516) - static path segments no longer percent-encode RFC 3986 pchar characters (`+`, `@`, `:`, `$`, `&`, `,`, `;`, `=`), so routes like `/+foo` or `/@user` match the browser's raw pathname (#559, #509) - consecutive synchronous `setSearchParams` calls now compose: the merge applies to the in-flight navigation target instead of the stale committed location (#547) - e9acd69: fix #454 - default `RouteDefinition`'s data generic to `any` so typed components and preload functions are assignable in annotated configs like `const routes: RouteDefinition[]`, where no inference site for the generic exists - 9d80d4e: Paths with empty interior segments (doubled slashes, e.g. `//dash` or `/foo//bar`) no longer match routes and now render the not-found state instead of silently matching their collapsed form (#567). A single trailing slash is still tolerated. Doubled leading slashes are also no longer normalized away by the browser integration and parse correctly instead of being treated as protocol-relative URLs. - b308c21: fix #497 - `revalidate` now forces the cache miss synchronously instead of deferring it into the transition microtask, so a same-tick `refetch()` after an un-awaited `revalidate()` refetches fresh data - e9acd69: fix #347 - accept `VoidComponent` pages as route components; `component` now takes a `RouteSectionComponent` union so components that don't declare `children` type-check, while components requiring props the router doesn't pass are still rejected ## 0.16.1 ### Patch Changes - e847f96: Fix the published package contents so `dist` no longer includes mirrored `src`, `test`, or co-located spec files. Also move the data tests under `test/` and align the test TypeScript config with that layout so `test:types` continues to pass cleanly. ## 0.16.0 ### Minor Changes - 8f0a8c3: Re-export context - 9e85fe2: Update `moduleResolution` ### Patch Changes - 63940c5: Use `name` in `action` and `createAsync` `action()` and `createAsync()` were not respecting user defined name. Moreover, action was not applying the hashed name and only naming the action "mutate". - f9b6dc6: Make useHref return a string with string param ## 0.15.4 ### Patch Changes - da5e1f9: allow URLSearchParams type for when enctype is not set to multipart/form-data - 1aa664e: - Improve route matching fallback - Optimize imports - fa46b67: fix(type): allow value from `Params` and `SearchParams` to be optional - bd89541: Support `in` operator for useParams() - 0a2f556: preserve headers in `query()`'s `handleResponse()` - ac97470: added `SearchParams` to the exported types - 8885abf: fix: createAsync - catch errors of prev to avoid bubbling error up - d665cc9: Fix Router popstate event handling logic - Simplified delta check logic for history navigation - Improved reliability of forward navigation detection - Fixed window.history.forward() navigation handling ## 0.15.3 ### Patch Changes - 97184e4: more lenient on cache resuming (allow nested promises during hydration) ## 0.15.2 ### Patch Changes - fe5c83e: Add JSdoc - 9a5e350: Vite 6 compatibility - 20ad18f: only clear completed actions on navigation ## 0.15.1 ### Patch Changes - f3763aa: Export Submission at the top level - 813e6bd: fix `onComplete` return type ## 0.15.0 ### Minor Changes - 6799556: rename `cache` to `query`, action `onComplete` ## 0.14.10 ### Patch Changes - 18b9b52: Support arrays in Search Params - 272218f: fix #491 - useSubmission with "with" actions ## 0.14.9 ### Patch Changes - a22d7d2: fix preloadRoute to take string path - 6dd0473: support empty array/string to mean no revalidation ## 0.14.8 ### Patch Changes - a3a36fb: Add query and param wrappers to support non-Proxy envs - 2475851: bump deps - 2f1fa18: improve anchor preload performance ## 0.14.7 ### Patch Changes - 3594e45: fix iterator methods on useSubmissions ## 0.14.6 ### Patch Changes - 0a964b6: Fix duplicated push history - c61231d: Fix scrollToHash to handle hashes starting with a number - 83b7093: remove extra code, fix #406 slow perf on localeCompare ## 0.14.5 ### Patch Changes - 5c87acc: fix partial matches in single flight mutations ## 0.14.4 ### Patch Changes - 098dccb: fix #474 improper search parameter resolution while routing - f8f30df: fix initial state including \_depth ## 0.14.3 ### Patch Changes - 19a21cc: fix async store references - f8aaf16: make url transform consistent - 86c3b1f: better handling of query only navigation ## 0.14.2 ### Patch Changes - bc3d8e3: expose .latest from createAsync - fc6ac53: fix #464 flaky hydration bail out - 3295502: fix hydration cancellation on browser events ## 0.14.1 ### Patch Changes - 6144da8: fix Response type narrowing in submission APIs ## 0.14.0 ### Minor Changes - e4a13f6: Response helpers return responses, cache/action filter them out - bd9f19a: default form actions to url encoded - 5d9263b: rename load to preload ### Patch Changes - a7e4062: fix #457 extra leading slashes on path - 4b4536e: add usePreloadRoute export - 8cc0530: hack the types to work a bit better with Response Unions ## 0.13.6 ### Patch Changes - 7344f69: Handle absolute redirects within `cache` on server - 8263115: Forward absolute redirects inside `cache` from server to client - 8fbf74a: Treat `window.location.hash` as URI encoded - e9fd55d: fix #449 No JS submissions not working - f311f4a: fix #452 useSubmission types/references - 2f05f37: Make isRouting more reliable + other fixes - 618ef17: performance improvement leveraging redirects in loadfn - d81473a: usePreloadRoute method pre-release ## 0.13.5 ### Patch Changes - bfb059f: types Route -> RouteDescription ## 0.13.4 ### Patch Changes - 00e37fd: Export all types used in public API - 2e90de5: Fix `HashRouter` state reset with `replace: false` - 75472d2: Fix useCurrentMatches a getter function ## 0.13.3 ### Patch Changes - 884b8be: fix #374, fix #399 - suppress cache errors in load function - 4a76e7d: Fix state updates detection on history back/forward - 5af3da8: fix #407 single flight without explicit keys - 1068f1b: fix #408 - accessing route information - 0c698ed: Allow rewriting url ## 0.13.2 ### Patch Changes - 0a34883: preserve original path on optional segments - 94797e1: Fix types for cache functions with all optional arguments - 8a547a8: don't submit form when submit event is defaultPrevented ## 0.13.1 ### Patch Changes - 8b766a9: restore params into root ## 0.13.0 ### Minor Changes - 7b1597b: Add errors to actions ### Patch Changes - 83e827d: minimum types for submission flash - 6df4a7a: push root/rootLoad outside of route matching ## 0.12.5 ### Patch Changes - fdefceb: fix #388 reference to element prop - ffbd35a: fix #389 update router context error message - bceb358: fix backcache storing invalidated values ## 0.12.4 ### Patch Changes - 533b7a0: fix unintended early return in cache during server render ## 0.12.3 ### Patch Changes - 02c6e7a: action to return fully processed response ## 0.12.2 ### Patch Changes - 5e8cbdb: apply the right owner (who's aware of the router) ## 0.12.1 ### Patch Changes - 6d0be9e: fix cache serialization to match returned value - 052d385: Run load functions with owner & context of `Router` component. ## 0.12.0 ### Minor Changes - 17ea145: add createAsyncStorage, prev argument, remove store from cache ## 0.11.5 ### Patch Changes - 0413594: fix memory router no native events - 97d387b: add `rootLoad` - 5a94e7d: fix Router types, make singleFlight optional ## 0.11.4 ### Patch Changes - d67ccbb: single flight mutations - 76724af: pass revalidate through `json` helper ## 0.11.3 ### Patch Changes - 9cc1a85: update response types to be always present ## 0.11.2 ### Patch Changes - fab3cc0: fix renderToString for cache fns ## 0.11.1 ### Patch Changes - 20663d5: metadata -> info ## 0.11.0 ### Minor Changes - 6e661eb: add changesets