Skip to content
Source
Sign inSign up
TanStack/query

fix(query-devtools): isolate state across multiple mounted instances #11116

Closedalishoja88(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/11116/headopened View on GitHub

Showing 8 changed files with 176 additions and 6 deletions (loading 5).

x
0 of 8 viewed, 8 left
5 additions and 0 deletions.changeset/isolate-devtools-instances.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+"@tanstack/query-devtools": patch
+---
+​
+Fix multiple mounted Devtools instances (e.g. two panels pointing at two different `QueryClient`s) sharing selection, panel width, offline-mocking, and cache-subscription state through module-level signals and maps. Each Devtools instance now owns its own isolated UI/subscription state, so selecting a query, resizing, or mocking offline behavior in one panel no longer affects any other mounted panel.
16 additions and 6 deletionspackages/query-devtools/src/__tests__/Devtools.test.tsxModified
View file
@@ -9,7 +9,12 @@
import { fireEvent, render } from '@solidjs/testing-library'
import { createLocalStorage } from '@solid-primitives/storage'
import { Devtools } from '../Devtools'
-import { PiPProvider, QueryDevtoolsContext, ThemeContext } from '../contexts'
+import {
+ DevtoolsUiProvider,
+ PiPProvider,
+ QueryDevtoolsContext,
+ ThemeContext,
+} from '../contexts'
import type { QueryDevtoolsProps } from '../contexts'
​
// `solid-transition-group` internally imports from
@@ -124,11 +129,16 @@