Skip to content

Commit 864f936

Browse files
Merge branch 'main' into fix-intent
2 parents e3e7c10 + 3526194 commit 864f936

319 files changed

Lines changed: 9818 additions & 2739 deletions

File tree

Some content is hidden

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

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ body:
66
value: |
77
Thank you for reporting an issue :pray:.
88
9-
This issue tracker is for reporting bugs found in `router` (https://github.com/tanstack/router).
9+
This issue tracker is for reporting bugs found in TanStack Router and/or Start.
1010
If you have a question about how to achieve something and are struggling, please post a question
1111
inside of `router` Discussions tab: https://github.com/tanstack/router/discussions
1212
1313
Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already:
14-
- `router` Issues tab: https://github.com/tanstack/router/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
15-
- `router` closed issues tab: https://github.com/tanstack/router/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
16-
- `router` Discussions tab: https://github.com/tanstack/router/discussions
14+
- Issues tab: https://github.com/tanstack/router/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
15+
- closed issues tab: https://github.com/tanstack/router/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed
16+
- Discussions tab: https://github.com/tanstack/router/discussions
1717
1818
The more information you fill in, the better the community can help you.
1919
- type: dropdown
@@ -36,21 +36,22 @@ body:
3636
- type: input
3737
id: link
3838
attributes:
39-
label: Your Example Website or App
39+
label: Complete minimal reproducer
4040
description: |
41-
Which website or app were you using when the bug happened?
42-
Note:
43-
- Please provide a link via our pre-configured Stackblitz project ([file-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Fmain.tsx)|[code-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart?file=src%2Fmain.tsx)) or a link to a repo that can reproduce the issue.
44-
- Your bug will may get fixed much faster if we can run your code and it doesn't have dependencies other than the `router` npm package / dependency.
45-
- To create a shareable code example you can use Stackblitz. Please no localhost URLs.
46-
- Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve.
41+
Bug reports need a complete minimal reproducer project.
42+
The reproducer project must be
43+
- either a Stackblitz project (use this pre-configured Stackblitz project ([file-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart-file-based?file=src%2Fmain.tsx)|[code-based routes](https://stackblitz.com/github/tanstack/router/tree/main/examples/react/quickstart?file=src%2Fmain.tsx)))
44+
- or a public git repo.
45+
In case of a git repo, the issue must be reproducible **directly** after cloning and installing dependencies.
46+
47+
If you dont supply a reproducer that meets the above requirements, this issue will be closed.
4748
placeholder: reproduction URL
4849
validations:
4950
required: true
5051
- type: textarea
5152
id: steps
5253
attributes:
53-
label: Steps to Reproduce the Bug or Issue
54+
label: Steps to Reproduce the Bug
5455
description: Describe the steps we have to take to reproduce the behavior.
5556
placeholder: |
5657
1. Go to '...'

‎docs/router/api/router/RouteOptionsType.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ The `RouteOptions` type accepts an object with the following properties:
7979

8080
### `params.parse` method
8181

82-
- Type: `(rawParams: Record<string, string>) => TParams`
82+
- Type: `(rawParams: Record<string, string>) => TParams | false`
8383
- Optional
84-
- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function does not throw, its return value will be used as the route's params and the return type will be inferred into the rest of the router.
84+
- A function that will be called when this route is matched and passed the raw params from the current location and return valid parsed params. If this function throws, the route will be put into an error state and the error will be thrown during render. If this function returns parsed params, its return value will be used as the route's params and the return type will be inferred into the rest of the router.
85+
- Experimental: returning `false` during incoming route matching skips this route and allows matching to continue to another candidate route.
8586

8687
### `params.stringify` method
8788

‎docs/router/guide/authenticated-routes.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ title: Authenticated Routes
55

66
Authentication is an extremely common requirement for web applications. In this guide, we'll walk through how to use TanStack Router to build protected routes, and how to redirect users to login if they try to access them.
77

8+
> **A route guard does not protect a server function.** This guide shows how to gate a route's UI behind `beforeLoad`. If you also have a `createServerFn` that fetches sensitive data, the route guard does NOT stop a direct request to that RPC — server functions are reachable by POST regardless of which route renders them. Pair routing-side guards with **handler-level enforcement** (auth middleware or in-handler check). See [Authentication Server Primitives](../../start/framework/react/guide/authentication-server-primitives.md) in the Start docs.
9+
810
## The `route.beforeLoad` Option
911

1012
The `route.beforeLoad` option allows you to specify a function that will be called before a route is loaded. It receives all of the same arguments that the `route.loader` function does. This is a great place to check if a user is authenticated, and redirect them to a login page if they are not.

‎docs/router/guide/ssr.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ title: SSR
88
99
Server Side Rendering (SSR) is the process of rendering a component on the server and sending the HTML markup to the client. The client then hydrates the markup into a fully interactive component.
1010

11+
> **TanStack Router is not Next.js, Remix, or React Router DOM.** When generating routes or components, do **not** use `src/pages/`, `app/layout.tsx`, `_app/index.tsx`, `getServerSideProps`, `getStaticProps`, Remix-style `loader`/`action` exports, or imports from `react-router-dom` or `next/`. TanStack uses `src/routes/` with `createFileRoute`, `Link`/`useNavigate`/`redirect` from `@tanstack/react-router`, and (for Start) `createServerFn` from `@tanstack/<framework>-start`. Wrong-framework code typically fails to build or produces conflicting `/` routes at runtime.
12+
1113
There are usually two different flavors of SSR to be considered:
1214

1315
- Non-streaming SSR

‎docs/router/integrations/query.md‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,6 @@ export function getRouter() {
132132
- `useSuspenseQuery`: runs on the server during SSR when its data is required and will be streamed to the client as it resolves.
133133
- `useQuery`: does not execute on the server; it will fetch on the client after hydration. Use this for data that is not required for SSR.
134134

135-
```tsx
136-
// Suspense: executes on server and streams
137-
const { data } = useSuspenseQuery(postsQuery)
138-
139-
// Non-suspense: executes only on client
140-
const { data, isLoading } = useQuery(postsQuery)
141-
```
142-
143135
<!-- ::start:framework -->
144136

145137
# React

‎docs/start/config.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@
137137
"label": "Server Entry Point",
138138
"to": "framework/react/guide/server-entry-point"
139139
},
140+
{
141+
"label": "Early Hints",
142+
"to": "framework/react/guide/early-hints"
143+
},
140144
{
141145
"label": "CDN Asset URLs",
142146
"to": "framework/react/guide/cdn-asset-urls"
@@ -254,6 +258,10 @@
254258
"label": "Server Entry Point",
255259
"to": "framework/solid/guide/server-entry-point"
256260
},
261+
{
262+
"label": "Early Hints",
263+
"to": "framework/solid/guide/early-hints"
264+
},
257265
{
258266
"label": "Client Entry Point",
259267
"to": "framework/solid/guide/client-entry-point"

‎docs/start/framework/react/comparison.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Key differences:
217217
- Start's server functions support both client and server middleware
218218
- Start has built-in input validation
219219
- Start's approach is more explicit about the client/server boundary
220+
- Start's server functions support both GET and POST methods (configurable via the `method` option, defaults to GET), while Next.js Server Actions only support POST.
220221
- Next.js Server Actions integrate more seamlessly with forms
221222

222223
### Middleware Architecture

‎docs/start/framework/react/guide/authentication-overview.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ title: Authentication
109109

110110
### 🛠️ DIY Authentication
111111

112-
Build your own authentication system using TanStack Start's server functions and session management:
112+
Build your own authentication system using TanStack Start's server functions and session management. Start with the [Authentication Server Primitives](./authentication-server-primitives.md) guide — it covers session cookies (`HttpOnly`/`Secure`/`SameSite`/`__Host-`), session lookup as middleware, OAuth `state` + PKCE, password-reset enumeration defense, CSRF, rate limiting, and session rotation, with the WRONG/CORRECT patterns that catch the common mistakes.
113113

114114
- **Full Control**: Complete customization over authentication flow
115-
- **Server Functions**: Secure authentication logic on the server
116-
- **Session Management**: Built-in session handling with HTTP-only cookies
115+
- **Server Primitives**: Sessions, OAuth, CSRF, rate limiting — see [Authentication Server Primitives](./authentication-server-primitives.md)
116+
- **Session Management**: HTTP-only cookies via `setResponseHeader`, read with `getRequestHeader`
117117
- **Type Safety**: End-to-end type safety for authentication state
118118

119119
### 🌐 Other Excellent Options
@@ -226,6 +226,7 @@ Build your own authentication system using TanStack Start's server functions and
226226

227227
**Implementation Guides:**
228228

229+
- [Authentication Server Primitives](./authentication-server-primitives.md) — sessions, cookies, OAuth, CSRF, rate limiting (the server half)
229230
- [Authentication Patterns](./authentication.md)
230231
- [Router Authentication Guide](/router/latest/docs/framework/react/guide/authenticated-routes)
231232

0 commit comments

Comments
 (0)