Skip to content

Commit 75790b1

Browse files
authored
Merge branch 'main' into support-lazy-error-component-on-before-load
2 parents d3c4b0f + f830dff commit 75790b1

File tree

960 files changed

+37928
-5487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

960 files changed

+37928
-5487
lines changed

docs/router/config.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,10 @@
577577
"label": "View Transitions",
578578
"to": "framework/react/examples/view-transitions"
579579
},
580+
{
581+
"label": "Framer Motion",
582+
"to": "framework/react/examples/with-framer-motion"
583+
},
580584
{
581585
"label": "With tRPC",
582586
"to": "framework/react/examples/with-trpc"
@@ -606,6 +610,10 @@
606610
"label": "Quickstart (file-based)",
607611
"to": "framework/solid/examples/quickstart-file-based"
608612
},
613+
{
614+
"label": "Quickstart (code-based)",
615+
"to": "framework/solid/examples/quickstart"
616+
},
609617
{
610618
"label": "Basic (file-based)",
611619
"to": "framework/solid/examples/basic-file-based"
@@ -618,6 +626,18 @@
618626
"label": "Basic + Solid Query (code-based)",
619627
"to": "framework/solid/examples/basic-solid-query"
620628
},
629+
{
630+
"label": "Basic + SSR (file-based)",
631+
"to": "framework/solid/examples/basic-ssr-file-based"
632+
},
633+
{
634+
"label": "Basic + SSR Streaming (file-based)",
635+
"to": "framework/solid/examples/basic-ssr-streaming-file-based"
636+
},
637+
{
638+
"label": "Kitchen Sink (code-based)",
639+
"to": "framework/solid/examples/kitchen-sink"
640+
},
621641
{
622642
"label": "Kitchen Sink (file-based)",
623643
"to": "framework/solid/examples/kitchen-sink-file-based"
@@ -629,6 +649,50 @@
629649
{
630650
"label": "Kitchen Sink + Solid Query (code-based)",
631651
"to": "framework/solid/examples/kitchen-sink-solid-query"
652+
},
653+
{
654+
"label": "Location Masking",
655+
"to": "framework/solid/examples/location-masking"
656+
},
657+
{
658+
"label": "Authenticated Routes",
659+
"to": "framework/solid/examples/authenticated-routes"
660+
},
661+
{
662+
"label": "Scroll Restoration",
663+
"to": "framework/solid/examples/scroll-restoration"
664+
},
665+
{
666+
"label": "Deferred Data",
667+
"to": "framework/solid/examples/deferred-data"
668+
},
669+
{
670+
"label": "Navigation Blocking",
671+
"to": "framework/solid/examples/navigation-blocking"
672+
},
673+
{
674+
"label": "View Transitions",
675+
"to": "framework/solid/examples/view-transitions"
676+
},
677+
{
678+
"label": "Framer Motion",
679+
"to": "framework/solid/examples/with-framer-motion"
680+
},
681+
{
682+
"label": "With tRPC",
683+
"to": "framework/solid/examples/with-trpc"
684+
},
685+
{
686+
"label": "Monorepo basic",
687+
"to": "framework/solid/examples/router-monorepo-simple"
688+
},
689+
{
690+
"label": "Monorepo basic (with lazy loading)",
691+
"to": "framework/solid/examples/router-monorepo-simple-lazy"
692+
},
693+
{
694+
"label": "Monorepo with Solid Query",
695+
"to": "framework/solid/examples/router-monorepo-solid-query"
632696
}
633697
]
634698
}

docs/router/framework/react/api/router/MatchRouteOptionsType.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `MatchRouteOptions` type is used to describe the options that can be used wh
88
```tsx
99
interface MatchRouteOptions {
1010
pending?: boolean
11-
caseSensitive?: boolean
11+
caseSensitive?: boolean /* @deprecated */
1212
includeSearch?: boolean
1313
fuzzy?: boolean
1414
}
@@ -24,11 +24,12 @@ The `MatchRouteOptions` type has the following properties:
2424
- Optional
2525
- If `true`, will match against pending location instead of the current location
2626

27-
### `caseSensitive` property
27+
### ~~`caseSensitive`~~ property (deprecated)
2828

2929
- Type: `boolean`
3030
- Optional
3131
- If `true`, will match against the current location with case sensitivity
32+
- Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router
3233

3334
### `includeSearch` property
3435

docs/router/framework/react/guide/code-splitting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ If you are not able to use the automatic code-splitting feature, you can still c
104104
> [!IMPORTANT]
105105
> The `__root.tsx` route file, using either `createRootRoute` or `createRootRouteWithContext`, does not support code splitting, since it's always rendered regardless of the current route.
106106
107-
These are the only options that `createLazyFileRoute` support:
107+
These are the only options that `createLazyFileRoute` supports:
108108

109109
| Export Name | Description |
110110
| ------------------- | --------------------------------------------------------------------- |

docs/router/framework/react/how-to/debug-router-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const route = createRoute({
109109
```tsx
110110
// Debug route tree in console
111111
console.log('Route tree:', router.routeTree)
112-
console.log('All routes:', router.flatRoutes)
112+
console.log('All routes:', router.routesById)
113113
```
114114

115115
3. **Check Parent Route Configuration**
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
22
ref: docs/router/framework/react/guide/authenticated-routes.md
3-
replace: { 'react-router': 'solid-router' }
3+
replace:
4+
{
5+
'react-router': 'solid-router',
6+
'auth.isAuthenticated': 'auth.isAuthenticated()',
7+
'react': 'solid',
8+
}
49
---
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
title: Installation with Esbuild
3+
---
4+
5+
[//]: # 'BundlerConfiguration'
6+
7+
To use file-based routing with **Esbuild**, you'll need to install the `@tanstack/router-plugin` package.
8+
9+
```sh
10+
npm install -D @tanstack/router-plugin
11+
```
12+
13+
Once installed, you'll need to add the plugin to your configuration.
14+
15+
```tsx
16+
// build.js
17+
import * as esbuild from 'esbuild'
18+
import { solidPlugin } from 'esbuild-plugin-solid'
19+
import { tanstackRouter } from '@tanstack/router-plugin/esbuild'
20+
21+
const isDev = process.argv.includes('--dev')
22+
23+
const ctx = await esbuild.context({
24+
entryPoints: ['src/main.tsx'],
25+
outfile: 'dist/main.js',
26+
minify: !isDev,
27+
bundle: true,
28+
format: 'esm',
29+
target: ['esnext'],
30+
sourcemap: true,
31+
plugins: [
32+
solidPlugin(),
33+
tanstackRouter({ target: 'solid', autoCodeSplitting: true }),
34+
],
35+
})
36+
37+
if (isDev) {
38+
await ctx.watch()
39+
const { host, port } = await ctx.serve({ servedir: '.', port: 3005 })
40+
console.log(`Server running at http://${host || 'localhost'}:${port}`)
41+
} else {
42+
await ctx.rebuild()
43+
await ctx.dispose()
44+
}
45+
```
46+
47+
Or, you can clone our [Quickstart Esbuild example](https://github.com/TanStack/router/tree/main/examples/solid/quickstart-esbuild-file-based) and get started.
48+
49+
Now that you've added the plugin to your Esbuild configuration, you're all set to start using file-based routing with TanStack Router.
50+
51+
[//]: # 'BundlerConfiguration'
52+
53+
## Ignoring the generated route tree file
54+
55+
If your project is configured to use a linter and/or formatter, you may want to ignore the generated route tree file. This file is managed by TanStack Router and therefore shouldn't be changed by your linter or formatter.
56+
57+
Here are some resources to help you ignore the generated route tree file:
58+
59+
- Prettier - [https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore](https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore)
60+
- ESLint - [https://eslint.org/docs/latest/use/configure/ignore#ignoring-files](https://eslint.org/docs/latest/use/configure/ignore#ignoring-files)
61+
- Biome - [https://biomejs.dev/reference/configuration/#filesignore](https://biomejs.dev/reference/configuration/#filesignore)
62+
63+
> [!WARNING]
64+
> If you are using VSCode, you may experience the route tree file unexpectedly open (with errors) after renaming a route.
65+
66+
You can prevent that from the VSCode settings by marking the file as readonly. Our recommendation is to also exclude it from search results and file watcher with the following settings:
67+
68+
```json
69+
{
70+
"files.readonlyInclude": {
71+
"**/routeTree.gen.ts": true
72+
},
73+
"files.watcherExclude": {
74+
"**/routeTree.gen.ts": true
75+
},
76+
"search.exclude": {
77+
"**/routeTree.gen.ts": true
78+
}
79+
}
80+
```
81+
82+
You can use those settings either at a user level or only for a single workspace by creating the file `.vscode/settings.json` at the root of your project.
83+
84+
## Configuration
85+
86+
When using the TanStack Router Plugin with Esbuild for File-based routing, it comes with some sane defaults that should work for most projects:
87+
88+
```json
89+
{
90+
"routesDirectory": "./src/routes",
91+
"generatedRouteTree": "./src/routeTree.gen.ts",
92+
"routeFileIgnorePrefix": "-",
93+
"quoteStyle": "single"
94+
}
95+
```
96+
97+
If these defaults work for your project, you don't need to configure anything at all! However, if you need to customize the configuration, you can do so by editing the configuration object passed into the `tanstackRouter` function.
98+
99+
You can find all the available configuration options in the [File-based Routing API Reference](../../../../api/file-based-routing.md).
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Installation with Rspack
3+
---
4+
5+
[//]: # 'BundlerConfiguration'
6+
7+
To use file-based routing with **Rspack** or **Rsbuild**, you'll need to install the `@tanstack/router-plugin` package.
8+
9+
```sh
10+
npm install -D @tanstack/router-plugin
11+
```
12+
13+
Once installed, you'll need to add the plugin to your configuration.
14+
15+
```tsx
16+
// rsbuild.config.ts
17+
import { defineConfig } from '@rsbuild/core'
18+
import { pluginBabel } from '@rsbuild/plugin-babel'
19+
import { pluginSolid } from '@rsbuild/plugin-solid'
20+
import { tanstackRouter } from '@tanstack/router-plugin/rspack'
21+
22+
export default defineConfig({
23+
plugins: [
24+
pluginBabel({
25+
include: /\.(?:jsx|tsx)$/,
26+
}),
27+
pluginSolid(),
28+
],
29+
tools: {
30+
rspack: {
31+
plugins: [tanstackRouter({ target: 'solid', autoCodeSplitting: true })],
32+
},
33+
},
34+
})
35+
```
36+
37+
Or, you can clone our [Quickstart Rspack/Rsbuild example](https://github.com/TanStack/router/tree/main/examples/solid/quickstart-rspack-file-based) and get started.
38+
39+
Now that you've added the plugin to your Rspack/Rsbuild configuration, you're all set to start using file-based routing with TanStack Router.
40+
41+
[//]: # 'BundlerConfiguration'
42+
43+
## Ignoring the generated route tree file
44+
45+
If your project is configured to use a linter and/or formatter, you may want to ignore the generated route tree file. This file is managed by TanStack Router and therefore shouldn't be changed by your linter or formatter.
46+
47+
Here are some resources to help you ignore the generated route tree file:
48+
49+
- Prettier - [https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore](https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore)
50+
- ESLint - [https://eslint.org/docs/latest/use/configure/ignore#ignoring-files](https://eslint.org/docs/latest/use/configure/ignore#ignoring-files)
51+
- Biome - [https://biomejs.dev/reference/configuration/#filesignore](https://biomejs.dev/reference/configuration/#filesignore)
52+
53+
> [!WARNING]
54+
> If you are using VSCode, you may experience the route tree file unexpectedly open (with errors) after renaming a route.
55+
56+
You can prevent that from the VSCode settings by marking the file as readonly. Our recommendation is to also exclude it from search results and file watcher with the following settings:
57+
58+
```json
59+
{
60+
"files.readonlyInclude": {
61+
"**/routeTree.gen.ts": true
62+
},
63+
"files.watcherExclude": {
64+
"**/routeTree.gen.ts": true
65+
},
66+
"search.exclude": {
67+
"**/routeTree.gen.ts": true
68+
}
69+
}
70+
```
71+
72+
You can use those settings either at a user level or only for a single workspace by creating the file `.vscode/settings.json` at the root of your project.
73+
74+
## Configuration
75+
76+
When using the TanStack Router Plugin with Rspack (or Rsbuild) for File-based routing, it comes with some sane defaults that should work for most projects:
77+
78+
```json
79+
{
80+
"routesDirectory": "./src/routes",
81+
"generatedRouteTree": "./src/routeTree.gen.ts",
82+
"routeFileIgnorePrefix": "-",
83+
"quoteStyle": "single"
84+
}
85+
```
86+
87+
If these defaults work for your project, you don't need to configure anything at all! However, if you need to customize the configuration, you can do so by editing the configuration object passed into the `tanstackRouter` function.
88+
89+
You can find all the available configuration options in the [File-based Routing API Reference](../../../../api/file-based-routing.md).

0 commit comments

Comments
 (0)