Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e5d23ec
fix(router-cli): pass process.argv to yargs to fix silent CLI failure…
birkskyum Mar 19, 2026
5accb6f
ci: changeset release
github-actions[bot] Mar 19, 2026
0f585d5
fix(start-plugin-core): improve rollupOptions/rolldownOptions handlin…
birkskyum Mar 19, 2026
4fd92fd
ci: changeset release
github-actions[bot] Mar 19, 2026
7f38aac
chore: migrate benchmarks to Vite 8 (#6986)
Sheraff Mar 19, 2026
0545239
refactor: signal based reactivity (#6704)
Sheraff Mar 20, 2026
423be8a
ci: changeset release
github-actions[bot] Mar 20, 2026
80de7a9
Tanstack start docs: fix nodejs link for bun (#6992)
AntonyGarand Mar 20, 2026
13d314e
docs: update search parameters guide for zod v4 (#6956)
robballou Mar 20, 2026
9ae24ef
ci: apply automated fixes
autofix-ci[bot] Mar 20, 2026
91cc628
chore: update TanStack store packages to 0.9.2 (#6993)
Sheraff Mar 20, 2026
21e39bd
ci: changeset release
github-actions[bot] Mar 20, 2026
9351e99
fix: Fix React Fast Refresh state preservation for auto code-split ro…
schiller-manuel Mar 21, 2026
e710407
ci: changeset release
github-actions[bot] Mar 21, 2026
4e08a7d
Merge branch 'main' into solid-router-main-merge
brenelz Mar 21, 2026
454789d
Initial pass at passing tests
brenelz Mar 21, 2026
0d11d5e
fix(solid-router): avoid HeadContent remounts on history.replaceState…
Sheraff Mar 21, 2026
193b918
Fix some more tests
brenelz Mar 21, 2026
04986db
pipeline fixes
brenelz Mar 21, 2026
d7445e0
fix: better react HMR (#7005)
schiller-manuel Mar 21, 2026
4269810
progress
brenelz Mar 21, 2026
f56a0d5
Undo some router-core changes
brenelz Mar 21, 2026
05e35b2
Fix two pipeline tasks
brenelz Mar 21, 2026
b3bbc62
Fix tests
brenelz Mar 21, 2026
6b559bc
more progress
brenelz Mar 21, 2026
53e1dd4
Fix build failures
brenelz Mar 21, 2026
209eb56
Merge branch 'main' into solid-router-main-merge
brenelz Mar 21, 2026
fd7e4f8
Build passes now?
brenelz Mar 21, 2026
7b0b2c3
fix test
brenelz Mar 21, 2026
8c7bd19
Add depth check for flush
brenelz Mar 21, 2026
5ad23d5
ci: apply automated fixes
autofix-ci[bot] Mar 21, 2026
9b63607
add changeset
birkskyum Mar 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .changeset/violet-turkeys-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@tanstack/solid-router-ssr-query': patch
'@tanstack/solid-router-devtools': patch
'@tanstack/solid-start-client': patch
'@tanstack/solid-start-server': patch
'@tanstack/solid-router': patch
'@tanstack/solid-start': patch
---

chore: sync main branch with store refactor
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ node_modules
**/tests/generator/**/routeTree*.snapshot.ts
/.nx/workspace-data
**/src/routeTree.gen.ts
packages/router-plugin/tests/**/test-files/**
6 changes: 0 additions & 6 deletions docs/router/api/router/RouterStateType.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type RouterState = {
isLoading: boolean
isTransitioning: boolean
matches: Array<RouteMatch>
pendingMatches: Array<RouteMatch>
location: ParsedLocation
resolvedLocation: ParsedLocation
}
Expand Down Expand Up @@ -41,11 +40,6 @@ The `RouterState` type contains all of the properties that are available on the
- Type: [`Array<RouteMatch>`](./RouteMatchType.md)
- An array of all of the route matches that have been resolved and are currently active.

### `pendingMatches` property

- Type: [`Array<RouteMatch>`](./RouteMatchType.md)
- An array of all of the route matches that are currently pending.

### `location` property

- Type: [`ParsedLocation`](./ParsedLocationType.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/router/api/router/retainSearchParamsFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ If `true` is passed in, all search params will be retained.
```tsx
import { z } from 'zod'
import { createRootRoute, retainSearchParams } from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'

const searchSchema = z.object({
rootValue: z.string().optional(),
})

export const Route = createRootRoute({
validateSearch: zodValidator(searchSchema),
// Use the schema directly for Zod v4
validateSearch: searchSchema,
search: {
middlewares: [retainSearchParams(['rootValue'])],
},
Expand All @@ -32,15 +32,15 @@ export const Route = createRootRoute({
```tsx
import { z } from 'zod'
import { createFileRoute, retainSearchParams } from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'

const searchSchema = z.object({
one: z.string().optional(),
two: z.string().optional(),
})

export const Route = createFileRoute('/')({
validateSearch: zodValidator(searchSchema),
// Use the schema directly for Zod v4
validateSearch: searchSchema,
search: {
middlewares: [retainSearchParams(true)],
},
Expand Down
12 changes: 6 additions & 6 deletions docs/router/api/router/stripSearchParamsFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ title: Search middleware to strip search params
```tsx
import { z } from 'zod'
import { createFileRoute, stripSearchParams } from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'

const defaultValues = {
one: 'abc',
Expand All @@ -31,7 +30,8 @@ const searchSchema = z.object({
})

export const Route = createFileRoute('/')({
validateSearch: zodValidator(searchSchema),
// for Zod v4, use the schema directly
validateSearch: searchSchema,
search: {
// strip default values
middlewares: [stripSearchParams(defaultValues)],
Expand All @@ -42,15 +42,15 @@ export const Route = createFileRoute('/')({
```tsx
import { z } from 'zod'
import { createRootRoute, stripSearchParams } from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'

const searchSchema = z.object({
hello: z.string().default('world'),
requiredParam: z.string(),
})

export const Route = createRootRoute({
validateSearch: zodValidator(searchSchema),
// for Zod v4, use the schema directly
validateSearch: searchSchema,
search: {
// always remove `hello`
middlewares: [stripSearchParams(['hello'])],
Expand All @@ -61,15 +61,15 @@ export const Route = createRootRoute({
```tsx
import { z } from 'zod'
import { createFileRoute, stripSearchParams } from '@tanstack/react-router'
import { zodValidator } from '@tanstack/zod-adapter'

const searchSchema = z.object({
one: z.string().default('abc'),
two: z.string().default('xyz'),
})

export const Route = createFileRoute('/')({
validateSearch: zodValidator(searchSchema),
// for Zod v4, use the schema directly
validateSearch: searchSchema,
search: {
// remove all search params
middlewares: [stripSearchParams(true)],
Expand Down
2 changes: 1 addition & 1 deletion docs/router/api/router/useChildMatchesHook.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: useChildMatches hook
The `useChildMatches` hook returns all of the child [`RouteMatch`](./RouteMatchType.md) objects from the closest match down to the leaf-most match. **It does not include the current match, which can be obtained using the `useMatch` hook.**

> [!IMPORTANT]
> If the router has pending matches and they are showing their pending component fallbacks, `router.state.pendingMatches` will used instead of `router.state.matches`.
> If the router has pending matches and they are showing their pending component fallbacks, pending matches are used instead of active matches.
## useChildMatches options

Expand Down
2 changes: 1 addition & 1 deletion docs/router/api/router/useParentMatchesHook.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: useParentMatches hook
The `useParentMatches` hook returns all of the parent [`RouteMatch`](./RouteMatchType.md) objects from the root down to the immediate parent of the current match in context. **It does not include the current match, which can be obtained using the `useMatch` hook.**

> [!IMPORTANT]
> If the router has pending matches and they are showing their pending component fallbacks, `router.state.pendingMatches` will used instead of `router.state.matches`.
> If the router has pending matches and they are showing their pending component fallbacks, pending matches are used instead of active matches.
## useParentMatches options

Expand Down
2 changes: 1 addition & 1 deletion docs/router/api/router/useRouterStateHook.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: useRouterState hook
The `useRouterState` method is a hook that returns the current internal state of the router. This hook is useful for accessing the current state of the router in a component.

> [!TIP]
> If you want to access the current location or the current matches, you should try out the [`useLocation`](./useLocationHook.md) and [`useMatches`](./useMatchesHook.md) hooks first. These hooks are designed to be more ergonomic and easier to use than accessing the router state directly.
> If you want to access the current location or the current matches, you should try out the [`useLocation`](./useLocationHook.md) and [`useMatches`](./useMatchesHook.md) hooks first. These hooks are designed to be more performant, more ergonomic and easier to use than accessing the router state directly.

## useRouterState options

Expand Down
33 changes: 27 additions & 6 deletions docs/router/guide/search-params.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ For validation libraries we recommend using adapters which infer the correct `in

### Zod

An adapter is provided for [Zod](https://zod.dev/) which will pipe through the correct `input` type and `output` type
An adapter is provided for [Zod](https://zod.dev/) which will pipe through the correct `input` type and `output` type.

For Zod v3:

```tsx
import { zodValidator } from '@tanstack/zod-adapter'
Expand All @@ -213,13 +215,30 @@ export const Route = createFileRoute('/shop/products/')({
})
```

The important part here is the following use of `Link` no longer requires `search` params
With Zod v4, you should directly use the schema in `validateSearch`:

```tsx
import { z } from 'zod'

const productSearchSchema = z.object({
page: z.number().default(1),
filter: z.string().default(''),
sort: z.enum(['newest', 'oldest', 'price']).default('newest'),
})

export const Route = createFileRoute('/shop/products/')({
// With Zod v4, we can use the schema without the adapter
validateSearch: productSearchSchema,
})
```

The important part here is the following use of `Link` no longer requires `search` params:

```tsx
<Link to="/shop/products" />
```

However the use of `catch` here overrides the types and makes `page`, `filter` and `sort` `unknown` causing type loss. We have handled this case by providing a `fallback` generic function which retains the types but provides a `fallback` value when validation fails
In Zod v3, the use of `catch` here overrides the types and makes `page`, `filter` and `sort` `unknown` causing type loss. We have handled this case by providing a `fallback` generic function which retains the types but provides a `fallback` value when validation fails:

```tsx
import { fallback, zodValidator } from '@tanstack/zod-adapter'
Expand All @@ -240,7 +259,9 @@ export const Route = createFileRoute('/shop/products/')({

Therefore when navigating to this route, `search` is optional and retains the correct types.

While not recommended, it is also possible to configure `input` and `output` type in case the `output` type is more accurate than the `input` type
In Zod v4, schemas may use `catch` instead of the fallback and will retain type inference throughout.

While not recommended, it is also possible to configure `input` and `output` type in case the `output` type is more accurate than the `input` type:

```tsx
const productSearchSchema = z.object({
Expand Down Expand Up @@ -457,7 +478,7 @@ Now that you've learned how to read your route's search params, you'll be happy

The best way to update search params is to use the `search` prop on the `<Link />` component.

If the search for the current page shall be updated and the `from` prop is specified, the `to` prop can be omitted.
If the search for the current page shall be updated and the `from` prop is specified, the `to` prop can be omitted.
Here's an example:

```tsx title="src/routes/shop/products.tsx"
Expand All @@ -478,7 +499,7 @@ const ProductList = () => {

If you want to update the search params in a generic component that is rendered on multiple routes, specifying `from` can be challenging.

In this scenario you can set `to="."` which will give you access to loosely typed search params.
In this scenario you can set `to="."` which will give you access to loosely typed search params.
Here is an example that illustrates this:

```tsx
Expand Down
Loading
Loading