0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
Commit graph

6,483 commits

Author SHA1 Message Date
Tanner Linsley
12a30c5d1f
docs: Identify top 10 how-to docs, add deployment guide (#4701)
<!-- One very short sentence on the WHAT and WHY of the PR. E.g. "Remove
pathHash attribute because it is confirmed unused." or "Add DNS round
robin to improve load distribution." -->
Add a comprehensive how-to guide for deploying TanStack Router to
production and establish a multi-PR process for future documentation.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-18 15:15:07 -06:00
Tanner Linsley
fcba1347e8 release: v1.128.4 v1.128.4 2025-07-18 20:32:28 +00:00
Arciom Picikin
a9270d3c12
fix(react-router): preserve ref type in createLink with required interface properties (#4674)
Fixes #4673

I a bit simplified the `UseLinkReactProps` to make more use of typing
from React (and this simplification just fixes the bug)
Also added a test to check that the bug is no longer reproduced
2025-07-18 22:25:22 +02:00
Tanner Linsley
33302b6cda
docs: Create TanStack Router installation how-to (#4700)
Add new 'How-To' documentation section for React with a terse
installation guide to provide bite-sized, task-oriented instructions.

This new section aims to provide extremely concise, step-by-step
instructions for common tasks, making it easier for users and AI to
quickly find and follow specific procedures. Existing guides that
previously contained detailed installation steps now reference this new,
focused how-to guide to avoid content duplication and improve
discoverability.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-18 13:41:21 -06:00
Tanner Linsley
3b8b2bc24a
docs: Document optional path params for i18n (#4699)
Add documentation for prefix-based internationalization (i18n) using
Optional Path Parameters.

This PR adds a comprehensive guide on implementing i18n patterns,
covering:
- Prefix-based i18n routing (e.g., `/{-$locale}/about`)
- Complex i18n patterns with multiple optional parameters
- Language navigation using function-style `params` for `Link`
components
- Advanced i18n with route groups
- SEO best practices (canonical URLs, hreflang)
- Type safety for locale validation

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-18 13:40:12 -06:00
Manuel Schiller
5b2dd557fe
fix: during route ranking, rank params higher if followed by a static segment (#4685)
fixes #4681
2025-07-18 10:49:42 -06:00
Tanner Linsley
9d9554c43f release: v1.128.3 v1.128.3 2025-07-17 22:38:48 +00:00
Sean Cassiere
6ed0caf0a5
docs(router): prefixes and suffixes for path params (#4690) 2025-07-18 10:34:32 +12:00
wookhyung
7c6d4c1325
fix(router-core): reset statusCode to 200 on navigation start (#4664)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-18 00:25:35 +02:00
Tanner Linsley
80e76377b5 release: v1.128.2 v1.128.2 2025-07-17 22:13:43 +00:00
Manuel Schiller
1b319d0485
fix: default to addHmr in dev if not set (#4689) 2025-07-18 00:12:11 +02:00
Nico Lynzaad
e90171ab38
fix: resolve flaky e2e tests on useServerFn redirect tests (#4688)
This PR addresses some flaky tests in the redirect e2e tests for
react-start and solid start.

Specifically, when testing external redirects use useServerFn it was
trying to reach out to http://example.com. This updates it to redirect
to the local dummy server.
2025-07-18 00:02:28 +02:00
Usman S. (Max Programming)
132bd0c6d3
docs(start): build-from-scratch guide to use customVite(React/Solid)Plugin (#4678)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
2025-07-17 23:00:02 +12:00
Tanner Linsley
4704c97779 release: v1.128.1 v1.128.1 2025-07-17 07:34:51 +00:00
wookhyung
1930152cca
fix(start-server-core): properly merge middleware context objects (#4665) 2025-07-17 19:29:51 +12:00
Flo
89c7b5d660
test(react-router,solid-router): test re-render for preload='viewport' (#4672) 2025-07-17 19:15:11 +12:00
Nico Lynzaad
3854370bdf
fix: assign random ports for e2e tests (#4676)
This is a follow on from #4653

This PR resolves flaky E2E tests caused by port collisions when running
tests in parallel.

Instead of deriving ports from package names (which can collide), this
new approach assigns a random, available port to each test server
instance.

Key Changes:

- Random Port Allocation: Each test server (Playwright, dummy servers)
gets a unique, random port at startup.
- File-based Sync: The server writes its assigned port to a port.txt
file in its test project directory, this is kept unique through using
the package name or another input string for the file name.
- Test Runner Sync: The test runner reads the port from that file to
build the correct URL.
- Automatic Cleanup: All port files are deleted at the start of each
test:e2e run to ensure fresh ports.

Local parallel runs (up to 10) have shown this to be stable and free of
collisions.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-17 07:24:59 +02:00
Tanner Linsley
b3a83c186f release: v1.128.0 v1.128.0 2025-07-16 19:49:23 +00:00
Tanner Linsley
a2424c0f02
feat: optional path params (#4597)
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
Co-authored-by: Indrek Ardel <indrek@ardel.eu>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-16 13:41:58 -06:00
Indrek Ardel
db1331f9b8
tests(solid-router): enable ClientOnly SSR test (#4666) 2025-07-16 19:58:35 +02:00
Flo
a719495cd8
fix(react-router) useLinkProps memoization and performance (#4668)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-16 19:45:45 +02:00
Tanner Linsley
4f71f6b398 release: v1.127.9 v1.127.9 2025-07-15 20:26:47 +00:00
Indrek Ardel
ba590c2111
fix(solid-router): prevent client effects running on server (#4621) 2025-07-15 22:19:37 +02:00
Sean Cassiere
aa1fb5d553
fix(router-plugin): composed plugin to consider options from json config (#4654) 2025-07-15 14:18:02 +12:00
Tanner Linsley
51307bb47b release: v1.127.8 v1.127.8 2025-07-14 21:14:10 +00:00
Manuel Schiller
41bf26b409
fix: allow createRouter to be async (#4652) 2025-07-14 23:12:36 +02:00
Ahmed Abdelbaset
1746c08918
docs(start): remove todo from Server Routes guide (#4650) 2025-07-14 22:43:26 +12:00
Tanner Linsley
5ecdd87fd2 release: v1.127.7 v1.127.7 2025-07-13 20:51:26 +00:00
Tim
d537b56ebd
fix(react-start-client): useServerFn returns a stable reference (#4647) 2025-07-13 22:46:39 +02:00
RawToast
9fb55b8863
docs: Update tsr.config.json options link (#4638)
The link at for tsr.config.json found [in this
section](https://tanstack.com/router/latest/docs/framework/react/migrate-from-react-location#differences-between-react-location-and-tanstack-router)
points to [this page about file routing styles in the
docs](https://tanstack.com/router/latest/docs/framework/react/routing/file-based-routing#options)

That doesn't seem right, when the `tsr.config.json` options are [found
here](https://tanstack.com/router/latest/docs/api/file-based-routing)

I've followed the docs in the `tanstack.com` page and checked this link
works as expected 😌
2025-07-13 09:45:18 +02:00
James Cleveland
3e4b024a6b
docs(start): list static prerendering options (#4635) 2025-07-13 11:56:19 +12:00
James Cleveland
fe01311cbb
docs: remove somewhat incorrect statement from docs (#4636)
There's absolutely no reason not to use TanStack Start for purely static
sites - it works great, and it means that if you then want to transition
a codebase to being dynamically SSR, it requires zero work!
2025-07-12 23:57:47 +02:00
anthony2261
71939c46c6
docs: Add enableBeforeUnload option example in navigation-blocking.md (#4634)
Added a note on using the `enableBeforeUnload` option in `useBlocker` +
example in the "Component-based blocking" section.

@schiller-manuel I wasn't sure if there should be an entire section for
this or just a note with 1-2 examples in the existing sections (I did
the latter).

Also thanks for pushing me to contribute even if it's a small one :)
2025-07-12 23:38:50 +02:00
Tanner Linsley
79b2c61841 release: v1.127.6 v1.127.6 2025-07-12 19:37:51 +00:00
James Cleveland
5f42bc4cb6
fix: allow prerender if no pages specified (#4632)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-12 21:28:01 +02:00
Tanner Linsley
dbbcd296f0 release: v1.127.5 v1.127.5 2025-07-12 19:22:40 +00:00
Juliusz Kościołek
6b55a33d69
fix: invalid path generation for params above groups routes (#4629)
Fixes #4599

# Previous behavior

```
$param
    (group)
        route.tsx
        index.tsx
```

when router-generator processes the `route.tsx` node, the `split`
variable


8df504c3a4/packages/router-generator/src/generator.ts (L1258)

will be `[ '$param', '(group)' ]`, and because the last part is a group


8df504c3a4/packages/router-generator/src/generator.ts (L1263)

the whole route will be generated as pathless, i.e.

```ts
const IndexRoute = IndexRouteImport.update({
  id: '/',
  path: '/',
  getParentRoute: () => rootRouteImport,
} as any)
const ParamgroupRouteRoute = ParamgroupRouteRouteImport.update({
  id: '/$param/(group)',
  ////////////////
  path: '/$param/', // <---- This will NOT be here without the fix
  ////////////////
  getParentRoute: () => rootRouteImport,
} as any)
const ParamgroupIndexRoute = ParamgroupIndexRouteImport.update({
  id: '/',
  path: '/',
  getParentRoute: () => ParamgroupRouteRoute,
} as any)
```

therefore the `$param` part of the path will be lost, and it won't be
included in `index.tsx`'s path resolution algorithm (in this case its
path would be `/`)

# Current behavior

When processing a route node, its path is skipped when all nodes between
it and the higher route are groups.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-12 21:14:48 +02:00
Tanner Linsley
db8ae23adc release: v1.127.4 v1.127.4 2025-07-12 00:19:16 +00:00
Onur Guvenc
bbc480aeda
fix(start-server-functions-server): add base path to the RPC URL (#4619) 2025-07-12 12:05:24 +12:00
Tanner Linsley
c1d38af5d3 release: v1.127.3 v1.127.3 2025-07-11 23:20:25 +00:00
Manuel Schiller
4b4562aea6
fix: don't run router.load() when hydrating only SSRed matches (#4630)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-12 01:18:27 +02:00
Nico Lynzaad
8df504c3a4
consider routeFileIgnorePattern when checking routePrefixes (#4626)
This PR closes #4623 by considering routeFileIgnorePattern when checking
for routeFilePrefix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-11 23:30:59 +02:00
Tanner Linsley
a4ae8bd735 release: v1.127.2 v1.127.2 2025-07-11 21:28:46 +00:00
kusiewicz
418ab856cc
fix: remove unused jsesc (#4628) 2025-07-11 23:21:08 +02:00
Tanner Linsley
0cf5cdc9c8 release: v1.127.1 v1.127.1 2025-07-11 17:58:01 +00:00
kusiewicz
c334ecf546
fix: remove debug log (#4604) 2025-07-11 19:49:35 +02:00
Tanner Linsley
121df623eb release: v1.127.0 v1.127.0 2025-07-10 22:26:56 +00:00
Manuel Schiller
6475b35057
feat: use seroval for SSR (#4600) 2025-07-11 00:25:32 +02:00
Tanner Linsley
d0ed7ce016 release: v1.126.2 v1.126.2 2025-07-10 21:04:59 +00:00
Nico Lynzaad
16e50e09bf
fix: resolve false positive "could not find match from" (#4610)
fixes #4284
2025-07-10 22:58:08 +02:00