Skip to content

feat: add a Strong preconfigured Router provider - #2113

Merged
domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:feat/strong-router-provider-ack
Oct 16, 2026
Merged

domgan-oai merged 1 commit into
octanejs:mainfrom
openai-oss-forks:feat/strong-router-provider-ack

Conversation

@domgan-oai

@domgan-oai domgan-oai commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Compiled Start previously reached a compatibility-mode Router provider even when its router was already configured. Add a PreconfiguredRouterProvider to 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:check

  • pnpm typecheck

  • pnpm test

  • targeted 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 6b1676c against main 5e63f5e: 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

  • An agent produced this diff (agent-authored)

Codex task · Host: com-79386


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with 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 PreconfiguredRouterProvider on @octanejs/tanstack-router/compiled: a Strong provider that only accepts { router } (no synchronous option props) and owns the compiled match tree. CompiledRouterProvider still merges option props via router.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: startTransition installs on the mounted router in useInsertionEffect (before child layout effects can navigate), usePresentedMatches pins Router Core’s offered match snapshot until commit, and acknowledgement resolves only after that tree commits. Ordinary Matches.tsrx and 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/onRendered timing).

Reviewed by Cursor Bugbot for commit 6b1676c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability labels Oct 16, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 16, 2026 00:21
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark report

🟢 No byte growth, no added work, and no timing changes beyond ±3%.

Compares 5e63f5e66, the merge commit's first parent with f5a7c40f0 on the same runner. Any increase in a js-framework work counter fails this check; byte changes are a report. Wall time is a report: base and head samples alternate in one browser, and an operation is called slower or faster only when the 95% confidence interval of its ratio excludes ±3%. Workflow run

js-framework: 1k/10k row operations

All 20 timed operations (20 without a verdict)
target operation base ms head ms head/base 95% CI
octane-tsrx run 2.625 2.700 +1.6% −3.3% … +3.6% ⚪ within noise
octane-tsrx replace 6.600 6.800 −1.5% −3.2% … +4.5% ⚪ within noise
octane-tsrx add 2.508 2.467 −3.8% −4.0% … ±0.0% ⚪ within noise
octane-tsrx update 0.128 0.130 +0.6% −2.1% … +4.6% ⚪ within noise
octane-tsrx select 0.006 0.006 +0.5% −1.0% … +2.4% ⚪ within noise
octane-tsrx swap 0.017 0.017 ±0.0% −2.2% … +2.3% ⚪ within noise
octane-tsrx remove 0.016 0.015 −1.2% −3.9% … +3.1% ⚪ within noise
octane-tsrx runlots 27.900 25.708 −0.8% −6.4% … +2.2% ⚪ within noise
octane-tsrx select_lots 0.007 0.007 −1.1% −3.1% … +1.2% ⚪ within noise
octane-tsrx clear 45.533 45.342 +0.9% −1.6% … +4.5% ⚪ within noise
octane-jsx run 3.850 3.800 −2.5% −5.0% … +6.3% ⚪ within noise
octane-jsx replace 6.775 7.158 −1.6% −8.1% … +2.8% ⚪ within noise
octane-jsx add 3.250 3.158 ±0.0% −3.1% … +3.0% ⚪ within noise
octane-jsx update 0.284 0.274 −0.9% −4.6% … +1.7% ⚪ within noise
octane-jsx select 0.143 0.151 +1.7% −7.7% … +5.4% ⚪ within noise
octane-jsx swap 0.187 0.182 +0.9% −3.4% … +4.3% ⚪ within noise
octane-jsx remove 0.181 0.176 −0.3% −3.1% … +1.7% ⚪ within noise
octane-jsx runlots 28.058 27.833 −0.5% −2.5% … +2.6% ⚪ within noise
octane-jsx select_lots 1.517 1.510 −0.3% −2.0% … +1.8% ⚪ within noise
octane-jsx clear 48.167 48.342 +3.2% +0.9% … +6.2% ⚪ within noise

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.

@domgan-oai
domgan-oai merged commit a3a2b9b into octanejs:main Oct 16, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-authored Diff or issue body substantially produced by an AI agent feat PR: new feature or capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant