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

5,805 commits

Author SHA1 Message Date
autofix-ci[bot]
3d09332664
ci: apply automated fixes 2026-02-06 18:38:00 +00:00
Manuel Schiller
43b1e547ea feat: add plugins 2026-02-06 19:35:37 +01:00
Manuel Schiller
f0452eb43b feat: add start context bridge 2026-02-05 23:32:36 +01:00
Tanner Linsley
bb0137d280 release: v1.158.3 v1.158.3 2026-02-05 21:50:29 +00:00
Manuel Schiller
b5b4079ded
fix: do not pass signal into server function (#5470)
* fix: do not pass signal into server function

* fix test

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-05 22:48:04 +01:00
Nick Nisi
6f64ae2ed0
examples: Update WorkOS example to use new AuthKit SDK (#5394)
* convert AuthKit example to use new SDK

* clean up and fixes

* remove vite dep in start-server-core

* fix(examples): remove unnecessary dotenv import from WorkOS example

Vite automatically loads .env files, so the manual dotenv.config() call is unnecessary and causes a build failure since dotenv is not installed as a dependency.

* fix lint issue

* fix(examples): fix WorkOS AuthKit sign-in and sign-out

- Add parentheses to handleCallbackRoute() in callback route
- Add reloadDocument to logout Links to prevent CORS errors
- Upgrade SDK to v0.5.0 and remove unused dependencies

The sign-out was failing with CORS errors because client-side
navigation via server functions caused fetch to follow the external
redirect to WorkOS. Using reloadDocument forces a full page navigation,
allowing the server to return a proper HTTP redirect.

* fix(examples): use re-exported User type from authkit package

Import User from @workos/authkit-tanstack-react-start instead of
@workos-inc/node to fix tsc --noEmit failure in CI. The authkit
package already re-exports this type to avoid server-only deps
in client code.

* fix(examples): restore authkit-tanstack-react-start dependency

Replace @workos-inc/node with @workos/authkit-tanstack-react-start
in the WorkOS example. The code imports from the authkit package,
not the low-level node SDK.

---------

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2026-02-05 22:27:37 +01:00
Tanner Linsley
54c4f68ade release: v1.158.2 v1.158.2 2026-02-05 21:06:41 +00:00
Manuel Schiller
f5bf1cdb32
fix: resolve env-only functions through module re-export chains (#6599)
fixes #6583
2026-02-05 21:59:39 +01:00
Tanner Linsley
119eb54f10 release: v1.158.1 v1.158.1 2026-02-05 01:50:59 +00:00
Lee
28b0e8b244
fix(router-core): fix handle AbortError logic when rapid navigation (#6426)
* fix(router-core): fix handle AbortError logic

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* ci: apply automated fixes

* test: update expected store update count for preloaded async loaders

Signed-off-by: leesb971204 <leesb971204@gmail.com>

* refractor changes

* update tests to handle wait times more appropriately

* tighten up test - coderabbit nitpick

---------

Signed-off-by: leesb971204 <leesb971204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
2026-02-05 03:38:09 +02:00
Shane
f7eaede2d1
docs: Add missing createMiddleware imports in documentation examples (#6500) 2026-02-03 21:12:15 -06:00
Alex Marinov
03c1165ac3
docs: update import statements for TanStack Router Vite plugin (#6575) 2026-02-03 21:09:58 -06:00
Pavan Shinde
5e30ea1f30
docs(start): fix typos in Solid quick start (#6571)
Co-authored-by: pavan-sh <pavan-sh@users.noreply.github.com>
2026-02-03 21:07:50 -06:00
Pavan Shinde
6049fd3c9b
docs(start): fix ISR guide link to data loading (#6585) 2026-02-03 21:03:52 -06:00
Tanner Linsley
8f59003275 release: v1.158.0 v1.158.0 2026-02-03 00:17:18 +00:00
Manuel Schiller
a894baa7bd
feat: pass routeId into context/beforeLoad (#6579)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-02-03 00:59:12 +01:00
Manuel Schiller
ebd96af435
fix: avoid destructuring internal server property in interpolatePath (#6580) 2026-02-03 00:53:03 +01:00
Manuel Schiller
77b18bbdae
fix: strip type exports upon DCE (#6582) 2026-02-03 00:48:33 +01:00
Tanner Linsley
916be3d635 release: v1.157.19 v1.157.19 2026-02-02 23:29:58 +00:00
Manuel Schiller
041e984871
fix: correctly search for parent route in generator (#6581) 2026-02-03 00:27:52 +01:00
Xun Qilong
46fc1e9130
docs: rename route property to routeId in NotFoundErrorType.md (#6544)
docs: fix typo in NotFoundErrorType.md

rename 'route' property to 'routeId'

Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
2026-02-01 15:45:59 +02:00
Pavan Shinde
ec4a6fa88c
docs: fix duplicated word in document head management guide (#6565) 2026-02-01 12:28:00 +02:00
Tanner Linsley
fd6eecea6b release: v1.157.18 v1.157.18 2026-01-31 15:42:17 +00:00
Flo
1ce1919c4b
refactor(router-core): matchRoutesInternal minor performance improvements (#6560) 2026-01-31 16:39:50 +01:00
Tanner Linsley
497229aa5b release: v1.157.17 v1.157.17 2026-01-30 22:27:03 +00:00
hokkyss
0f41a3c647
fix: re-export SerializableExtensions in react-router (#6536)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-30 23:13:04 +01:00
Alexander Schmid
5ae6217746
docs: Updated typo in internationalization-i18n.md (#6523)
* Updated typo in internationalization-i18n.md 

Optional path parameters typescript example had a typo (/abotu not /about).

* ci: apply automated fixes

* Fix typo in internationalization guide

reapply change that was undone by ci: apply automated fixes

---------

Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-27 00:19:24 +02:00
Tanner Linsley
b3aafa09d7 release: v1.157.16 v1.157.16 2026-01-26 22:06:20 +00:00
Jason Xie
4814d4ef90
fix(router-core): use encodeURIComponent for splat route params (#6520)
* fix(router-core): use encodeURIComponent for splat route params

Use encodeURIComponent instead of encodeURI for splat route parameters
to properly encode spaces, plus signs, and other special characters.

This fixes an SSR redirect loop that occurs when:
1. User navigates to a splat route with encoded characters (e.g., %20)
2. TanStack Router decodes params with decodeURIComponent
3. When rebuilding URL, encodeURI doesn't encode spaces/special chars
4. URL mismatch triggers redirect loop (307 redirects)

encodeURIComponent properly encodes these characters, preventing the
mismatch while still preserving forward slashes as path separators.

* update tests to use correct encoding for splat params

* use encodePathParam for splat/catch-all

* perf(router-core): add early return for URL-safe splat values

Add performance optimization that skips the split/map/join operation
when splat values only contain URL-safe characters (alphanumeric,
dash, period, underscore, tilde, exclamation, forward slash).

This avoids unnecessary processing in the hot path for common cases.

* fix(router-core): encode whitespace in encodeNonAscii

Update encodeNonAscii to also encode whitespace characters (spaces, tabs, etc.)
in addition to non-ASCII characters. This fixes SSR redirect loops where:

1. Request URL contains encoded spaces: /path/file%20name.pdf
2. parseLocation decodes pathname: /path/file name.pdf
3. buildLocation calls encodeNonAscii but spaces weren't encoded
4. URL mismatch triggers redirect loop

Now encodeNonAscii properly encodes:
- Whitespace characters (spaces become %20)
- Non-ASCII/unicode characters (including emojis)

Other ASCII special characters (parentheses, brackets, etc.) are preserved
as they are valid in URL paths.

* refactor(router-core): use regex in encodeNonAscii like original

* refactor(router-core): rename encodeNonAscii to encodePathLikeUrl

Rename the function to better reflect its expanded responsibility of
encoding paths the same way new URL() would, including:
- Whitespace characters (spaces → %20, tabs → %09)
- Non-ASCII/Unicode characters (emojis, accented characters)

The old name 'encodeNonAscii' was misleading since the function now
encodes more than just non-ASCII characters.

---------

Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
2026-01-26 23:53:20 +02:00
Tanner Linsley
080f818fda release: v1.157.15 v1.157.15 2026-01-26 06:51:04 +00:00
Flo
46630344d7
refactor(router-core): parseLocation fast path w/ no rewrites (#6516) 2026-01-26 07:36:11 +01:00
Flo
846fffc2cf
refactor(react-router): Match component performance w/ single router state select (#6518) 2026-01-26 07:35:26 +01:00
Tanner Linsley
58ed15460f release: v1.157.14 v1.157.14 2026-01-25 22:05:45 +00:00
Flo
02019f1164
refactor(router-core): executeBeforeLoad remove dead code (#6517) 2026-01-25 23:03:20 +01:00
Tanner Linsley
c16571a660 release: v1.157.13 v1.157.13 2026-01-25 21:22:25 +00:00
Flo
e2558a3007
refactor(router-core): startViewTransition performance improved by avoiding 'delete' (#6515) 2026-01-25 22:09:05 +01:00
Tanner Linsley
4748c0e12a release: v1.157.12 v1.157.12 2026-01-25 20:50:33 +00:00
Flo
283598e311
refactor(router-core): mergeHeaders performance (#6514) 2026-01-25 21:48:11 +01:00
Tanner Linsley
1faa9f3d96 release: v1.157.11 v1.157.11 2026-01-25 19:06:50 +00:00
Flo
54649f9d3e
refactor(router-core): throw redirect w/ a pre-build location doesn't need to re-parse from string (#6512) 2026-01-25 19:53:22 +01:00
Flo
3b61ca2090
test(react-start): new profiling scenario for search/loader/redirect (#6511) 2026-01-25 19:17:13 +01:00
Tanner Linsley
80bb8dd706 release: v1.157.10 v1.157.10 2026-01-25 18:10:48 +00:00
Flo
fc38d91997
refactor(router-core): remove dead code in buildLocation left over from reverting match snapshots (#6510) 2026-01-25 19:08:25 +01:00
Flo
e59c80070f
test(router-core): buildLocation unit tests (#6507) 2026-01-25 17:54:04 +01:00
Tanner Linsley
1bfa199175 release: v1.157.9 v1.157.9 2026-01-25 15:12:26 +00:00
Flo
ab92e1c290
refactor(router-core): buildLocation can skip second interpolatePath if no params.parse function in the branch (#6506) 2026-01-25 16:10:00 +01:00
Tanner Linsley
1287aa5367 release: v1.157.8 v1.157.8 2026-01-25 13:50:18 +00:00
Flo
b90726dcc8
refactor(router-core): server-only fast path optimization for interpolatePath (#6505) 2026-01-25 14:48:02 +01:00
Tanner Linsley
78943ba9c6 release: v1.157.7 v1.157.7 2026-01-25 11:06:28 +00:00
Flo
036b3b1d70
refactor(router-core): decodePath fast path when no encoded chars (#6504) 2026-01-25 12:04:06 +01:00