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

118 commits

Author SHA1 Message Date
Flo
9c1871ccc8
fix: harden URL handling across Router and Start (#8308)
* fix: harden URL handling across Router and Start

* fix: preserve unload blockers after document navigation

* perf: reduce document navigation guard size
2026-09-09 23:03:49 +02:00
Flo
0f40695fbe
test: cover existing navigation and redirect behavior (#8286) 2026-09-07 21:35:15 +02:00
Flo
28a5e4504e
fix(router): handle unknown error boundary values (#8209)
* fix(router): handle unknown error boundary values

* fix(router): complete unknown boundary error migration

* docs(router): keep boundary examples within skill limits

* fix(router): restore minimal boundary error display

* fix(solid-router): unify boundary errors across SSR and client
2026-09-05 14:48:44 +02:00
Kenji Mizuguchi
0caf6b9a2b
fix: preserve shouldThrow in route-scoped hooks (#8169)
* fix(react-router): forward shouldThrow in Route.useMatch

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: apply automated fixes

* fix(react-router,solid-router,vue-router): preserve shouldThrow in route-scoped hooks

Co-authored-by: Cursor <cursoragent@cursor.com>

* test: simplify route-scoped shouldThrow coverage

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sheraff <me@florianpellet.com>
2026-08-27 23:54:34 +02:00
Flo
cb281d70c1
fix(router-core): preserve context during reloads (#8130)
* fix(router-core): preserve context during reloads

* ci: apply automated fixes

* test(router): consolidate issue 8115 coverage

* fix(vue-router): react to provider context changes

* fix(router-core): refine context reconstruction

* bytes

* type fixes

* context + immediate UI on load

* coderabbit is happy

* no context in pending/error/notFound components

* changesets

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-20 23:34:06 +02:00
Manuel Schiller
fa65287281
perf(router): remove prebuilt preload locations (#8132) 2026-08-20 23:17:16 +02:00
Flo
63d2cc9155
fix(router-core): remove navigation rollback (#8092)
* fix(router-core): remove navigation rollback

* test(react-start): update failed HMR refresh expectation
2026-08-18 14:09:37 +02:00
Flo
5d3785dcc3
fix(router-core): preserve pending UI across retained routes (#8084)
* fix(router-core): preserve pending UI across retained routes

* fix(router-core): harden pending session ownership

* fix(router): align pending presentation across Solid and Vue (#8097)

fix(router): align pending presentation across frameworks

* changesets

* test: align hydration fake timers
2026-08-18 14:09:36 +02:00
Flo
31882c7fa8
fix(router): reuse resolved lazy route components (#8054)
* fix(router): reuse resolved lazy route components

* fix vue inconsistency

* fix(router): clear resolved lazy component preload
2026-08-14 13:30:20 +02:00
Flo
0ad38a710c
fix(router): reject superseded Solid and Vue render acknowledgements (#8065)
* fix(router): reject superseded render acknowledgements

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-14 09:38:09 +02:00
Flo
38485038c5
Fix default route component remounting (#8002)
* Fix default route component remounting

* Optimize reactive Vue Link props

* fix(vue-router): address reactive Link review feedback
2026-08-12 14:53:17 +02:00
Flo
f5007607d6
fix(router): warn when Outlet is rendered in fallback components (#8045) 2026-08-12 09:53:15 +02:00
Flo
aa10b6589e
fix(router): apply preload delay to viewport links (#8044)
* fix(router): apply preload delay to viewport links

* fix(router): cancel delayed viewport preloads on exit

* fix(router): process queued viewport transitions in order

* fix(router): use latest queued viewport state

* refactor(router): inline viewport observer options

* fix(router): stabilize viewport preload timers

* cleaner timeout map key
2026-08-12 09:52:36 +02:00
Flo
ea3a665d81
fix(router): retain mounted UI during revalidation (#7992)
* fix(router): retain mounted UI during revalidation

* fix(router): preserve initial pending presentation

* changeset

* test(router): make retained pending tests deterministic

* complete solid/vue suite
2026-08-07 11:57:59 +02:00
Flo
2435885fa8
Create file routes directly (#7970)
* test createFileRoute factory behavior

* create file routes directly

* preserve createFileRoute parameter name

* cleanup

* changeset
2026-08-06 13:38:43 +02:00
Flo
07a3d10d8f
fix(router): preserve raw params for match identity (#7966)
* fix(router): preserve raw params for match identity

* refactor(router): return matched routes as tuple

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-08-05 21:41:42 +02:00
Flo
45c4ad8d62
fix(router-core): lane match loader rewrite (#7805)
* fix: lane match loader rewrite

---------

Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
2026-08-04 20:28:11 +02:00
Flo
3a5575627d
test: add regression coverage for existing router behavior (#7886) 2026-07-23 22:13:21 +02:00
Manuel Schiller
d1997b66d7
fix: fix streaming (#7497) 2026-05-29 02:27:23 +02:00
Manuel Schiller
51a97a167f
feat(start): support rsbuild iife client output (#7477) 2026-05-24 02:02:05 +02:00
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