Skip to content

Commit e99043f

Browse files
committed
add nuggets
1 parent 81afc88 commit e99043f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/blog/tanstack-router-signal-graph.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ A video showing that on stateful event in the core of the router, only specific
6868
</figcaption>
6969
</figure>
7070

71+
> [!NOTE]
72+
> Active, pending, and cached matches are now modeled differently because
73+
> they have different lifecycles. This reduces state propagation even further.
74+
7175
The important change is simple: the compatibility snapshot is now derived from the graph, instead of the graph being derived from the snapshot.
7276

7377
## Hook-Level Change: Subscribe to the Relevant Store
@@ -87,6 +91,11 @@ const matchStore = router.stores.getMatchStoreByRouteId(routeId)
8791
useStore(matchStore, (match) => /* select from one match */)
8892
```
8993

94+
> [!NOTE]
95+
> `getMatchStoreByRouteId` creates a derived signal on demand, and stores it
96+
> in a Least-Recently-Used cache so it can be reused by other subscribers
97+
> without leaking memory.
98+
9099
The store-update-count graphs below show the before/after change within each adapter. Absolute counts are not directly comparable across frameworks, because React, Solid, and Vue do not propagate updates in exactly the same way.
91100

92101
<!-- ::start:tabs -->
@@ -140,6 +149,10 @@ export type StoreConfig = {
140149
141150
This keeps one router core while letting each adapter plug in the store model it wants.
142151
152+
> [!NOTE]
153+
> Solid's derived stores are backed by native memos, and the adapter uses a `FinalizationRegistry`
154+
> to dispose detached roots when those stores are garbage-collected.
155+
143156
## Observable Result: Less Work During Navigation
144157
145158
No new public API is required here. `useMatch`, `useLocation`, and `<Link>` keep the same surface. The difference is that navigation and preload flows now wake up fewer subscriptions.

0 commit comments

Comments
 (0)