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

2,227 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
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
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
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
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
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
Sheraff
af0f0c742f
tests 2026-07-14 12:45:51 +02:00
Sheraff
2e8bbbe469
Merge remote-tracking branch 'origin/main' into fix-router-core-lane-match-loader
# Conflicts:
#	packages/router-core/tests/issue-4684-head-on-beforeload-error.test.ts
2026-07-14 01:46:03 +02:00
Flo
11a6a0d8ba
test: add regression coverage for existing router behavior (#7812) 2026-07-14 01:44:02 +02:00
Sheraff
3a5687810f
Merge branch 'main' into fix-router-core-lane-match-loader 2026-07-14 00:32:18 +02:00
Sheraff
cc21be0de7
error priority handling 2026-07-14 00:22:49 +02:00
github-actions[bot]
58c005fcb1
ci: Version Packages (#7811) 2026-07-13 23:31:08 +02:00
Sheraff
bf9060267c
fix: react-router not found ambiguous assertion 2026-07-13 17:33:44 +02:00
Sheraff
f4b893487c
fix adoption of server data 2026-07-13 15:13:57 +02:00
Sheraff
ceaa4d26f2
fix: lane match loader rewrite 2026-07-13 09:29:38 +02:00
github-actions[bot]
ecbbd9a8ec
ci: Version Packages (#7676)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-01 23:33:19 +02:00
github-actions[bot]
f23ed0fe73
ci: Version Packages (#7576) 2026-06-17 00:12:54 +02:00
Flo
689c5ab32e
chore(react-router): silence AbortError in renderRouterToStream (#7627) 2026-06-13 19:41:02 +02:00
dfedoryshchev
a2b9d51b0a
docs: fix duplicate "to" typos (#7370) 2026-06-12 22:55:18 +02:00
Flo
56bd271ba0
perf(react-router): add match selector compares (#7596)
* perf(react-router): add match selector compares

* fix scroll restoration

* Revert "fix scroll restoration"

This reverts commit 620e9674fa.

* fix scroll restoration

* lint rules of hooks
2026-06-11 10:04:11 +02:00
Flo
52db7034fd
fix(react-router): avoid throwing in useMatch selector (#7595)
* fix(react-router): avoid throwing in useMatch selector

* lint fix and changeset
2026-06-10 22:11:08 +02:00
Flo
689d88e04c
refactor(react-router): Reduce bundle size by sharing hook structuralSharing logic (#7577) 2026-06-07 19:29:16 +02:00
Flo
4a93cffffc
refactor(react-router): useMatches skips useRef during SSR (#7575) 2026-06-07 13:26:37 +02:00
github-actions[bot]
10a7ff833c
ci: Version Packages (#7563) 2026-06-06 11:49:34 +02:00
github-actions[bot]
996b9bee38
ci: Version Packages (#7561) 2026-06-06 10:45:35 +02:00
github-actions[bot]
65ad9062ea
ci: Version Packages (#7556) 2026-06-06 01:01:21 +02:00
github-actions[bot]
a8647d20a1
ci: Version Packages (#7554) 2026-06-05 22:11:34 +02:00
Ulrich Stark
fee0b58c51
refactor: remove unused dependencies (#7541) 2026-06-04 22:47:41 +02:00
Ulrich Stark
bb99f66a47
refactor: remove unnecessary any assertions (#7542) 2026-06-04 22:12:45 +02:00
github-actions[bot]
7fc7c346dc
ci: Version Packages (#7525)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-02 22:50:10 +02:00
github-actions[bot]
0ac831bdf7
ci: Version Packages (#7508) 2026-05-30 02:44:11 +02:00
Manuel Schiller
2f5374945e
fix: fix primitive beforeLoad errors (#7505)
* fix: fix primitive beforeLoad errors

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-30 01:29:42 +02:00
github-actions[bot]
8b3659143f
ci: Version Packages (#7504)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-05-29 02:32:18 +02:00
Manuel Schiller
d1997b66d7
fix: fix streaming (#7497) 2026-05-29 02:27:23 +02:00