Skip to content

Commit 5be6587

Browse files
committed
chore(devtools): consolidate the changeset and tighten a virtualization test
Collapses the per-fix changesets into the single entry this pull request should produce, matching how the devtools changelog is written elsewhere - one entry per pull request rather than one per commit. The entry also records that the coalescing window widens with the measured cost of a pass, which is the one user-visible timing change in this work. Also replaces an assertion in the row-recycling test that reduced to `reused.length === reused.length` and so passed whatever the virtualizer did. The scroll in that test advances the window by exactly one row, so the exact count is assertable. Drops an `overscan` prop on the internal virtual list that no call site ever set.
1 parent ee31469 commit 5be6587

12 files changed

Lines changed: 21 additions & 135 deletions

.changeset/devtools-batch-mutation-fanout.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

.changeset/devtools-coalesce-whole-cache-subscribers.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

.changeset/devtools-details-keyed-lookup.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@tanstack/query-devtools': patch
3+
---
4+
5+
Stop the devtools panel freezing the page when the query cache holds thousands of queries.
6+
7+
The panel rendered one row per cached query and per cached mutation with no windowing, and several of its subscriptions walked the whole cache on every cache event, so both the mount cost and the per-event cost grew with the size of the cache. Opening the panel against a large cache could lock up the page, and it stayed locked up while the cache kept changing.
8+
9+
- Both lists are virtualized: rows are a fixed height and only those intersecting the scroll viewport, plus a small overscan, are mounted.
10+
- `MutationRow` reads its state directly instead of resolving it through the cache.
11+
- The details panes resolve their query by key rather than scanning the cache, and the status badges tally all five statuses in a single pass instead of one scan each.
12+
- The mutation cache fan-out is batched, and tearing one panel down no longer unsubscribes another panel that is still mounted.
13+
- The stylesheet is compiled once per theme and shared, rather than recompiled for every row and every expanded node of the JSON explorer.
14+
- The query list keeps its array identity when its contents have not changed, so consumers only rerun when the list really changed.
15+
- The two subscribers that walk the whole cache coalesce, so a stream of cache events costs one pass per window rather than one pass per event. The window is at least one frame and widens to a multiple of the last pass's measured cost, which bounds the share of the main thread the panel can take as the cache grows; whole-cache tallies can therefore lag a large cache by more than a frame, while per-row state stays immediate.

.changeset/devtools-panel-subscription-teardown.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.changeset/devtools-row-identity.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.changeset/devtools-shared-stylesheet-cache.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

.changeset/devtools-stable-list-identity.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.changeset/devtools-status-count-single-pass.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.changeset/virtualize-devtools-lists.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)