Skip to content

feat: own compiled Router pending transitions in Strong matches - #2132

Merged
trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:feat/strong-router-pending-2059
Oct 17, 2026
Merged

trueadm merged 2 commits into
octanejs:mainfrom
openai-oss-forks:feat/strong-router-pending-2059

Conversation

@domgan-oai

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

Copy link
Copy Markdown
Contributor

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 passed pnpm typecheck:files)
  • pnpm test (repository-wide not run locally)
  • Targeted tests: 32 client tests across compiled Router, compiled hydration, match suspension, and Router client; 12 SSR tests. The added pending-to-pending supersession scenario passed against exact main 59e83ac3 and merged head a3c8cc1b; 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.
  • Main and candidate website Strong analysis: 54 authored modules, zero diagnostics, and the same remaining MatchLifecycle.tsrx dependency through error ownership. pnpm sync passed.
  • Actual production website in bundled Chromium 149: exact main 59e83ac3 and candidate a3c8cc1b matched 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

  • 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 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 MatchLifecycle module into the Strong match tree in Matches.tsrx.

When a pending match must wait for navigation, it now suspends via a match-store snapshot (useStore on the route’s match store for router._tx) instead of reading the live router transaction directly. Synchronous error reporting stays in MatchLifecycle as 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.

@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 17, 2026
@domgan-oai
domgan-oai marked this pull request as ready for review October 17, 2026 21:02
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark report

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

Compares 59e83ac38, the merge commit's first parent with 4fe24036a 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.617 2.725 −0.0% −3.9% … +1.8% ⚪ within noise
octane-tsrx replace 5.333 5.550 −1.8% −3.8% … +7.1% ⚪ within noise
octane-tsrx add 2.292 2.325 ±0.0% −0.0% … +2.1% ⚪ within noise
octane-tsrx update 0.085 0.083 +1.5% ±0.0% … +2.7% ⚪ within noise
octane-tsrx select 0.005 0.006 ±0.0% −0.5% … +0.5% ⚪ within noise
octane-tsrx swap 0.016 0.016 ±0.0% −0.6% … +0.6% ⚪ within noise
octane-tsrx remove 0.014 0.014 +0.9% −0.9% … +2.7% ⚪ within noise
octane-tsrx runlots 22.125 21.417 −2.3% −4.8% … +0.7% ⚪ within noise
octane-tsrx select_lots 0.006 0.006 ±0.0% −0.6% … +0.6% ⚪ within noise
octane-tsrx clear 46.033 45.358 −0.2% −1.6% … +0.5% ⚪ within noise
octane-jsx run 3.408 3.358 ±0.0% −1.5% … +3.1% ⚪ within noise
octane-jsx replace 5.917 6.550 +1.6% −1.6% … +6.4% ⚪ within noise
octane-jsx add 3.308 3.317 ±0.0% −0.0% … +3.0% ⚪ within noise
octane-jsx update 0.174 0.175 +0.3% −0.7% … +1.3% ⚪ within noise
octane-jsx select 0.085 0.087 +1.1% +0.5% … +1.6% ⚪ within noise
octane-jsx swap 0.128 0.127 −0.3% −0.6% … +0.3% ⚪ within noise
octane-jsx remove 0.113 0.113 +0.0% −0.6% … +1.1% ⚪ within noise
octane-jsx runlots 26.408 27.133 −0.4% −1.8% … +3.7% ⚪ within noise
octane-jsx select_lots 0.959 0.930 −1.5% −2.4% … −0.3% ⚪ within noise
octane-jsx clear 49.275 48.458 −0.4% −1.8% … +0.3% ⚪ 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 123 measured values.

@trueadm
trueadm merged commit f665de9 into octanejs:main Oct 17, 2026
51 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.

2 participants