Repository navigation
feat: own compiled Router pending transitions in Strong matches - #2132
Merged
trueadm merged 2 commits intoOct 17, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 17, 2026 21:02
Contributor
Benchmark report🟢 No byte growth, no added work, and no timing changes beyond ±3%. Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 93 measured values. Public-import reachability bundles (bytes)No changes across 123 measured values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move compiled pending-route presentation into the Strong match tree. A waiting pending match observes the active navigation completion through its match-store snapshot and suspends on that promise; fallback-only and client-only paths keep their existing behavior. Synchronous error reporting stays in the compatibility lifecycle module.
Relates to #2059.
Validation
pnpm format:check(repository-wide not run; changed-file formatting passed)pnpm typecheck(repository-wide not run; changed shipped sources passedpnpm typecheck:files)pnpm test(repository-wide not run locally)59e83ac3and merged heada3c8cc1b; a lost-fallback negative control failed. A focused external Vitest config mirrored the Router projects because the filtered install could not load the unrelated StyleX plugin in the root config.MatchLifecycle.tsrxdependency through error ownership.pnpm syncpassed.59e83ac3and candidatea3c8cc1bmatched all 10 normalized state snapshots and route-event order across completion/Back and supersession. Gating the cold Benchmarks chunk kept Core APIs visible while the URL and Router were pending; release rendered Benchmarks. In the supersession flow, Docs won before the old asset was released and remained visible after the old request and transaction settled. Each flow made one document request and one gated script request, retained the shell, and reported no page, console, hydration, or request errors.perf-review: scoped changed-source scan → 0 candidates.CompiledPending(packages/tanstack-router/src/compiled/Matches.tsrx:65–76) runs when a pending boundary renders; its new scalar snapshot and selector closure run only for a waiting pending match. No normal-route subscription, hot-record field, DOM operation, scheduling hop, or new runtime helper reachability. The two affected production compiler outputs use the same runtime-symbol set (+92 raw bytes combined, unbundled). The complete emitted public JavaScript inventory stayed at 619 files: 19,552,468 → 19,552,532 raw bytes and 4,390,180 → 4,390,209 summed per-file gzip bytes (+64 raw / +29 gzip; not route transfer size). Browser latency was not benchmarked.concise-code: binding source +16 −17 (core runtime +0 −0); no new shipped file or public export. The only new file is the required patch changeset. A direct live router read would violate the Strong snapshot contract; a tuple snapshot on every match render would add normal-path allocation; a separate transaction tracker would duplicate the existing owner.Risk / follow-ups
The website holds prior successful matches while a cold route asset loads, so its browser flow validates integration while the controlled Router tests exercise pending-match fallback and supersession. The test-inclusive scoped typecheck has the same eight existing normalized diagnostics on main and candidate; the generated Router consumer typecheck has the same five existing Octane runtime diagnostics on both. This does not make the whole Router package Strong or remove the remaining compatibility dependency.
Provenance
agent-authored)Codex task · host
com-79386Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes compiled-route pending and navigation supersession behavior during in-flight loaders; scoped to the compiled entry with new conformance coverage.
Overview
Moves compiled pending-route UI and transition suspension from the compatibility
MatchLifecyclemodule into the Strong match tree inMatches.tsrx.When a pending match must wait for navigation, it now suspends via a match-store snapshot (
useStoreon the route’s match store forrouter._tx) instead of reading the live router transaction directly. Synchronous error reporting stays inMatchLifecycleas compatibility-owned.Package status/changeset notes are updated to record compiled pending ownership as Strong, and a conformance test asserts that a later navigation stays pending if an obsolete loader finishes first.
Reviewed by Cursor Bugbot for commit a3c8cc1. Bugbot is set up for automated code reviews on this repo. Configure here.