Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2760a56
fix(start-client-core): export `OptionalFetcher` type (#4001)
dccarmo Apr 19, 2025
231230e
release: v1.116.2
tannerlinsley Apr 19, 2025
fc1f362
test(router-core): cases for `interpolatePath` and `matchPathname` (#…
SeanCassiere Apr 21, 2025
9cb6719
fix(start-client-core): fix no implicit any in validators (#4032)
chorobin Apr 22, 2025
82eb7b6
release: v1.116.3
tannerlinsley Apr 22, 2025
431dec2
docs(start): remove trailing commas from "build-from-scratch" (#4029)
sevignator Apr 23, 2025
1f2642b
feat(router-core): allow dynamic `ViewTransition` types (#4031)
burakcan Apr 23, 2025
3cbb3e8
release: v1.117.0
tannerlinsley Apr 23, 2025
bbbcb9c
Update overview.md
tannerlinsley Apr 23, 2025
fff6941
Update overview.md
tannerlinsley Apr 23, 2025
afdafcf
fix: pending component handling for initial load (#4044)
schiller-manuel Apr 24, 2025
5bf73ea
release: v1.117.1
tannerlinsley Apr 24, 2025
6fcf118
fix(router-plugin): do not split the `pendingComponent` (#4047)
SeanCassiere Apr 25, 2025
a3c8bfe
release: v1.117.2
tannerlinsley Apr 25, 2025
7ab6f56
docs(router): update link to `create-tsrouter-app` options
SeanCassiere Apr 25, 2025
cc0d468
chore(create-router,create-start): remove user app init packages (#4049)
SeanCassiere Apr 25, 2025
8edeeaa
feat: allow use of nitro zero conf (#3993)
pieh Apr 25, 2025
c23fe1d
Update ci.yml
schiller-manuel Apr 25, 2025
99b0977
Update pr.yml
schiller-manuel Apr 25, 2025
413a56a
docs: fix broken link (#4055)
Balastrong Apr 26, 2025
13f8559
bump deps (#4057)
schiller-manuel Apr 26, 2025
5e1354c
release: v1.118.0
tannerlinsley Apr 26, 2025
285cff7
docs(start): fix key on changing the base path for API routes (#4062)
icflorescu Apr 30, 2025
12eb142
feat(router-devtools-core): add navigation link to route (#4048)
scarf005 Apr 30, 2025
91ae17d
release: v1.119.0
tannerlinsley Apr 30, 2025
1cfb6e2
fix(react-router-devtools): remove useRouter warning for panel (#4070)
freshgiammi Apr 30, 2025
d4aaf7e
release: v1.119.1
tannerlinsley Apr 30, 2025
eb649e7
docs(start): fix typos in the hosting guide (#4073)
maxz411 May 1, 2025
5e08ac5
docs(router): add ignore prefix into the file naming conventions guid…
chukamorka May 1, 2025
191a1c8
docs(router): walkthrough on using the ignore prefix for component co…
chukamorka May 1, 2025
d2a1a04
fix(directive-functions-plugin): do not exclude generator functions (…
SeanCassiere May 4, 2025
c1ad053
release: v1.119.2
tannerlinsley May 4, 2025
42156fb
fix the uptdated link for file base routing (#4085)
AllenFang May 4, 2025
8672ec7
chore(examples): match `env.example` with config for `authenticated-r…
ihaback May 4, 2025
ba8a1c8
Adding Tutorial for Reading and Writing a File (#4089)
shrutikapoor08 May 5, 2025
409252e
docs(start): fix typos in logos (#4090)
ilkome May 5, 2025
697bca0
test(directive-functions-plugin): add yields to generators (#4096)
SeanCassiere May 5, 2025
f0dbf0a
docs(router): update working in the "route-trees" guide (#4091)
mirorauhala May 5, 2025
5eeb123
feat: add bindings for `Route.Link` and `routeApi.Link` (#4095)
chorobin May 6, 2025
468edac
release: v1.120.0
tannerlinsley May 6, 2025
2c37ce2
fix: use this.fullPath instead of useRouter (#4099)
chorobin May 6, 2025
3ab84a8
release: v1.120.1
tannerlinsley May 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
'package: arktype-adapter':
- 'packages/arktype-adapter/**/*'
'package: create-router':
- 'packages/create-router/**/*'
'package: create-start':
- 'packages/create-start/**/*'
'package: directive-functions-plugin':
- 'packages/directive-functions-plugin/**/*'
'package: eslint-plugin-router':
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
SERVER_PRESET: 'node-server'

permissions:
contents: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ concurrency:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
SERVER_PRESET: 'node-server'

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion docs/router/framework/react/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ File based route generation (through Vite, and other supported bundlers) is the
npx create-tsrouter-app@latest my-app --template file-router
```

See [create-tsrouter-app](https://github.com/TanStack/create-tsrouter-app) for more options.
See [create-tsrouter-app](https://github.com/TanStack/create-tsrouter-app/tree/main/cli/create-tsrouter-app) for more options.

### Manual Setup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ File-based routing requires that you follow a few simple file naming conventions
| **`$` Token** | Route segments with the `$` token are parameterized and will extract the value from the URL pathname as a route `param`. |
| **`_` Prefix** | Route segments with the `_` prefix are considered to be pathless layout routes and will not be used when matching its child routes against the URL pathname. |
| **`_` Suffix** | Route segments with the `_` suffix exclude the route from being nested under any parent routes. |
| **`-` Prefix** | Files and folders with the `-` prefix are excluded from the route tree. They will not be added to the `routeTree.gen.ts` file and can be used to colocate logic in route folders. |
| **`(folder)` folder name pattern** | A folder that matches this pattern is treated as a **route group**, preventing the folder from being included in the route's URL path. |
| **`index` Token** | Route segments ending with the `index` token (before any file extensions) will match the parent route when the URL pathname matches the parent route exactly. This can be configured via the `indexToken` configuration option, see [options](../../../api/file-based-routing.md#indextoken). |
| **`.route.tsx` File Type** | When using directories to organise routes, the `route` suffix can be used to create a route file at the directory's path. For example, `blog.post.route.tsx` or `blog/post/route.tsx` can be used as the route file for the `/blog/post` route. This can be configured via the `routeToken` configuration option, see [options](../../../api/file-based-routing.md#routetoken). |
Expand Down
11 changes: 4 additions & 7 deletions docs/router/framework/react/routing/route-trees.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ title: Route Trees

TanStack Router uses a nested route tree to match up the URL with the correct component tree to render.

To build a route tree, TanStack Router supports both:
To build a route tree, TanStack Router supports:

- File-Based Routing
- Code-Based Routing
- [File-Based Routing](./file-based-routing.md)
- [Code-Based Routing](./code-based-routing.md)

Both methods support the exact same core features and functionality, but **file-based routing requires less code for the same or better results**. For this reasons, **file-based routing is the preferred and recommended way to configure TanStack Router and most of the documentation is written from the perspective of file-based routing**

For code-based routing documentation, please see
the [Code-Based Routing](./code-based-routing.md) guide.
Both methods support the exact same core features and functionality, but **file-based routing requires less code for the same or better results**. For this reason, **file-based routing is the preferred and recommended way** to configure TanStack Router. Most of the documentation is written from the perspective of file-based routing.

## Route Trees

Expand Down
44 changes: 44 additions & 0 deletions docs/router/framework/react/routing/routing-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,50 @@ The following table shows which component will be rendered based on the URL:
- The `posts.$postId.tsx` route is nested as normal under the `posts.tsx` route and will render `<Posts><Post>`.
- The `posts_.$postId.edit.tsx` route **does not share** the same `posts` prefix as the other routes and therefore will be treated as if it is a top-level route and will render `<PostEditor>`.

## Excluding Files and Folders from Routes

Files and folders can be excluded from route generation with a `-` prefix attached to the file name. This gives you the ability to colocate logic in the route directories.

Consider the following route tree:

```
routes/
├── posts.tsx
├── -posts-table.tsx // 👈🏼 ignored
├── -components/ // 👈🏼 ignored
│ ├── header.tsx // 👈🏼 ignored
│ ├── footer.tsx // 👈🏼 ignored
│ ├── ...
```

We can import from the excluded files into our posts route

```tsx
import { createFileRoute } from '@tanstack/react-router'
import { PostsTable } from './-posts-table'
import { PostsHeader } from './-components/header'
import { PostsFooter } from './-components/footer'

export const Route = createFileRoute('/posts')({
loader: () => fetchPosts(),
component: PostComponent,
})

function PostComponent() {
const posts = Route.useLoaderData()

return (
<div>
<PostsHeader />
<PostsTable posts={posts} />
<PostsFooter />
</div>
)
}
```

The excluded files will not be added to `routeTree.gen.ts`.

## Pathless Route Group Directories

Pathless route group directories use `()` as a way to group routes files together regardless of their path. They are purely organizational and do not affect the route tree or component tree in any way.
Expand Down
2 changes: 1 addition & 1 deletion docs/router/framework/solid/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ File based route generation (through Vite, and other supported bundlers) is the
npx create-tsrouter-app@latest my-app --framework solid --template file-router
```

See [create-tsrouter-app](https://github.com/TanStack/create-tsrouter-app) for more options.
See [create-tsrouter-app](https://github.com/TanStack/create-tsrouter-app/tree/main/cli/create-tsrouter-app) for more options.

### Manual Setup

Expand Down
15 changes: 15 additions & 0 deletions docs/start/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@
]
}
]
},
{
"label": "Tutorials",
"children": [],
"frameworks": [
{
"label": "react",
"children": [
{
"label": "Reading and Writing a File",
"to": "framework/react/reading-writing-file"
}
]
}
]
}
]
}
2 changes: 1 addition & 1 deletion docs/start/framework/react/api-routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ API Routes are a powerful feature of TanStack Start that allow you to create ser

By default, API Routes are defined in your `./app/routes/api` directory of your project and are automatically handled by the TanStack Start server.

> 🧠 This means that by default, your API Routes will be prefixed with `/api` and will be served from the same server as your application. You can customize this base path by changing the `server.apiBaseURL` in your TanStack Start config.
> 🧠 This means that by default, your API Routes will be prefixed with `/api` and will be served from the same server as your application. You can customize this base path by changing the `tsr.apiBase` in your TanStack Start config.

## File Route Conventions

Expand Down
6 changes: 3 additions & 3 deletions docs/start/framework/react/build-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ npm init -y

We highly recommend using TypeScript with TanStack Start. Create a `tsconfig.json` file with at least the following settings:

```jsonc
```json
{
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"module": "ESNext",
"target": "ES2022",
"skipLibCheck": true,
"strictNullChecks": true,
},
"strictNullChecks": true
}
}
```

Expand Down
6 changes: 3 additions & 3 deletions docs/start/framework/react/hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Or you can use the `--preset` flag with the `build` command to specify the deplo
npm run build --preset netlify
```

Deploy you application to Netlify using their one-click deployment process, and you're ready to go!
Deploy your application to Netlify using their one-click deployment process, and you're ready to go!

### Vercel

Expand All @@ -86,7 +86,7 @@ Or you can use the `--preset` flag with the `build` command to specify the deplo
npm run build --preset vercel
```

Deploy you application to Vercel using their one-click deployment process, and you're ready to go!
Deploy your application to Vercel using their one-click deployment process, and you're ready to go!

### Cloudflare Pages

Expand Down Expand Up @@ -127,7 +127,7 @@ compatibility_flags = ["nodejs_compat"]
compatibility_date = "2024-11-13"
```

Deploy you application to Cloudflare Pages using their one-click deployment process, and you're ready to go!
Deploy your application to Cloudflare Pages using their one-click deployment process, and you're ready to go!

### Node.js

Expand Down
2 changes: 1 addition & 1 deletion docs/start/framework/react/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const requestLogger = createMiddleware()

## Reading/Modifying the Server Response

Middleware that uses the `server` method executes in the same context as server functions, so you can follow the exact same [Server Function Context Utilities](./server-functions#server-function-context) to read and modify anything about the request headers, status codes, etc.
Middleware that uses the `server` method executes in the same context as server functions, so you can follow the exact same [Server Function Context Utilities](../server-functions#server-function-context) to read and modify anything about the request headers, status codes, etc.

## Modifying the Client Request

Expand Down
23 changes: 16 additions & 7 deletions docs/start/framework/react/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ TanStack Start is not for you if:

TanStack works closely with our partners to provide the best possible developer experience while also providing solutions that work anywhere and are vetted by industry experts. Each of our partners plays a unique role in the TanStack ecosystem:

- **Clerk**
<a href="https://go.clerk.com/wOwHtuJ" alt="Clerk Logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-dark.svg" style="height: 40px;">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-light.svg" style="height: 40px;">
<img alt="Clerk logo" src="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-light.svg" style="height: 40px;">
</picture>
</a>
The best possible authentication experience for modern web applications, including TanStack Start applications. Clerk provides TanStack Start users with first-class integrations and solutions to auth and collaborates closely with the TanStack team to ensure that TanStack Start provides APIs that are up to date with the latest in auth best practices.
- **Netlify**
<a href="https://www.netlify.com?utm_source=tanstack" alt="Netlify Logo">
<picture>
Expand All @@ -77,15 +86,15 @@ TanStack works closely with our partners to provide the best possible developer
</picture>
</a>
The leading hosting platform for web applications that provides a fast, secure, and reliable environment for deploying your web applications. We work closely with Netlify to ensure that TanStack Start applications not only deploy seamlessly to their platform, but also implement best practices for performance, security, and reliability regardless of where you end up deploying.
- **Clerk**
<a href="https://go.clerk.com/wOwHtuJ" alt="Clerk Logo">
- **Neon**
<a href="https://neon.tech?utm_source=tanstack" alt="Neon Logo">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-dark.svg" style="height: 40px;">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-light.svg" style="height: 40px;">
<img alt="Convex logo" src="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/clerk-logo-light.svg" style="height: 40px;">
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/neon-dark.svg" style="height: 60px;">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/neon-light.svg" style="height: 60px;">
<img alt="Neon logo" src="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/neon-light.svg" style="height: 60px;">
</picture>
</a>
The best possible authentication experience for modern web applications, including TanStack Start applications. Clerk provides TanStack Start users with first-class integrations and solutions to auth and collaborates closely with the TanStack team to ensure that TanStack Start provides APIs that are up to date with the latest in auth best practices.
A serverless, autoscaling Postgres solution purpose-built for modern full-stack apps. Neon offers rich integration opportunities with TanStack Start, including server functions and database-backed routing. Together, we’re simplifying the database experience for developers using TanStack.
- **Convex**
<a href="https://convex.dev?utm_source=tanstack" alt="Convex Logo">
<picture>
Expand All @@ -100,7 +109,7 @@ TanStack works closely with our partners to provide the best possible developer
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/sentry-wordmark-light.svg" style="height: 60px;">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/sentry-wordmark-dark.svg" style="height: 60px;">
<img alt="Convex logo" src="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/sentry-wordmark-light.svg" style="height: 60px;">
<img alt="Sentry logo" src="https://raw.githubusercontent.com/tanstack/tanstack.com/main/app/images/sentry-wordmark-light.svg" style="height: 60px;">
</picture>
</a>
A powerful, full-featured observability platform that integrates seamlessly with TanStack Start. Sentry helps developers monitor and fix crashes in real-time and provides insights into your application's performance and error tracking. Sentry collaborates closely with the TanStack team to ensure that TanStack Start provides APIs that are up to date with the latest in observability best practices.
Expand Down
Loading