0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-18 19:34:24 +00:00
Commit graph

4,381 commits

Author SHA1 Message Date
github-actions[bot]
69b2205999
ci: Version Packages (pre) (#7894)
ci: changeset release (pre)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-24 19:08:48 +02:00
Manuel Schiller
2d639e1707
Merge branch 'main' into fix-router-core-lane-match-loader 2026-07-24 00:14:25 +02:00
Manuel Schiller
88f366ab8e
chore: migrate to typescript 7 (#7887) 2026-07-23 23:10:51 +02:00
Sheraff
a4d5b8ffd8
Merge remote-tracking branch 'origin/main' into fix-router-core-lane-match-loader
# Conflicts:
#	e2e/react-start/selective-ssr/src/routeTree.gen.ts
#	e2e/react-start/selective-ssr/src/routes/__root.tsx
#	e2e/react-start/selective-ssr/tests/app.spec.ts
#	packages/react-router/tests/component-preload-retry-pending-min.test.tsx
#	packages/react-router/tests/not-found.test.tsx
#	packages/react-router/tests/public-presentation-lane-contract.test.tsx
#	packages/react-router/tests/redirect.test.tsx
#	packages/react-router/tests/transactional-loading.test.tsx
#	packages/react-router/tests/transitioner-remount.test.tsx
#	packages/react-start-client/src/tests/hydrateStart.test.ts
#	packages/router-core/tests/background-trim-abort.test.ts
#	packages/router-core/tests/boundary-component-chunk.test.ts
#	packages/router-core/tests/callbacks.test.ts
#	packages/router-core/tests/client-lane-adversarial.test.ts
#	packages/router-core/tests/error-boundary-cache-generation.test.ts
#	packages/router-core/tests/granular-stores.test.ts
#	packages/router-core/tests/hydrate.test.ts
#	packages/router-core/tests/issue-6221-head-waits-for-loader.test.ts
#	packages/router-core/tests/loader-architecture-regressions.test.ts
#	packages/router-core/tests/loader-self-abort.test.ts
#	packages/router-core/tests/masked-location-state-commit.test.ts
#	packages/router-core/tests/parent-match-promise.test.ts
#	packages/router-core/tests/preload-adoption.test.ts
#	packages/router-core/tests/preload-beforeload-reuse.test.ts
#	packages/router-core/tests/preload-navigation-adoption.test.ts
#	packages/router-core/tests/preload-public-cache-behavior.test.ts
#	packages/router-core/tests/public-client-loading-contract.test.ts
#	packages/router-core/tests/public-preload-lane-contract.test.ts
#	packages/router-core/tests/same-destination-navigation-join.test.ts
#	packages/router-core/tests/server-beforeload-preload-flag.test.ts
#	packages/router-core/tests/server-loader-abort-error.test.ts
#	packages/router-plugin/tests/handle-route-update.test.ts
#	packages/solid-router/tests/component-preload-retry.test.tsx
#	packages/solid-router/tests/createLazyRoute.test.tsx
#	packages/solid-router/tests/loaders.test.tsx
#	packages/solid-start-client/src/tests/hydrateStart.test.ts
#	packages/vue-router/tests/Transitioner.test.tsx
#	packages/vue-router/tests/disableGlobalCatchBoundary.test.tsx
#	packages/vue-router/tests/transitioner-remount-rendered.test.tsx
#	packages/vue-router/tests/transitioner-remount.test.tsx
#	packages/vue-router/tests/useMatch.test.tsx
2026-07-23 22:23:09 +02:00
Flo
3a5575627d
test: add regression coverage for existing router behavior (#7886) 2026-07-23 22:13:21 +02:00
Flo
55ceb3a3e4
chore(router-core): lane match loader final byte-shave (#7885) 2026-07-23 17:50:25 +02:00
Flo
baa18cd913
fix(router): final-review regressions, changeset, and byte recovery (#7883)
* fix(router): final-review regressions, changeset, and byte recovery

Fixes the regressions vs main found in the final review of #7805:

- restore history-subscription cleanup on router provider unmount in all
  three adapters (react returns the unsubscribe unconditionally, solid
  uses onCleanup, vue uses onUnmounted), pinned by new
  transitioner-remount tests — a discarded router could previously keep
  loading on back/forward as a zombie
- same-destination navigations now join the in-flight transaction
  instead of aborting and restarting it (double-click no longer reruns
  loaders); reloads and same-location redirects keep restart semantics
- commitMatches cache retention can no longer resurrect a
  one-generation-old loaderData when a newer committed success exists
  for the same match id
- same-location dedup keeps __tempLocation/__tempKey so masked vs real
  same-href navigations commit their state again

Adds the missing release changeset enumerating the removed/changed
public API with migration hints.

Byte recovery: merges rendered-matches.ts, route-chunks.ts and
hydrate.ts into load-client.ts so the client bundle shares gzip
dictionary context across what were separate module boundaries
(-104..-186 gzip B per start scenario; plain router scenarios remain
net-negative vs main and hydration still tree-shakes out of them).

The solid/vue store-update-count pins were re-adjusted after verifying
the published update sequences are byte-identical: the counts only
shifted because a one-microtask timing change moves the tests'
waitFor-sampled window boundary (5 of 7 counts decreased).

* test(router-devtools-core): keep panel chunk warm-up out of the test budget

The cache-replacement test warmed Vite's lazy transform of
BaseTanStackRouterDevtoolsPanel inside the test body, so on slow CI
runners the transform alone could blow the 5s test timeout (observed at
5.89s). Move the warm-up to a beforeAll with its own generous timeout
and give the test itself explicit headroom. Pre-existing flake on the
lane branch tip, surfaced by this PR's CI being the first to run on it.

* refactor(router-core): extend lane typestate to matches and commits

The lane pipeline already carried phase brands at lane granularity
(Lane<'matched'|'contextualized'|'reduced'|'projected'>); this finishes
the pattern at the two granularities it was missing, at zero runtime
cost (all emitted dist JS verified byte-identical):

- settleInto becomes the sole granter of a SettledMatch brand via an
  assertion signature, and cacheLoaderMatch requires it — the
  loader -> settle -> cache ordering is now compiler-enforced. The one
  legitimate phase jump (hydration cache-seeding of already-settled
  dehydrated data) is a single named, commented boundary cast.
- commitMatches/commitRefreshMatches only accept a projected lane's
  matches (LaneMatches<'projected'>), so committing an earlier-phase
  lane no longer compiles.
- LoadTransaction's dev-only refresh triple collapses into one optional
  slot [presentation, handoff?], making a half-armed refresh state
  unrepresentable and shrinking the clear/read sites.
2026-07-23 15:35:11 +02:00
Flo
90a7f3923c
fix(router): address lane loader regressions (#7880)
* fix(router): address lane loader regressions

* perf(router-core): shave asset-prefix bookkeeping bytes

- rename the internal `_dataOnlyAssetEnd` match field to `_assetEnd`:
  property keys survive minification, so the shorter internal name saves
  bytes at every site in every bundle
- reduce the `_getAssetMatches` guard to a presence check: the field is
  only ever set on hydration presentation clones that already satisfy
  the pending/data-only/error-free/not-not-found conditions, and commits
  clear it (invariant documented at the guard)
- clone-then-patch the hydration handoff splice instead of spreading a
  conditional object per element, and drop the unreachable zero guard in
  `_getAssetMatches`

Measured (gzip, vs PR tip): react-router.full -43 B, vue-router.full
-35 B, react-router.minimal -8 B. All unit suites green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(router-devtools): preload lazy panel

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 09:57:37 +02:00
Flo
03a1fde261
perf(router): reduce SSR lane loading overhead (#7875)
* perf(router): reduce SSR lane loading overhead

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-22 08:56:43 +02:00
Flo
1f271022b5
fix(router-core): harden lane loading lifecycle (#7869)
* fix(router-core): harden lane loading lifecycle

* ci: apply automated fixes

* fix(router-core): optimize lane loading followups

* fix(router-core): simplify redirect limit handling

* refactor(router-core): clarify loader state and caches

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-22 00:43:31 +02:00
Sheraff
7443d96223
Merge remote-tracking branch 'origin/main' into fix-router-core-lane-match-loader
# Conflicts:
#	e2e/react-start/selective-ssr/src/routeTree.gen.ts
#	e2e/solid-start/selective-ssr/src/routeTree.gen.ts
2026-07-20 19:39:51 +02:00
Flo
423f905df8
fix(router-core): complete lane match loader rewrite (#7858)
* fix(router-core): complete lane match loader rewrite

* fix(router-core): harden match loading lifecycle

* fix(router-core): preserve hydrated context handoff

* bench(memory): accept expected abort errors

* perf(ssr): reduce request cancellation overhead (#7862)
2026-07-20 18:52:47 +02:00
github-actions[bot]
49bd9fa447
ci: Version Packages (#7857) 2026-07-19 16:29:16 +02:00
Manuel Schiller
49f6863245
fix(router-plugin): preserve HMR state for lowercase split components (#7855) 2026-07-19 12:09:25 +02:00
github-actions[bot]
ecb1ef4817
ci: Version Packages (#7854) 2026-07-19 09:11:05 +02:00
Manuel Schiller
ffdd64e842
fix(start): preserve resolved virtual module ids (#7844) 2026-07-18 20:08:42 +02:00
github-actions[bot]
62a191baa0
ci: Version Packages (#7846) 2026-07-18 02:25:47 +02:00
Manuel Schiller
78dd1a645d
fix(router-generator): preserve dots in virtual routes (#7845) 2026-07-18 01:17:42 +02:00
github-actions[bot]
604996d14c
ci: Version Packages (#7841) 2026-07-18 00:25:19 +02:00
Thijs Koerselman
e56a67742d
fix(router-generator): make buildRouteTree route ordering deterministic (#7751)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Manuel Schiller <6340397+schiller-manuel@users.noreply.github.com>
2026-07-17 23:01:54 +02:00
Sheraff
3d68db666f
INTERNALS update 2026-07-17 10:13:47 +02:00
Sheraff
6683863a75
console.error over promise.reject for lifecycle errors 2026-07-17 08:08:28 +02:00
Sheraff
47466333b3
server preload is no-op 2026-07-17 07:12:03 +02:00
Sheraff
1f4838d220
beforeLoad context cleanup on error + naming + misc bugs 2026-07-16 00:21:25 +02:00
autofix-ci[bot]
83fea0f6b8
ci: apply automated fixes 2026-07-15 18:13:55 +00:00
Sheraff
1b209334cc
more jsdoc 2026-07-15 20:11:21 +02:00
Sheraff
5a8cc8061f
simplify getSemanticMatch 2026-07-15 17:35:52 +02:00
Sheraff
f7f266b5d5
some jsdoc 2026-07-15 16:48:22 +02:00
autofix-ci[bot]
f90018f85f
ci: apply automated fixes 2026-07-15 14:04:50 +00:00
Sheraff
a8d7c8c6db
no reset key on server 2026-07-15 16:02:06 +02:00
Sheraff
45f77312d1
deprecated test 2026-07-15 16:01:54 +02:00
autofix-ci[bot]
9810491b75
ci: apply automated fixes 2026-07-15 13:45:38 +00:00
Sheraff
e7322f86da
simplify Transitioner based on having a unique transitioner per router 2026-07-15 15:43:27 +02:00
Sheraff
e177851758
test: same, but property wasn't even initialized 2026-07-15 15:27:59 +02:00
Sheraff
ef4025957a
test again, but i selected everything this time 2026-07-15 15:16:07 +02:00
Sheraff
b56cb51a15
test: does declare save any bytes? 2026-07-15 15:13:09 +02:00
autofix-ci[bot]
ec631eb350
ci: apply automated fixes 2026-07-15 13:03:33 +00:00
Sheraff
cf40d59b52
comments and cleanup 2026-07-15 14:47:39 +02:00
autofix-ci[bot]
1f50bd3524
ci: apply automated fixes 2026-07-15 12:06:50 +00:00
Sheraff
2bba8fae50
minor byte shaving 2026-07-15 14:04:49 +02:00
Sheraff
125b13f4fc
minor byte shave in Match 2026-07-15 13:43:05 +02:00
Sheraff
ba800532e6
minor byte shave in router-core 2026-07-15 13:38:51 +02:00
Flo
0b178a79e2
test: add more regression coverage for existing router behavior (#7822) 2026-07-15 09:48:19 +02:00
Sheraff
ded47d1f43
final fixed issue tests 2026-07-15 00:23:09 +02:00
Sheraff
c801dcc254
final coverage 2026-07-14 21:31:07 +02:00
Sheraff
3ecc24bdb1
update tests 2026-07-14 20:35:11 +02:00
autofix-ci[bot]
4150cdf073
ci: apply automated fixes 2026-07-14 14:25:53 +00:00
Sheraff
3d252e60b5
more cleanup 2026-07-14 16:23:53 +02:00
autofix-ci[bot]
3ba393ec4b
ci: apply automated fixes 2026-07-14 13:41:49 +00:00
Sheraff
8fcf2ebe43
cleanup load-server 2026-07-14 15:32:09 +02:00