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

6,634 commits

Author SHA1 Message Date
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
Tanner Linsley
8727eb504b release: v1.157.6 v1.157.6 2026-01-25 09:21:31 +00:00
Flo
84553e9298
refactor(router-core): improve server store performance by removing getter/setter (#6502) 2026-01-25 10:19:05 +01:00
Flo
db94c3147e
test(react-start): add new flame+autocannon benchmark for nested routes + useParams (#6501) 2026-01-25 09:54:09 +01:00
Manuel Schiller
8f525a80a6
performance: no reactivity on the server (#6497)
* performance: don't use `replaceEqualDeep` on the server

* performance: do not subscribe to store on the server

* lint

* simple store on the server

* vue + solid
2026-01-25 02:34:39 +01:00
Tanner Linsley
5b03a4063f release: v1.157.5 v1.157.5 2026-01-24 22:35:27 +00:00
Manuel Schiller
ba47d4db6e
refactor: streaming perf (#6496) 2026-01-24 23:33:20 +01:00
Tanner Linsley
f9b53eb3fb release: v1.157.4 v1.157.4 2026-01-24 20:46:03 +00:00
Manuel Schiller
44fbe0a46e
fix: streaming race condition (#6495) 2026-01-24 21:43:50 +01:00
Tanner Linsley
795ee1b2ac release: v1.157.3 v1.157.3 2026-01-24 16:57:36 +00:00
Manuel Schiller
0fc75f29e4
fix: re-export correctly (#6489)
* fix: re-export correctly

* fix

* fix

* lint
2026-01-24 17:55:28 +01:00
boda
3aa27d59a8
docs(router): URL encoding note on <Link/> and how to opt out (#6443)
* docs(router): Add URL encoding note on <Link/> and opt out with pathParamsAllowedCharacters

* Update docs/router/framework/react/api/router/linkComponent.md

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* rabbit suggestion

* convert to link

* ci: apply automated fixes

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
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-24 15:00:59 +02:00
Tanner Linsley
4b271eba06 release: v1.157.2 v1.157.2 2026-01-24 12:52:02 +00:00
Manuel Schiller
cc01174e78
refactor: react link ssr perf (#6482)
* ```
[1] 52k requests in 30.01s, 652 MB read
[1]
[1] === SSR Benchmark Results ===
[1] Total requests: 48512
[1] Requests/sec: 1617.07
[1] Latency (avg): 3.85ms
[1] Latency (p99): 12ms
[1] Throughput: 20.72 MB/s
```

* ```
[1] 53k requests in 30.01s, 672 MB read
[1]
[1] === SSR Benchmark Results ===
[1] Total requests: 50006
[1] Requests/sec: 1666.87
[1] Latency (avg): 3.67ms
[1] Latency (p99): 11ms
[1] Throughput: 21.36 MB/s
```

* fix merge conflicts

* rules of hooks

* ci: apply automated fixes

* unify "safe internal" behavior between server and client

* fix possible hydration mismatch

* better fix for active hash hydration mismatch

---------

Co-authored-by: Sheraff <fpellet@ensc.fr>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-24 13:37:18 +01:00
Tanner Linsley
72fc45e0b5 release: v1.157.1 v1.157.1 2026-01-24 12:10:56 +00:00
Manuel Schiller
3e48ef7fc9
chore: stabilize tests (#6486) 2026-01-24 13:08:29 +01:00
Manuel Schiller
b953e000fb
refactor: no additional package for isServer (#6485)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-24 12:54:18 +01:00
Flo
cfbbcd556c
refactor(router-core): skip URL constructor in buildLocation (#6447) 2026-01-24 11:42:55 +01:00
Tanner Linsley
16263c4a04 release: v1.157.0 v1.157.0 2026-01-24 10:31:03 +00:00
Manuel Schiller
e79ad7e052
feat: add isServer (#4648)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-01-24 11:28:54 +01:00
Philippe Serhal
6ff1190bdc
chore: add source() to Tailwind v4 imports to ensure consistent hashing (#6459)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 01:49:12 +01:00
Tanner Linsley
4a47c9f36d release: v1.156.0 v1.156.0 2026-01-23 23:50:00 +00:00