* 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.
* 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>