- Mark the `global` property of `NotFoundError` as deprecated
- Add a description for `headers`
- Sort the properties in order
Signed-off-by: leesb971204 <leesb971204@gmail.com>
Some of the properties of a route match in the store do not need to be
reactive (i.e. reactive = trigger the execution of all subscribers when
they change).
This PR proposes we add a `_nonReactive` key for storing these
properties.
Changes to properties in `_nonReactive` can be made like on a regular
object, without the need to call `__store.setState`, and without making
a shallow copy of the object.
The following properties were moved to `_nonReactive` (but more would be
welcome if we can find which ones):
- `beforeLoadPromise`
- `loaderPromise`
- `pendingTimeout`
- `loadPromise`
- `displayPendingPromise`
- `minPendingPromise`
- `dehydrated`
This results in the removal of 4 `updateMatch` calls in `router-core`.
At least 1 of which is in the hot-path of a navigation (`loadMatches` >
`validResolvedMatches.forEach`). And the removal of 2 `updateMatch`
calls in `packages/react-router/src/Match.tsx` (and solid-router too).
The `ssr` property was also updated to not be reactive, but kept outside
of `_nonReactive` because it is part of the public API. This removes
another call to `updateMatch`. This key is an exception, and if in the
future we find a need to have more "public but non-reactive" properties,
we could consider
- hiding internal props in a separate type, or
- adding a dev proxy to ensure non-reactive props aren't accessed inside
`select` functions
---
This PR adds a unit-test in `react-router` that counts how many times
the `select` inside a `useRouterState` hook is called during a
navigation. Without this PR, the result of this test is **26 calls**.
With this PR, we're down to **19 calls**.
---
Should be a partial improvement of
https://github.com/TanStack/router/issues/4359
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Add 'Navigate with Search Parameters' how-to guide covering various
navigation methods for search parameters.
This guide details how to update and manage search parameters using both
Link components and programmatic navigation (`useNavigate`, router
instance). It covers basic and functional updates, navigation with route
changes, advanced patterns like conditional navigation and validation,
common UI patterns (search results, filters, breadcrumbs), and addresses
common problems like losing parameters or serialization issues.
---
[Open in
Web](https://cursor.com/agents?id=bc-38c6eb35-f409-43fc-ac4c-323097fb478b)
• [Open in
Cursor](https://cursor.com/background-agent?bcId=bc-38c6eb35-f409-43fc-ac4c-323097fb478b)
• [Open Docs](https://docs.cursor.com/background-agent/web-and-mobile)
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
With discussions with @schiller-manuel and the amount of time this issue
has been brought up on Discord, I feel adding precisions and more
explicit examples on how to deal with runtime env variables on the
client could help.
---------
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
## 🎯 Changes
- Update Prettier and use experimental CLI
- Update Nx to v21
- Fix bug in test exposed by new prettier version
- Sync issues template
## ✅ Checklist
- [x] I have followed the steps listed in the [Contributing
guide](https://github.com/TanStack/config/blob/main/CONTRIBUTING.md).
- [x] I have tested and linted this code locally.
Add a comprehensive migration guide from React Router v7 to TanStack
Router, addressing feedback to target the latest version.
The original PR #4704 aimed to provide a migration guide from React
Router v6. However, a comment from schiller-manuel questioned why v6 was
targeted instead of v7. This PR updates the scope to focus on React
Router v7, which was released in November 2024 and is the current
version, ensuring the guide is relevant for users migrating from the
latest React Router.
---
[Open in
Web](https://cursor.com/agents?id=bc-035967dd-2396-4ba3-9226-f0bfd1c21f11)
• [Open in
Cursor](https://cursor.com/background-agent?bcId=bc-035967dd-2396-4ba3-9226-f0bfd1c21f11)
Learn more about [Background
Agents](https://docs.cursor.com/background-agent/web-and-mobile)
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Add a comprehensive "How to Set Up Server-Side Rendering (SSR)" guide to
provide practical, step-by-step instructions and address feedback from
PR #4703.
The previous PR #4703 aimed to add an SSR setup guide but had concerns
regarding overlap with an existing conceptual SSR guide and specific
technical implementation details (e.g., streaming SSR, Vite config).
This PR addresses those concerns by creating a distinct, practical
"how-to" guide with complete code examples, troubleshooting, and a clear
recommendation for TanStack Start, while ensuring it complements the
existing theoretical guide.
---
[Open in
Web](https://cursor.com/agents?id=bc-8555f196-638f-4bec-90a4-5eac52b5918a)
• [Open in
Cursor](https://cursor.com/background-agent?bcId=bc-8555f196-638f-4bec-90a4-5eac52b5918a)
Learn more about [Background
Agents](https://docs.cursor.com/background-agent/web-and-mobile)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>