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

98 commits

Author SHA1 Message Date
Manuel Schiller
c992495bf4
feat: match params (#7263) 2026-04-30 19:47:07 +02:00
Brenley Dueck
41e37f8a9c
fix: use loader data goes undefined (#7265) 2026-04-25 23:36:25 +02:00
Brenley Dueck
b732c8ac26
fix: server middleware type in solid-router (#7260) 2026-04-25 19:23:05 +02:00
Brenley Dueck
d20c878135
fix: issue 7240 causing fouc (#7250) 2026-04-25 18:25:42 +02:00
Birk Skyum
22dc152033
fix(solid-router): use keyed Show in Outlet to fix child route rendering with useQuery (#7204) 2026-04-16 23:51:45 +02:00
Manuel Schiller
540d22100d
fix: MatchRoute types (#7139)
Co-authored-by: schiller-manuel <schiller-manuel@users.noreply.github.com>
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-04-10 21:35:42 +02:00
Manuel Schiller
b29d64de0c
fix(router): handle redirected lazy pending matches (#7137)
Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
2026-04-10 21:17:37 +02:00
Manuel Schiller
4b9ed6c5cb
fix: don't leak internal props in Link (#7138) 2026-04-10 20:18:20 +02:00
Manuel Schiller
796406da66
fix: preserve render-thrown notFound errors (#7077) 2026-03-31 01:09:27 +02:00
Nicolas Beaussart
7b9faaeee0
test: cover lazy errorComponent behavior across frameworks (#7068) 2026-03-29 18:08:38 +02:00
Birk Skyum
b1c0f4602d
chore: upgrade tooling to typescript 6 (#7024) 2026-03-23 22:59:52 +01:00
Manuel Schiller
6164816414
feat: transformAssets (#7009)
* feat: transformAssets

replaces transformAssetUrls

* fix

* fix
2026-03-22 20:25:12 +01:00
Flo
c9e18555f3
fix: strip invariant and warning strings from prod bundles (#7007) 2026-03-22 10:27:08 +01:00
Flo
0d11d5e494
fix(solid-router): avoid HeadContent remounts on history.replaceState (#6998) 2026-03-21 07:01:05 +01:00
Flo
054523900b
refactor: signal based reactivity (#6704) 2026-03-20 10:33:28 +01:00
Flo
dadf7e9d9d
fix(router-core): null prototype input/output objects (#6882) 2026-03-10 20:22:35 +01:00
Flo
065e4ec11e
fix(solid-router,vue-router): re-build next location on params,search,hash changes (#6865) 2026-03-09 22:51:44 +01:00
Manuel Schiller
31ed0a9648
fix: don't re-execute stale loaders on unrelated location changes (#6867)
* fix: don't re-execute stale loaders on unrelated location changes

* lint

* remove loaderKeyChanged

* from last

* inline staleMatchShouldReload

* update tests

* add test

* fix

* revert
2026-03-09 20:02:35 +01:00
Flo
446d7973cf
test: cover Solid SSR route error rendering (#6854)
test: cover solid SSR route error rendering
2026-03-08 10:11:30 +01:00
Manuel Schiller
9c81d5ac57
fix: handle beforeLoad throwing notFound correctly (#6811) 2026-03-04 21:34:28 +01:00
Flo
5f7e9e872b
test: add onRendered event coverage for param and search updates (#6794) 2026-03-01 18:43:11 +01:00
Flo
f58d457542
fix(react-router,solid-router,vue-router): correct preload triggers for "intent" option (#6747) 2026-02-24 13:48:43 +01:00
Flo
99e3025650
fix(react-router): keep relative link active when changing inherited param (#6689) 2026-02-18 09:56:01 +01: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
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
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
Flo
cfbbcd556c
refactor(router-core): skip URL constructor in buildLocation (#6447) 2026-01-24 11:42:55 +01:00
Flo
f054c0c921
fix: revert "refactor: don't reparse upon navigation (#6398)" (#6468)
Revert "refactor: don't reparse upon navigation (#6398)"

This reverts commit 6cbd96e357.
2026-01-23 16:50:10 +01:00
Flo
655496fc20
refactor(router-core): skip full matchRoutesInternal for Link's buildLocation, use simple getMatchedRoutes (#6445) 2026-01-22 23:24:56 +01:00
Manuel Schiller
6cbd96e357
refactor: don't reparse upon navigation (#6398) 2026-01-19 23:00:21 +01:00
Manuel Schiller
abb82160eb
fix: Commit context together with status to avoid race condition (#6407) 2026-01-18 01:01:03 +01:00
Lee
942f0ff937
fix(router-core): handle AbortError in router execution flow (#4570) 2026-01-07 22:55:00 +01:00
Flo
7b4dcee399
refactor(router-core): index routes have index nodes in the segment tree (#6171) 2025-12-21 16:32:19 +01:00
Manuel Schiller
f330532e08
fix: generalize hydration cleanup (#6118)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-17 01:18:47 +01:00
Manuel Schiller
20aac85d7f
fix: compare rewritten url to decide if server needs to redirect (#6072) 2025-12-12 20:28:58 +01:00
Manuel Schiller
06de1f6777 flaky tests 2025-12-10 00:44:41 +01:00
Manuel Schiller
e681a56f05
fix: commit route context (#6053)
Co-authored-by: Jakob Norlin <jakob.stahl91@gmail.com>
2025-12-09 21:17:36 +01:00
jihoon
c35f70ec3c
fix(router-core): useBlocker navigation issues for 404 pages and external URLs (#4917) 2025-11-23 01:29:13 +01:00
Flo
5e130d7ee1
refactor(router-core): interpolatePath skips optional segments w/ nullish param value (#5934) 2025-11-21 23:55:16 +01:00
Remi
37eb416963
fix(router-core): Catch errors thrown during hydrate (#5686) 2025-11-19 21:06:05 +01:00
Lee
6b235a7cec
fix: update error handling in MatchInner to access error data directly (#4746) 2025-11-19 19:46:29 +01:00
dt_emmy
fb0f069363
fix(router-core): Route with server function as loader that throws notFound crashes route on HMR #5763 (#5890) 2025-11-19 17:34:32 +01:00
Flo
f39eb9b832
refactor(router-core): Process routeTree into segment tree instead of flatRoutes [WIP] (#5722) 2025-11-15 13:45:02 +01:00
Nico Lynzaad
f1bd5c589c
refactor(router-core): use original nextTo path when building location in its route form (#5851)
* fixes and tests

* standardize params output for empty optional params

* finalize leave params tests

* leave wildcard is no longer required

* remove leaveParams altogether

* leave changes to optional param output handling for a separate PR

* cleanup

* resolve build errors and nitpick
2025-11-14 01:55:39 +02:00
Birk Skyum
7880ad7b46
fix(solid-start): navigation transitions (#5792) 2025-11-09 21:33:59 +01:00
Birk Skyum
01682c5dfb
fix(solid-router): use Solid.useTransition (#5801) 2025-11-09 19:52:29 +01:00
Birk Skyum
da770787fa
fix(solid-router): setting search params with 2 parallel navigate calls (#5797) 2025-11-09 16:09:18 +01:00
Ramy Ben Aroya
c857362929
fix(router-core): trigger abort signal when navigating away after pendingMs (#5777)
* fix(router): trigger loader abort signal when navigating away after pendingMs

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-08 01:37:07 +01:00
Nico Lynzaad
26f23faf13
refactor(router-core): consistent Unicode handling (#5736)
* add router-core fixes and update tests

* update react-router unit tests

* update react-router e2e tests

* update solid-router unit tests

* update solid-router e2e tests

* update test description

* rename function

* rename test as per codeRabbit nitpick

* test cleanup
2025-11-06 03:35:59 +02:00
Birk Skyum
76c4f614f2
fix(solid-router): implement navigation transitions (#5691) 2025-11-04 03:51:16 +01:00