Repository navigation
feat: add a Strong preconfigured Router provider - #2113
Merged
domgan-oai merged 1 commit intoOct 16, 2026
Merged
Conversation
domgan-oai
marked this pull request as ready for review
October 16, 2026 00:21
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 120 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
Compiled Start previously reached a compatibility-mode Router provider even when its router was already configured. Add a
PreconfiguredRouterProviderto the compiled entry and use it from compiled Start on both server and client. The existing compiled provider still applies option props synchronously and retains the same route subtree when those props change.Move navigation acknowledgement ownership to the mounted router. Install the transition callback before descendant layout effects can navigate, present the exact match snapshot offered by Router Core, and acknowledge it only after that tree commits. Ordinary and compiled match trees share this logic.
Refs #2059.
Validation
pnpm format:checkpnpm typecheckpnpm testtargeted tests: Router lifecycle, navigation, scroll and hydration (34 passed); Start document hydration (4 passed); ordinary Router document SSR (1 passed); public compiled-entry typetests and scoped Router/Start typecheck passed. Focused tests used equivalent scoped Vitest project configs because the root config resolved dependencies outside the filtered local install.
pnpm sync, scoped formatting, Strong analysis, and production website build passed. Website authored analysis remained clean (98 files); recursive compatibility frontier fell from two modules to one (compiled/MatchLifecycle.tsrx).Production website on signed head
6b1676cagainst main5e63f5e: identical nine normalized route/DOM states and 33 Router events across hydration, links, history, scroll restoration and supersession; one document request each; no hydration warnings. Both runs had the same two pre-existing Lynx runtime page errors. Raw SSR document prefix matched.perf-review: no scan findings; transition callback allocation moves from every render to the mounted-router lifecycle, with commit-timing, supersession, history and hydration checks. No runtime-speed claim.concise-code: binding source +151 −137 (core runtime +0 −0); one public provider export serves compiled Start, one shared internal hook replaces duplicated acknowledgement, and the only new file is the paired changeset. A single conditional provider (one fewer export) remounted route state when options changed; a renderless sibling (one small component, no public export) introduced markers before document<html>. Complete website output: +217 raw / +85 summed gzip bytes.Current-head CI: all 27 jobs passed on
6b1676c(54,446 general tests passed, 2 skipped; 105/105 website; 622/622 Chromium). Root typecheck, Router public typetests, parity, publication, and examples passed. Bugbot passed with no findings.Benchmark report: all 64 work counters, 93 bundle values, and 120 public-import reachability values unchanged; all 20 timings were within noise, which does not establish speed equivalence.
Risk / follow-ups
This adds a public router-only provider; callers needing synchronous provider option props retain the existing compiled provider. Pending/error/scroll lifecycle and lazy loading remain compatibility-owned. The exact-head complete emitted public-JS inventory increased by 217 raw bytes / 85 summed gzip bytes across 613 files; this is not route transfer size. Generated routes still reach the lazy loader.
Provenance
agent-authored)Codex task · Host: com-79386
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Changes core navigation lifecycle timing (insertion-effect install, match snapshot presentation, and render acknowledgement) shared by ordinary and compiled routers; compiled Start switches provider entrypoint.
Overview
Introduces
PreconfiguredRouterProvideron@octanejs/tanstack-router/compiled: a Strong provider that only accepts{ router }(no synchronous option props) and owns the compiled match tree.CompiledRouterProviderstill merges option props viarouter.update()before delegating to the preconfigured provider. Compiled Start (StartClient/StartServer) now renders the preconfigured provider instead of the option-capable one.Navigation acknowledgement is refactored in Strong
Transitioner.tsrx:startTransitioninstalls on the mounted router inuseInsertionEffect(before child layout effects can navigate),usePresentedMatchespins Router Core’s offered match snapshot until commit, and acknowledgement resolves only after that tree commits. OrdinaryMatches.tsrxand compiled matches share this path; compiled provider code no longer duplicates transition/match logic.Docs, status notes, typetests, and conformance tests cover both provider variants (SSR/hydration, mount-time navigation, router swap vs history subscription,
onResolved/onRenderedtiming).Reviewed by Cursor Bugbot for commit 6b1676c. Bugbot is set up for automated code reviews on this repo. Configure here.