Skip to content

blog(router): refactor signals#757

Open
Sheraff wants to merge 22 commits intoTanStack:mainfrom
Sheraff:blog-router-refactor-signals
Open

blog(router): refactor signals#757
Sheraff wants to merge 22 commits intoTanStack:mainfrom
Sheraff:blog-router-refactor-signals

Conversation

@Sheraff
Copy link
Copy Markdown
Contributor

@Sheraff Sheraff commented Mar 15, 2026

Blog post for TanStack/router#6704

Summary by CodeRabbit

  • Documentation
    • Added a blog post explaining the router’s reactive-core refactor: the new granular "signal graph", per-route state lifecycles (active/pending/cached), how adapters map across frameworks, and benchmarked improvements in client-side navigation and bundle size.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 15, 2026

👷 Deploy request for tanstack pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 75bbe5b

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 15, 2026

⚠️ No Changeset found

Latest commit: 7d32728

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 15, 2026

📝 Walkthrough

Walkthrough

A new blog post documents TanStack Router’s refactor from a monolithic router.state snapshot to a granular “signal graph” of smaller, responsibility-scoped stores, describes per-match active/pending/cached stores and derived stores, specifies adapter contracts and implementation mappings for React/Solid/Vue, and presents benchmark results.

Changes

Cohort / File(s) Summary
Blog Post
src/blog/tanstack-router-signal-graph.md
Adds a comprehensive post describing the signal-graph refactor: top-level scalar stores (location, status/loading/transition, redirects), per-match stores split into active/pending/cached lifecycles, derived stores for cross-cutting state, internal hook behavior change (internals subscribe to per-match stores rather than selecting from state.matches), TypeScript adapter interfaces for readable/writable store shapes and StoreConfig, adapter mappings to framework store models (TanStack Store, Solid signals), Solid disposal via FinalizationRegistry, and benchmarks (store update counts, navigation timings, gzipped bundle deltas).

Sequence Diagram(s)

mermaid
sequenceDiagram
participant App as Client Component
participant Hook as useMatch / Router Hook
participant Router as Router Internals
participant Adapter as Store Adapter
participant Store as Signal Graph (per-match & top-level)
App->>Hook: render & call useMatch
Hook->>Router: request match store
Router->>Adapter: resolve per-match store reference
Adapter->>Store: subscribe to specific per-match store
Store-->>Adapter: emit updates (active/pending/cached)
Adapter-->>Router: propagate updates
Router-->>Hook: notify hook of store change
Hook-->>App: trigger component update

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A rabbit nibble on the graph so bright,
Tiny stores hop left and right,
Matches hum with their own small song,
Router's chorus swift and strong,
Hooray — each leap feels just right!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'blog(router): refactor signals' directly matches the PR's main objective of adding a blog post about TanStack Router's signal graph refactor, clearly identifying the subject (router), the type of change (blog), and the key topic (refactor signals).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@Sheraff Sheraff changed the title Blog router refactor signals blog(router): refactor signals Mar 23, 2026
@Sheraff Sheraff marked this pull request as ready for review March 23, 2026 21:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ceec1ad026

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/blog/tanstack-router-signal-graph.md (2)

228-228: Avoid duplicate heading text in the second tab block.

React, Solid, and Vue are reused as headings later in the file, triggering MD024. Make the second set unique (for example, “React (Bundle Size)”, etc.) to avoid duplicate anchors/warnings.

Proposed markdown diff
-### React
+### React (Bundle Size)
...
-### Solid
+### Solid (Bundle Size)
...
-### Vue
+### Vue (Bundle Size)

Also applies to: 237-237, 246-246

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 228, The second set of tab
headings duplicates earlier headings ("React", "Solid", "Vue") causing MD024;
update those duplicate headings in the second tab block to unique labels (e.g.,
"React (Bundle Size)", "Solid (Bundle Size)", "Vue (Bundle Size)") so anchors
differ and the linter warning is resolved; locate the headings in the tab block
around the second occurrence and rename the headings used there (the exact
strings "React", "Solid", "Vue") to their new unique variants throughout that
block.

110-110: Fix heading level jumps in tab sections (#### under ##).

The tab headings jump from ## to ####, which triggers MD001. Use ### for the React/Solid/Vue subsection headings in both tab blocks.

Proposed markdown diff
-#### React
+### React
...
-#### Solid
+### Solid
...
-#### Vue
+### Vue
...
-#### React
+### React
...
-#### Solid
+### Solid
...
-#### Vue
+### Vue
...
-#### React
+### React
...
-#### Solid
+### Solid
...
-#### Vue
+### Vue

Also applies to: 119-119, 128-128, 189-189, 198-198, 207-207, 228-228, 237-237, 246-246

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 110, The subsection
headings inside the tab blocks use '####' under a parent '##', causing a
heading-level jump; change those subsection headings for the React, Solid, and
Vue tabs from '####' to '###' so they are one level below the '##' section.
Update every occurrence of the React/Solid/Vue tab headings (the current '####
React', '#### Solid', '#### Vue' instances noted in the comment) to use '###'
instead to fix MD001 consistently across the document.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 269: Update the footnote text for the alias ^alien-bench so the month is
capitalized; locate the footnote line that reads "[^alien-bench]:
[js-reactivity-benchmark](https://github.com/transitive-bullshit/js-reactivity-benchmark)
last updated january 2025" and change "january 2025" to "January 2025" to match
standard date formatting.

---

Nitpick comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 228: The second set of tab headings duplicates earlier headings ("React",
"Solid", "Vue") causing MD024; update those duplicate headings in the second tab
block to unique labels (e.g., "React (Bundle Size)", "Solid (Bundle Size)", "Vue
(Bundle Size)") so anchors differ and the linter warning is resolved; locate the
headings in the tab block around the second occurrence and rename the headings
used there (the exact strings "React", "Solid", "Vue") to their new unique
variants throughout that block.
- Line 110: The subsection headings inside the tab blocks use '####' under a
parent '##', causing a heading-level jump; change those subsection headings for
the React, Solid, and Vue tabs from '####' to '###' so they are one level below
the '##' section. Update every occurrence of the React/Solid/Vue tab headings
(the current '#### React', '#### Solid', '#### Vue' instances noted in the
comment) to use '###' instead to fix MD001 consistently across the document.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee86843c-9132-4d1c-8994-7cc9efb1493f

📥 Commits

Reviewing files that changed from the base of the PR and between b4d12a1 and 895bc58.

⛔ Files ignored due to path filters (12)
  • public/blog-assets/tanstack-router-signal-graph/after-granular-store-graph-2.mp4 is excluded by !**/*.mp4
  • public/blog-assets/tanstack-router-signal-graph/before-granular-store-graph-2.mp4 is excluded by !**/*.mp4
  • public/blog-assets/tanstack-router-signal-graph/bundle-size-history-react.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/bundle-size-history-solid.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/bundle-size-history-vue.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/client-side-nav-react.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/client-side-nav-solid.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/client-side-nav-vue.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/header.jpg is excluded by !**/*.jpg
  • public/blog-assets/tanstack-router-signal-graph/store-updates-history-react.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/store-updates-history-solid.png is excluded by !**/*.png
  • public/blog-assets/tanstack-router-signal-graph/store-updates-history-vue.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/blog/tanstack-router-signal-graph.md

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/blog/tanstack-router-signal-graph.md (1)

272-272: ⚠️ Potential issue | 🟡 Minor

Capitalize month name in footnote.

The month "january" should be capitalized to "January 2025" for consistency with standard date formatting.

📅 Proposed fix
-[^alien-bench]: [js-reactivity-benchmark](https://github.com/transitive-bullshit/js-reactivity-benchmark) last updated january 2025
+[^alien-bench]: [js-reactivity-benchmark](https://github.com/transitive-bullshit/js-reactivity-benchmark) last updated January 2025
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 272, Update the footnote
text for the [^alien-bench] reference by capitalizing the month: change "january
2025" to "January 2025" in the line containing the footnote (the string
"[^alien-bench]:
[js-reactivity-benchmark](https://github.com/transitive-bullshit/js-reactivity-benchmark)
last updated january 2025").
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 142: Replace the phrase "door step" with the correct compound "doorstep"
and remove the vague "as of last week" by replacing the parenthetical "(beta.9
as of last week)" with a stable time marker such as "(beta.9 at time of
writing)" or a specific date; update the sentence that currently reads "Vue
Vapor (3.6) is on the door step (beta.9 as of last week)" to "Vue Vapor (3.6) is
on the doorstep (beta.9 at time of writing)" (locate the sentence using the
quoted fragment "Vue Vapor (3.6) is on the door step (beta.9 as of last week)").

---

Duplicate comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 272: Update the footnote text for the [^alien-bench] reference by
capitalizing the month: change "january 2025" to "January 2025" in the line
containing the footnote (the string "[^alien-bench]:
[js-reactivity-benchmark](https://github.com/transitive-bullshit/js-reactivity-benchmark)
last updated january 2025").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0e1b5dbf-9d64-400e-894b-ad9210dc193a

📥 Commits

Reviewing files that changed from the base of the PR and between 895bc58 and 439d43f.

📒 Files selected for processing (1)
  • src/blog/tanstack-router-signal-graph.md

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/blog/tanstack-router-signal-graph.md (2)

110-110: Normalize heading levels in tab blocks to satisfy markdown linting.

Line 110 and Line 192 jump from ## to ####, which triggers MD001 (heading-increment). If lint is enforced in CI, this should be adjusted.

🛠️ Suggested fix
-#### React
+### React

Apply similarly to sibling headings in those tab groups (Solid, Vue).

Also applies to: 192-192

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 110, The "React" (and
sibling "Solid" and "Vue") tab headings currently use #### which creates a jump
from the surrounding ## level and triggers MD001; update those headings to use
### (or otherwise match the parent level increment) so heading levels are
normalized within the tab blocks (locate the "React", "Solid", "Vue" headings in
the tab groups and change #### to ###).

231-231: Disambiguate repeated tab heading titles to avoid MD024 duplicates.

#### React, #### Solid, and #### Vue are reused across multiple sections (e.g., Line 231, 240, 249), which triggers duplicate-heading lint warnings.

🛠️ Suggested fix
-#### React
+### React (Bundle size)

-#### Solid
+### Solid (Bundle size)

-#### Vue
+### Vue (Bundle size)

Use analogous disambiguation in other tab groups if needed.

Also applies to: 240-240, 249-249

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 231, Multiple tab groups
reuse identical headings causing MD024 duplicates; update the repeated headings
"#### React", "#### Solid", and "#### Vue" to be unique per tab group (for
example "#### React (Client)", "#### React (Server)", or add the related
section/context like "#### React — Routing", and similarly disambiguate "Solid"
and "Vue") so each tab heading is distinct across the document; search for the
exact heading tokens "#### React", "#### Solid", and "#### Vue" and replace them
with context-specific variants consistently in each tab group.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 195: Replace the empty alt attributes on the benchmark chart images with
concise descriptive text: update the <img> tag for "client-side-nav-react.png"
(and the other two chart images referenced in the same section) to include short
alt text that summarizes the chart content (e.g., "Client-side navigation
benchmark: React vs others — load time and CPU usage" or similar specific
descriptions matching each chart). Ensure each image tag's alt attribute is
non-empty and uniquely describes what that particular chart shows for
accessibility.

---

Nitpick comments:
In `@src/blog/tanstack-router-signal-graph.md`:
- Line 110: The "React" (and sibling "Solid" and "Vue") tab headings currently
use #### which creates a jump from the surrounding ## level and triggers MD001;
update those headings to use ### (or otherwise match the parent level increment)
so heading levels are normalized within the tab blocks (locate the "React",
"Solid", "Vue" headings in the tab groups and change #### to ###).
- Line 231: Multiple tab groups reuse identical headings causing MD024
duplicates; update the repeated headings "#### React", "#### Solid", and "####
Vue" to be unique per tab group (for example "#### React (Client)", "#### React
(Server)", or add the related section/context like "#### React — Routing", and
similarly disambiguate "Solid" and "Vue") so each tab heading is distinct across
the document; search for the exact heading tokens "#### React", "#### Solid",
and "#### Vue" and replace them with context-specific variants consistently in
each tab group.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ec50678-9899-4ecb-83ec-2c59a066b82f

📥 Commits

Reviewing files that changed from the base of the PR and between 439d43f and 75bbe5b.

📒 Files selected for processing (1)
  • src/blog/tanstack-router-signal-graph.md

#### React

<figure>
<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-react.png" alt="">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add descriptive alt text for benchmark charts.

Line 195, Line 204, and Line 213 currently use empty alt="" on informative images. These charts convey core results, so they should have short descriptive alt text for accessibility.

♿ Suggested fix
-<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-react.png" alt="">
+<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-react.png" alt="React client-side navigation benchmark comparing main (grey) vs refactor-signals (blue), showing reduced navigation duration">

-<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-solid.png" alt="">
+<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-solid.png" alt="Solid client-side navigation benchmark comparing main (grey) vs refactor-signals (blue), showing reduced navigation duration">

-<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-vue.png" alt="">
+<img src="/blog-assets/tanstack-router-signal-graph/client-side-nav-vue.png" alt="Vue client-side navigation benchmark comparing main (grey) vs refactor-signals (blue), showing reduced navigation duration">

Also applies to: 204-204, 213-213

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/blog/tanstack-router-signal-graph.md` at line 195, Replace the empty alt
attributes on the benchmark chart images with concise descriptive text: update
the <img> tag for "client-side-nav-react.png" (and the other two chart images
referenced in the same section) to include short alt text that summarizes the
chart content (e.g., "Client-side navigation benchmark: React vs others — load
time and CPU usage" or similar specific descriptions matching each chart).
Ensure each image tag's alt attribute is non-empty and uniquely describes what
that particular chart shows for accessibility.

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