mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
* 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. |
History
|
|
|---|---|---|
| .. | ||
| ssr | ||
| Asset.tsx | ||
| awaited.tsx | ||
| CatchBoundary.tsx | ||
| ClientOnly.tsx | ||
| fileRoute.ts | ||
| HeadContent.dev.tsx | ||
| HeadContent.tsx | ||
| headContentUtils.tsx | ||
| history.ts | ||
| index.dev.tsx | ||
| index.tsx | ||
| lazyRouteComponent.tsx | ||
| link.tsx | ||
| Match.tsx | ||
| matchContext.tsx | ||
| Matches.tsx | ||
| not-found.tsx | ||
| renderRouteNotFound.tsx | ||
| route.tsx | ||
| router.ts | ||
| routerContext.tsx | ||
| RouterProvider.tsx | ||
| routerStores.ts | ||
| SafeFragment.tsx | ||
| ScriptOnce.tsx | ||
| Scripts.tsx | ||
| scroll-restoration.tsx | ||
| ScrollRestoration.tsx | ||
| Transitioner.tsx | ||
| typePrimitives.ts | ||
| useBlocker.tsx | ||
| useCanGoBack.ts | ||
| useLoaderData.tsx | ||
| useLoaderDeps.tsx | ||
| useLocation.tsx | ||
| useMatch.tsx | ||
| useNavigate.tsx | ||
| useParams.tsx | ||
| useRouteContext.ts | ||
| useRouter.tsx | ||
| useRouterState.tsx | ||
| useSearch.tsx | ||
| utils.ts | ||