Skip to content

feat(solid-router): declare navigations to Solid's observe tier - #8399

Merged
brenelz merged 1 commit into
TanStack:solid-router-v2-prefrom
ryansolid:feat/solid-observe-navigation
Sep 14, 2026
Merged

brenelz merged 1 commit into
TanStack:solid-router-v2-prefrom
ryansolid:feat/solid-observe-navigation

Conversation

@ryansolid

Copy link
Copy Markdown

What

On Solid's dev and observe builds (OBSERVE is defined; it is undefined in production, so this folds out there), the Solid adapter declares each navigation to Solid's attribution engine.

The rule Solid asks of every router is the same: wrap the write whose landing is the destination showing, and pass at when the request predates that write. For TanStack that write is the match publish inside startTransition — router-core has already awaited the loaders — so Transitioner wraps fn in OBSERVE.attribution.withOrigin(ref, fn) with:

  • name: the leaf expected match's fullPath (/users/$id), params: its params
  • to: router.latestLocation.pathname, from: router.stores.resolvedLocation.get().pathname
  • at: performance.now() captured in the history.subscribe callback the first time the history changes since the last declared publish — the moment the user asked, which is where the wait starts

Not declared: the pending offer (offerPending, any expected match with status: 'pending' — not the destination), the initial load (nothing shown yet), and same-location reloads (resolvedLocation.href === latestLocation.href).

Why

Solid 2.0.0-rc.8 froze the observe record shape (solidjs/solid#3349). With this, an APM adapter subscribed to attribution.subscribe("navigation") gets one record per TanStack navigation with the route pattern as its name, settledMs covering the loader wait, and the holds/re-runs the publish caused attributed to it — the same facts @solidjs/router produces (solidjs/solid-router#601). No new public API on either side.

Known gaps, by design of the two-phase pipeline (documented in Solid's 08-dev-diagnostics.md, Navigations): the record carries no interaction link because the publish runs in a later task than the click — consumers join by time containment (nav.at inside the click's handler window); a navigation superseded before it published leaves no record of its own (the destination that showed is dated from the first request). Moving the loader wait inside the transition would close both; that is the longer-term roadmap, not this PR.

Tests

tests/observe-navigation.test.tsx: one record per navigation with name /users/$id, to /users/42, from /, params {id: '42'}, at before the 30ms loader and settledMs >= 30; the initial load produces no record; a navigation superseded before it published leaves one record for the destination that showed, dated from the first request. Full solid-router suite: 62 files, 872 passed.

On Solid's dev and observe builds the match publish inside startTransition
is wrapped in OBSERVE.attribution.withOrigin: the ref names the destination
route (fullPath, params, to/from pathnames) and dates from the history
change that started the load, so the record spans the loader wait even
though the publish comes after it. The pending offer, the initial load and
same-location reloads are published undeclared. Production is unchanged
(OBSERVE is undefined).

Co-authored-by: Claude via Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b4d0d8cd-b744-4a7c-a1b8-708c082507fe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8f46655

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 8m 53s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 2m 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-09-14 21:10:19 UTC

@pkg-pr-new

pkg-pr-new Bot commented Sep 14, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8399

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8399

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8399

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8399

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8399

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8399

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8399

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8399

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8399

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8399

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8399

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8399

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8399

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8399

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8399

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8399

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8399

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8399

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8399

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8399

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8399

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8399

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8399

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8399

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8399

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8399

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8399

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8399

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8399

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8399

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8399

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8399

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8399

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8399

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8399

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8399

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8399

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8399

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8399

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8399

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8399

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8399

commit: 8f46655

@codspeed

codspeed Bot commented Sep 14, 2026

Copy link
Copy Markdown

Hooray! CodSpeed harness just leveled up!

The base and head of this comparison were measured with different runner settings, so their benchmark values are not directly comparable.

What changed between base and head:

Re-run the base with the same settings to get a valid performance comparison.


Comparing ryansolid:feat/solid-observe-navigation (8f46655) with solid-router-v2-pre (67a9040)1

Open in CodSpeed

Footnotes

  1. No successful run was found on solid-router-v2-pre (8981eb7) during the generation of this report, so 67a9040 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@brenelz
brenelz merged commit 9de3573 into TanStack:solid-router-v2-pre Sep 14, 2026
24 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants