@tanstack/query-devtools 5.12.1 → 5.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Devtools/{ANE6OXOK.js → JDX7DFYK.js} +36 -12
- package/build/Devtools/{Y6OLANNQ.jsx → KEJBG6PF.jsx} +45 -12
- package/build/Devtools/{E3UEEC63.js → N66J3ZXT.js} +36 -12
- package/build/Devtools/{OG2NFD3H.jsx → YGZHNM6M.jsx} +45 -12
- package/build/dev.cjs +36 -12
- package/build/dev.js +1 -1
- package/build/dev.jsx +1 -1
- package/build/index.cjs +36 -12
- package/build/index.js +1 -1
- package/build/index.jsx +1 -1
- package/package.json +2 -2
- package/src/Devtools.tsx +51 -9
|
@@ -10236,6 +10236,9 @@ var ContentView = (props) => {
|
|
|
10236
10236
|
const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
|
|
10237
10237
|
height: 50%;
|
|
10238
10238
|
max-height: 50%;
|
|
10239
|
+
`, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
10240
|
+
height: 100%;
|
|
10241
|
+
max-height: 100%;
|
|
10239
10242
|
`, "tsqd-queries-container"), _v$7 = clsx(styles().row, "tsqd-header"), _v$8 = styles().logoAndToggleContainer, _v$9 = clsx(styles().logo, "tsqd-text-logo-container"), _v$10 = clsx(styles().tanstackLogo, "tsqd-text-logo-tanstack"), _v$11 = clsx(styles().queryFlavorLogo, "tsqd-text-logo-query-flavor"), _v$12 = clsx(styles().row, "tsqd-filters-actions-container"), _v$13 = clsx(styles().filtersContainer, "tsqd-filters-container"), _v$14 = clsx(styles().filterInput, "tsqd-query-filter-textfield-container"), _v$15 = clsx(styles().filterSelect, "tsqd-query-filter-sort-container"), _v$16 = `Sort order ${(selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1 ? "descending" : "ascending"}`, _v$17 = (selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1, _v$18 = clsx(styles().actionsContainer, "tsqd-actions-container"), _v$19 = clsx(styles().actionsBtn, "tsqd-actions-btn", "tsqd-action-clear-cache"), _v$20 = `Clear ${selectedView()} cache`, _v$21 = clsx(styles().actionsBtn, offline() && styles().actionsBtnOffline, "tsqd-actions-btn", "tsqd-action-mock-offline-behavior"), _v$22 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`, _v$23 = offline(), _v$24 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`;
|
|
10240
10243
|
_v$6 !== _p$._v$6 && className(_el$8, _p$._v$6 = _v$6);
|
|
10241
10244
|
_v$7 !== _p$._v$7 && className(_el$9, _p$._v$7 = _v$7);
|
|
@@ -10308,16 +10311,16 @@ var QueryRow = (props) => {
|
|
|
10308
10311
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
10309
10312
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10310
10313
|
queryKey: props.query.queryKey
|
|
10311
|
-
})?.state);
|
|
10314
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10312
10315
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10313
10316
|
queryKey: props.query.queryKey
|
|
10314
|
-
})?.isDisabled() ?? false);
|
|
10317
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10315
10318
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10316
10319
|
queryKey: props.query.queryKey
|
|
10317
|
-
})?.isStale() ?? false);
|
|
10320
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10318
10321
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10319
10322
|
queryKey: props.query.queryKey
|
|
10320
|
-
})?.getObserversCount() ?? 0);
|
|
10323
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10321
10324
|
const color = createMemo(() => getQueryStatusColor({
|
|
10322
10325
|
queryState: queryState(),
|
|
10323
10326
|
observerCount: observers(),
|
|
@@ -11107,12 +11110,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11107
11110
|
const client = useQueryDevtoolsContext().client;
|
|
11108
11111
|
return client.getQueryCache();
|
|
11109
11112
|
});
|
|
11110
|
-
const unsub = queryCache().subscribe(() => {
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11113
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11114
|
+
batch(() => {
|
|
11115
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11116
|
+
if (!value.shouldUpdate(q))
|
|
11117
|
+
continue;
|
|
11118
|
+
value.setter(callback(queryCache));
|
|
11119
|
+
}
|
|
11120
|
+
});
|
|
11116
11121
|
});
|
|
11117
11122
|
onCleanup(() => {
|
|
11118
11123
|
queryCacheMap.clear();
|
|
@@ -11120,7 +11125,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11120
11125
|
});
|
|
11121
11126
|
return unsub;
|
|
11122
11127
|
};
|
|
11123
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11128
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11124
11129
|
const queryCache = createMemo(() => {
|
|
11125
11130
|
const client = useQueryDevtoolsContext().client;
|
|
11126
11131
|
return client.getQueryCache();
|
|
@@ -11131,7 +11136,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11131
11136
|
createEffect(() => {
|
|
11132
11137
|
setValue(callback(queryCache));
|
|
11133
11138
|
});
|
|
11134
|
-
queryCacheMap.set(callback,
|
|
11139
|
+
queryCacheMap.set(callback, {
|
|
11140
|
+
setter: setValue,
|
|
11141
|
+
shouldUpdate
|
|
11142
|
+
});
|
|
11135
11143
|
onCleanup(() => {
|
|
11136
11144
|
queryCacheMap.delete(callback);
|
|
11137
11145
|
});
|
|
@@ -11247,6 +11255,22 @@ var stylesFactory2 = (theme) => {
|
|
|
11247
11255
|
box-sizing: border-box;
|
|
11248
11256
|
text-transform: none;
|
|
11249
11257
|
}
|
|
11258
|
+
|
|
11259
|
+
& *::-webkit-scrollbar {
|
|
11260
|
+
width: 7px;
|
|
11261
|
+
}
|
|
11262
|
+
|
|
11263
|
+
& *::-webkit-scrollbar-track {
|
|
11264
|
+
background: transparent;
|
|
11265
|
+
}
|
|
11266
|
+
|
|
11267
|
+
& *::-webkit-scrollbar-thumb {
|
|
11268
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
11269
|
+
}
|
|
11270
|
+
|
|
11271
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
11272
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
11273
|
+
}
|
|
11250
11274
|
`,
|
|
11251
11275
|
"devtoolsBtn-position-bottom-right": u`
|
|
11252
11276
|
bottom: 12px;
|
|
@@ -10793,6 +10793,10 @@ var ContentView = (props) => {
|
|
|
10793
10793
|
height: 50%;
|
|
10794
10794
|
max-height: 50%;
|
|
10795
10795
|
`,
|
|
10796
|
+
panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
10797
|
+
height: 100%;
|
|
10798
|
+
max-height: 100%;
|
|
10799
|
+
`,
|
|
10796
10800
|
"tsqd-queries-container"
|
|
10797
10801
|
)}
|
|
10798
10802
|
ref={containerRef}
|
|
@@ -11151,22 +11155,30 @@ var QueryRow = (props) => {
|
|
|
11151
11155
|
const queryState = createSubscribeToQueryCacheBatcher(
|
|
11152
11156
|
(queryCache) => queryCache().find({
|
|
11153
11157
|
queryKey: props.query.queryKey
|
|
11154
|
-
})?.state
|
|
11158
|
+
})?.state,
|
|
11159
|
+
true,
|
|
11160
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11155
11161
|
);
|
|
11156
11162
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
11157
11163
|
(queryCache) => queryCache().find({
|
|
11158
11164
|
queryKey: props.query.queryKey
|
|
11159
|
-
})?.isDisabled() ?? false
|
|
11165
|
+
})?.isDisabled() ?? false,
|
|
11166
|
+
true,
|
|
11167
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11160
11168
|
);
|
|
11161
11169
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
11162
11170
|
(queryCache) => queryCache().find({
|
|
11163
11171
|
queryKey: props.query.queryKey
|
|
11164
|
-
})?.isStale() ?? false
|
|
11172
|
+
})?.isStale() ?? false,
|
|
11173
|
+
true,
|
|
11174
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11165
11175
|
);
|
|
11166
11176
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
11167
11177
|
(queryCache) => queryCache().find({
|
|
11168
11178
|
queryKey: props.query.queryKey
|
|
11169
|
-
})?.getObserversCount() ?? 0
|
|
11179
|
+
})?.getObserversCount() ?? 0,
|
|
11180
|
+
true,
|
|
11181
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11170
11182
|
);
|
|
11171
11183
|
const color = createMemo(
|
|
11172
11184
|
() => getQueryStatusColor({
|
|
@@ -11910,12 +11922,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11910
11922
|
const client = useQueryDevtoolsContext().client;
|
|
11911
11923
|
return client.getQueryCache();
|
|
11912
11924
|
});
|
|
11913
|
-
const unsub = queryCache().subscribe(() => {
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11925
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11926
|
+
batch(() => {
|
|
11927
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11928
|
+
if (!value.shouldUpdate(q))
|
|
11929
|
+
continue;
|
|
11930
|
+
value.setter(callback(queryCache));
|
|
11931
|
+
}
|
|
11932
|
+
});
|
|
11919
11933
|
});
|
|
11920
11934
|
onCleanup(() => {
|
|
11921
11935
|
queryCacheMap.clear();
|
|
@@ -11923,7 +11937,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11923
11937
|
});
|
|
11924
11938
|
return unsub;
|
|
11925
11939
|
};
|
|
11926
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11940
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11927
11941
|
const queryCache = createMemo(() => {
|
|
11928
11942
|
const client = useQueryDevtoolsContext().client;
|
|
11929
11943
|
return client.getQueryCache();
|
|
@@ -11935,7 +11949,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11935
11949
|
createEffect(() => {
|
|
11936
11950
|
setValue(callback(queryCache));
|
|
11937
11951
|
});
|
|
11938
|
-
queryCacheMap.set(callback,
|
|
11952
|
+
queryCacheMap.set(callback, {
|
|
11953
|
+
setter: setValue,
|
|
11954
|
+
shouldUpdate
|
|
11955
|
+
});
|
|
11939
11956
|
onCleanup(() => {
|
|
11940
11957
|
queryCacheMap.delete(callback);
|
|
11941
11958
|
});
|
|
@@ -12045,6 +12062,22 @@ var stylesFactory2 = (theme) => {
|
|
|
12045
12062
|
box-sizing: border-box;
|
|
12046
12063
|
text-transform: none;
|
|
12047
12064
|
}
|
|
12065
|
+
|
|
12066
|
+
& *::-webkit-scrollbar {
|
|
12067
|
+
width: 7px;
|
|
12068
|
+
}
|
|
12069
|
+
|
|
12070
|
+
& *::-webkit-scrollbar-track {
|
|
12071
|
+
background: transparent;
|
|
12072
|
+
}
|
|
12073
|
+
|
|
12074
|
+
& *::-webkit-scrollbar-thumb {
|
|
12075
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
12076
|
+
}
|
|
12077
|
+
|
|
12078
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
12079
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
12080
|
+
}
|
|
12048
12081
|
`,
|
|
12049
12082
|
"devtoolsBtn-position-bottom-right": u`
|
|
12050
12083
|
bottom: 12px;
|
|
@@ -10235,6 +10235,9 @@ var ContentView = (props) => {
|
|
|
10235
10235
|
const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
|
|
10236
10236
|
height: 50%;
|
|
10237
10237
|
max-height: 50%;
|
|
10238
|
+
`, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
10239
|
+
height: 100%;
|
|
10240
|
+
max-height: 100%;
|
|
10238
10241
|
`, "tsqd-queries-container"), _v$7 = clsx(styles().row, "tsqd-header"), _v$8 = styles().logoAndToggleContainer, _v$9 = clsx(styles().logo, "tsqd-text-logo-container"), _v$10 = clsx(styles().tanstackLogo, "tsqd-text-logo-tanstack"), _v$11 = clsx(styles().queryFlavorLogo, "tsqd-text-logo-query-flavor"), _v$12 = clsx(styles().row, "tsqd-filters-actions-container"), _v$13 = clsx(styles().filtersContainer, "tsqd-filters-container"), _v$14 = clsx(styles().filterInput, "tsqd-query-filter-textfield-container"), _v$15 = clsx(styles().filterSelect, "tsqd-query-filter-sort-container"), _v$16 = `Sort order ${(selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1 ? "descending" : "ascending"}`, _v$17 = (selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1, _v$18 = clsx(styles().actionsContainer, "tsqd-actions-container"), _v$19 = clsx(styles().actionsBtn, "tsqd-actions-btn", "tsqd-action-clear-cache"), _v$20 = `Clear ${selectedView()} cache`, _v$21 = clsx(styles().actionsBtn, offline() && styles().actionsBtnOffline, "tsqd-actions-btn", "tsqd-action-mock-offline-behavior"), _v$22 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`, _v$23 = offline(), _v$24 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`;
|
|
10239
10242
|
_v$6 !== _p$._v$6 && className(_el$8, _p$._v$6 = _v$6);
|
|
10240
10243
|
_v$7 !== _p$._v$7 && className(_el$9, _p$._v$7 = _v$7);
|
|
@@ -10307,16 +10310,16 @@ var QueryRow = (props) => {
|
|
|
10307
10310
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
10308
10311
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10309
10312
|
queryKey: props.query.queryKey
|
|
10310
|
-
})?.state);
|
|
10313
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10311
10314
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10312
10315
|
queryKey: props.query.queryKey
|
|
10313
|
-
})?.isDisabled() ?? false);
|
|
10316
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10314
10317
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10315
10318
|
queryKey: props.query.queryKey
|
|
10316
|
-
})?.isStale() ?? false);
|
|
10319
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10317
10320
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10318
10321
|
queryKey: props.query.queryKey
|
|
10319
|
-
})?.getObserversCount() ?? 0);
|
|
10322
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10320
10323
|
const color = createMemo(() => getQueryStatusColor({
|
|
10321
10324
|
queryState: queryState(),
|
|
10322
10325
|
observerCount: observers(),
|
|
@@ -11106,12 +11109,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11106
11109
|
const client = useQueryDevtoolsContext().client;
|
|
11107
11110
|
return client.getQueryCache();
|
|
11108
11111
|
});
|
|
11109
|
-
const unsub = queryCache().subscribe(() => {
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11112
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11113
|
+
batch(() => {
|
|
11114
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11115
|
+
if (!value.shouldUpdate(q))
|
|
11116
|
+
continue;
|
|
11117
|
+
value.setter(callback(queryCache));
|
|
11118
|
+
}
|
|
11119
|
+
});
|
|
11115
11120
|
});
|
|
11116
11121
|
onCleanup(() => {
|
|
11117
11122
|
queryCacheMap.clear();
|
|
@@ -11119,7 +11124,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11119
11124
|
});
|
|
11120
11125
|
return unsub;
|
|
11121
11126
|
};
|
|
11122
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11127
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11123
11128
|
const queryCache = createMemo(() => {
|
|
11124
11129
|
const client = useQueryDevtoolsContext().client;
|
|
11125
11130
|
return client.getQueryCache();
|
|
@@ -11130,7 +11135,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11130
11135
|
createEffect(() => {
|
|
11131
11136
|
setValue(callback(queryCache));
|
|
11132
11137
|
});
|
|
11133
|
-
queryCacheMap.set(callback,
|
|
11138
|
+
queryCacheMap.set(callback, {
|
|
11139
|
+
setter: setValue,
|
|
11140
|
+
shouldUpdate
|
|
11141
|
+
});
|
|
11134
11142
|
onCleanup(() => {
|
|
11135
11143
|
queryCacheMap.delete(callback);
|
|
11136
11144
|
});
|
|
@@ -11246,6 +11254,22 @@ var stylesFactory2 = (theme) => {
|
|
|
11246
11254
|
box-sizing: border-box;
|
|
11247
11255
|
text-transform: none;
|
|
11248
11256
|
}
|
|
11257
|
+
|
|
11258
|
+
& *::-webkit-scrollbar {
|
|
11259
|
+
width: 7px;
|
|
11260
|
+
}
|
|
11261
|
+
|
|
11262
|
+
& *::-webkit-scrollbar-track {
|
|
11263
|
+
background: transparent;
|
|
11264
|
+
}
|
|
11265
|
+
|
|
11266
|
+
& *::-webkit-scrollbar-thumb {
|
|
11267
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
11268
|
+
}
|
|
11269
|
+
|
|
11270
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
11271
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
11272
|
+
}
|
|
11249
11273
|
`,
|
|
11250
11274
|
"devtoolsBtn-position-bottom-right": u`
|
|
11251
11275
|
bottom: 12px;
|
|
@@ -10794,6 +10794,10 @@ var ContentView = (props) => {
|
|
|
10794
10794
|
height: 50%;
|
|
10795
10795
|
max-height: 50%;
|
|
10796
10796
|
`,
|
|
10797
|
+
panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
10798
|
+
height: 100%;
|
|
10799
|
+
max-height: 100%;
|
|
10800
|
+
`,
|
|
10797
10801
|
"tsqd-queries-container"
|
|
10798
10802
|
)}
|
|
10799
10803
|
ref={containerRef}
|
|
@@ -11152,22 +11156,30 @@ var QueryRow = (props) => {
|
|
|
11152
11156
|
const queryState = createSubscribeToQueryCacheBatcher(
|
|
11153
11157
|
(queryCache) => queryCache().find({
|
|
11154
11158
|
queryKey: props.query.queryKey
|
|
11155
|
-
})?.state
|
|
11159
|
+
})?.state,
|
|
11160
|
+
true,
|
|
11161
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11156
11162
|
);
|
|
11157
11163
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
11158
11164
|
(queryCache) => queryCache().find({
|
|
11159
11165
|
queryKey: props.query.queryKey
|
|
11160
|
-
})?.isDisabled() ?? false
|
|
11166
|
+
})?.isDisabled() ?? false,
|
|
11167
|
+
true,
|
|
11168
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11161
11169
|
);
|
|
11162
11170
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
11163
11171
|
(queryCache) => queryCache().find({
|
|
11164
11172
|
queryKey: props.query.queryKey
|
|
11165
|
-
})?.isStale() ?? false
|
|
11173
|
+
})?.isStale() ?? false,
|
|
11174
|
+
true,
|
|
11175
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11166
11176
|
);
|
|
11167
11177
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
11168
11178
|
(queryCache) => queryCache().find({
|
|
11169
11179
|
queryKey: props.query.queryKey
|
|
11170
|
-
})?.getObserversCount() ?? 0
|
|
11180
|
+
})?.getObserversCount() ?? 0,
|
|
11181
|
+
true,
|
|
11182
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11171
11183
|
);
|
|
11172
11184
|
const color = createMemo(
|
|
11173
11185
|
() => getQueryStatusColor({
|
|
@@ -11911,12 +11923,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11911
11923
|
const client = useQueryDevtoolsContext().client;
|
|
11912
11924
|
return client.getQueryCache();
|
|
11913
11925
|
});
|
|
11914
|
-
const unsub = queryCache().subscribe(() => {
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11926
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11927
|
+
batch(() => {
|
|
11928
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11929
|
+
if (!value.shouldUpdate(q))
|
|
11930
|
+
continue;
|
|
11931
|
+
value.setter(callback(queryCache));
|
|
11932
|
+
}
|
|
11933
|
+
});
|
|
11920
11934
|
});
|
|
11921
11935
|
onCleanup(() => {
|
|
11922
11936
|
queryCacheMap.clear();
|
|
@@ -11924,7 +11938,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11924
11938
|
});
|
|
11925
11939
|
return unsub;
|
|
11926
11940
|
};
|
|
11927
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11941
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11928
11942
|
const queryCache = createMemo(() => {
|
|
11929
11943
|
const client = useQueryDevtoolsContext().client;
|
|
11930
11944
|
return client.getQueryCache();
|
|
@@ -11936,7 +11950,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11936
11950
|
createEffect(() => {
|
|
11937
11951
|
setValue(callback(queryCache));
|
|
11938
11952
|
});
|
|
11939
|
-
queryCacheMap.set(callback,
|
|
11953
|
+
queryCacheMap.set(callback, {
|
|
11954
|
+
setter: setValue,
|
|
11955
|
+
shouldUpdate
|
|
11956
|
+
});
|
|
11940
11957
|
onCleanup(() => {
|
|
11941
11958
|
queryCacheMap.delete(callback);
|
|
11942
11959
|
});
|
|
@@ -12046,6 +12063,22 @@ var stylesFactory2 = (theme) => {
|
|
|
12046
12063
|
box-sizing: border-box;
|
|
12047
12064
|
text-transform: none;
|
|
12048
12065
|
}
|
|
12066
|
+
|
|
12067
|
+
& *::-webkit-scrollbar {
|
|
12068
|
+
width: 7px;
|
|
12069
|
+
}
|
|
12070
|
+
|
|
12071
|
+
& *::-webkit-scrollbar-track {
|
|
12072
|
+
background: transparent;
|
|
12073
|
+
}
|
|
12074
|
+
|
|
12075
|
+
& *::-webkit-scrollbar-thumb {
|
|
12076
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
12077
|
+
}
|
|
12078
|
+
|
|
12079
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
12080
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
12081
|
+
}
|
|
12049
12082
|
`,
|
|
12050
12083
|
"devtoolsBtn-position-bottom-right": u`
|
|
12051
12084
|
bottom: 12px;
|
package/build/dev.cjs
CHANGED
|
@@ -13759,6 +13759,9 @@ var init_Devtools = __esm({
|
|
|
13759
13759
|
const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
|
|
13760
13760
|
height: 50%;
|
|
13761
13761
|
max-height: 50%;
|
|
13762
|
+
`, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
13763
|
+
height: 100%;
|
|
13764
|
+
max-height: 100%;
|
|
13762
13765
|
`, "tsqd-queries-container"), _v$7 = clsx(styles().row, "tsqd-header"), _v$8 = styles().logoAndToggleContainer, _v$9 = clsx(styles().logo, "tsqd-text-logo-container"), _v$10 = clsx(styles().tanstackLogo, "tsqd-text-logo-tanstack"), _v$11 = clsx(styles().queryFlavorLogo, "tsqd-text-logo-query-flavor"), _v$12 = clsx(styles().row, "tsqd-filters-actions-container"), _v$13 = clsx(styles().filtersContainer, "tsqd-filters-container"), _v$14 = clsx(styles().filterInput, "tsqd-query-filter-textfield-container"), _v$15 = clsx(styles().filterSelect, "tsqd-query-filter-sort-container"), _v$16 = `Sort order ${(selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1 ? "descending" : "ascending"}`, _v$17 = (selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1, _v$18 = clsx(styles().actionsContainer, "tsqd-actions-container"), _v$19 = clsx(styles().actionsBtn, "tsqd-actions-btn", "tsqd-action-clear-cache"), _v$20 = `Clear ${selectedView()} cache`, _v$21 = clsx(styles().actionsBtn, offline() && styles().actionsBtnOffline, "tsqd-actions-btn", "tsqd-action-mock-offline-behavior"), _v$22 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`, _v$23 = offline(), _v$24 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`;
|
|
13763
13766
|
_v$6 !== _p$._v$6 && className(_el$8, _p$._v$6 = _v$6);
|
|
13764
13767
|
_v$7 !== _p$._v$7 && className(_el$9, _p$._v$7 = _v$7);
|
|
@@ -13831,16 +13834,16 @@ var init_Devtools = __esm({
|
|
|
13831
13834
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
13832
13835
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13833
13836
|
queryKey: props.query.queryKey
|
|
13834
|
-
})?.state);
|
|
13837
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13835
13838
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13836
13839
|
queryKey: props.query.queryKey
|
|
13837
|
-
})?.isDisabled() ?? false);
|
|
13840
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13838
13841
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13839
13842
|
queryKey: props.query.queryKey
|
|
13840
|
-
})?.isStale() ?? false);
|
|
13843
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13841
13844
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13842
13845
|
queryKey: props.query.queryKey
|
|
13843
|
-
})?.getObserversCount() ?? 0);
|
|
13846
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13844
13847
|
const color = createMemo(() => getQueryStatusColor({
|
|
13845
13848
|
queryState: queryState(),
|
|
13846
13849
|
observerCount: observers(),
|
|
@@ -14630,12 +14633,14 @@ var init_Devtools = __esm({
|
|
|
14630
14633
|
const client = useQueryDevtoolsContext().client;
|
|
14631
14634
|
return client.getQueryCache();
|
|
14632
14635
|
});
|
|
14633
|
-
const unsub = queryCache().subscribe(() => {
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14636
|
+
const unsub = queryCache().subscribe((q) => {
|
|
14637
|
+
batch(() => {
|
|
14638
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
14639
|
+
if (!value.shouldUpdate(q))
|
|
14640
|
+
continue;
|
|
14641
|
+
value.setter(callback(queryCache));
|
|
14642
|
+
}
|
|
14643
|
+
});
|
|
14639
14644
|
});
|
|
14640
14645
|
onCleanup(() => {
|
|
14641
14646
|
queryCacheMap.clear();
|
|
@@ -14643,7 +14648,7 @@ var init_Devtools = __esm({
|
|
|
14643
14648
|
});
|
|
14644
14649
|
return unsub;
|
|
14645
14650
|
};
|
|
14646
|
-
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
14651
|
+
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
14647
14652
|
const queryCache = createMemo(() => {
|
|
14648
14653
|
const client = useQueryDevtoolsContext().client;
|
|
14649
14654
|
return client.getQueryCache();
|
|
@@ -14654,7 +14659,10 @@ var init_Devtools = __esm({
|
|
|
14654
14659
|
createEffect(() => {
|
|
14655
14660
|
setValue(callback(queryCache));
|
|
14656
14661
|
});
|
|
14657
|
-
queryCacheMap.set(callback,
|
|
14662
|
+
queryCacheMap.set(callback, {
|
|
14663
|
+
setter: setValue,
|
|
14664
|
+
shouldUpdate
|
|
14665
|
+
});
|
|
14658
14666
|
onCleanup(() => {
|
|
14659
14667
|
queryCacheMap.delete(callback);
|
|
14660
14668
|
});
|
|
@@ -14770,6 +14778,22 @@ var init_Devtools = __esm({
|
|
|
14770
14778
|
box-sizing: border-box;
|
|
14771
14779
|
text-transform: none;
|
|
14772
14780
|
}
|
|
14781
|
+
|
|
14782
|
+
& *::-webkit-scrollbar {
|
|
14783
|
+
width: 7px;
|
|
14784
|
+
}
|
|
14785
|
+
|
|
14786
|
+
& *::-webkit-scrollbar-track {
|
|
14787
|
+
background: transparent;
|
|
14788
|
+
}
|
|
14789
|
+
|
|
14790
|
+
& *::-webkit-scrollbar-thumb {
|
|
14791
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
14792
|
+
}
|
|
14793
|
+
|
|
14794
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
14795
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
14796
|
+
}
|
|
14773
14797
|
`,
|
|
14774
14798
|
"devtoolsBtn-position-bottom-right": u`
|
|
14775
14799
|
bottom: 12px;
|
package/build/dev.js
CHANGED
|
@@ -65,7 +65,7 @@ var TanstackQueryDevtools = class {
|
|
|
65
65
|
if (this.#Component) {
|
|
66
66
|
Devtools = this.#Component;
|
|
67
67
|
} else {
|
|
68
|
-
Devtools = lazy(() => import('./Devtools/
|
|
68
|
+
Devtools = lazy(() => import('./Devtools/JDX7DFYK.js'));
|
|
69
69
|
this.#Component = Devtools;
|
|
70
70
|
}
|
|
71
71
|
setupStyleSheet(this.#styleNonce);
|
package/build/dev.jsx
CHANGED
|
@@ -70,7 +70,7 @@ var TanstackQueryDevtools = class {
|
|
|
70
70
|
if (this.#Component) {
|
|
71
71
|
Devtools = this.#Component;
|
|
72
72
|
} else {
|
|
73
|
-
Devtools = lazy(() => import("./Devtools/
|
|
73
|
+
Devtools = lazy(() => import("./Devtools/YGZHNM6M.jsx"));
|
|
74
74
|
this.#Component = Devtools;
|
|
75
75
|
}
|
|
76
76
|
setupStyleSheet(this.#styleNonce);
|
package/build/index.cjs
CHANGED
|
@@ -13757,6 +13757,9 @@ var init_Devtools = __esm({
|
|
|
13757
13757
|
const _v$6 = clsx(styles().queriesContainer, panelWidth() < secondBreakpoint && (selectedQueryHash() || selectedMutationId()) && u`
|
|
13758
13758
|
height: 50%;
|
|
13759
13759
|
max-height: 50%;
|
|
13760
|
+
`, panelWidth() < secondBreakpoint && !(selectedQueryHash() || selectedMutationId()) && u`
|
|
13761
|
+
height: 100%;
|
|
13762
|
+
max-height: 100%;
|
|
13760
13763
|
`, "tsqd-queries-container"), _v$7 = clsx(styles().row, "tsqd-header"), _v$8 = styles().logoAndToggleContainer, _v$9 = clsx(styles().logo, "tsqd-text-logo-container"), _v$10 = clsx(styles().tanstackLogo, "tsqd-text-logo-tanstack"), _v$11 = clsx(styles().queryFlavorLogo, "tsqd-text-logo-query-flavor"), _v$12 = clsx(styles().row, "tsqd-filters-actions-container"), _v$13 = clsx(styles().filtersContainer, "tsqd-filters-container"), _v$14 = clsx(styles().filterInput, "tsqd-query-filter-textfield-container"), _v$15 = clsx(styles().filterSelect, "tsqd-query-filter-sort-container"), _v$16 = `Sort order ${(selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1 ? "descending" : "ascending"}`, _v$17 = (selectedView() === "queries" ? sortOrder() : mutationSortOrder()) === -1, _v$18 = clsx(styles().actionsContainer, "tsqd-actions-container"), _v$19 = clsx(styles().actionsBtn, "tsqd-actions-btn", "tsqd-action-clear-cache"), _v$20 = `Clear ${selectedView()} cache`, _v$21 = clsx(styles().actionsBtn, offline() && styles().actionsBtnOffline, "tsqd-actions-btn", "tsqd-action-mock-offline-behavior"), _v$22 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`, _v$23 = offline(), _v$24 = `${offline() ? "Unset offline mocking behavior" : "Mock offline behavior"}`;
|
|
13761
13764
|
_v$6 !== _p$._v$6 && className(_el$8, _p$._v$6 = _v$6);
|
|
13762
13765
|
_v$7 !== _p$._v$7 && className(_el$9, _p$._v$7 = _v$7);
|
|
@@ -13829,16 +13832,16 @@ var init_Devtools = __esm({
|
|
|
13829
13832
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
13830
13833
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13831
13834
|
queryKey: props.query.queryKey
|
|
13832
|
-
})?.state);
|
|
13835
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13833
13836
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13834
13837
|
queryKey: props.query.queryKey
|
|
13835
|
-
})?.isDisabled() ?? false);
|
|
13838
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13836
13839
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13837
13840
|
queryKey: props.query.queryKey
|
|
13838
|
-
})?.isStale() ?? false);
|
|
13841
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13839
13842
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13840
13843
|
queryKey: props.query.queryKey
|
|
13841
|
-
})?.getObserversCount() ?? 0);
|
|
13844
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13842
13845
|
const color = createMemo(() => getQueryStatusColor({
|
|
13843
13846
|
queryState: queryState(),
|
|
13844
13847
|
observerCount: observers(),
|
|
@@ -14628,12 +14631,14 @@ var init_Devtools = __esm({
|
|
|
14628
14631
|
const client = useQueryDevtoolsContext().client;
|
|
14629
14632
|
return client.getQueryCache();
|
|
14630
14633
|
});
|
|
14631
|
-
const unsub = queryCache().subscribe(() => {
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14634
|
+
const unsub = queryCache().subscribe((q) => {
|
|
14635
|
+
batch(() => {
|
|
14636
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
14637
|
+
if (!value.shouldUpdate(q))
|
|
14638
|
+
continue;
|
|
14639
|
+
value.setter(callback(queryCache));
|
|
14640
|
+
}
|
|
14641
|
+
});
|
|
14637
14642
|
});
|
|
14638
14643
|
onCleanup(() => {
|
|
14639
14644
|
queryCacheMap.clear();
|
|
@@ -14641,7 +14646,7 @@ var init_Devtools = __esm({
|
|
|
14641
14646
|
});
|
|
14642
14647
|
return unsub;
|
|
14643
14648
|
};
|
|
14644
|
-
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
14649
|
+
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
14645
14650
|
const queryCache = createMemo(() => {
|
|
14646
14651
|
const client = useQueryDevtoolsContext().client;
|
|
14647
14652
|
return client.getQueryCache();
|
|
@@ -14652,7 +14657,10 @@ var init_Devtools = __esm({
|
|
|
14652
14657
|
createEffect(() => {
|
|
14653
14658
|
setValue(callback(queryCache));
|
|
14654
14659
|
});
|
|
14655
|
-
queryCacheMap.set(callback,
|
|
14660
|
+
queryCacheMap.set(callback, {
|
|
14661
|
+
setter: setValue,
|
|
14662
|
+
shouldUpdate
|
|
14663
|
+
});
|
|
14656
14664
|
onCleanup(() => {
|
|
14657
14665
|
queryCacheMap.delete(callback);
|
|
14658
14666
|
});
|
|
@@ -14768,6 +14776,22 @@ var init_Devtools = __esm({
|
|
|
14768
14776
|
box-sizing: border-box;
|
|
14769
14777
|
text-transform: none;
|
|
14770
14778
|
}
|
|
14779
|
+
|
|
14780
|
+
& *::-webkit-scrollbar {
|
|
14781
|
+
width: 7px;
|
|
14782
|
+
}
|
|
14783
|
+
|
|
14784
|
+
& *::-webkit-scrollbar-track {
|
|
14785
|
+
background: transparent;
|
|
14786
|
+
}
|
|
14787
|
+
|
|
14788
|
+
& *::-webkit-scrollbar-thumb {
|
|
14789
|
+
background: ${t2(colors.gray[300], colors.darkGray[200])};
|
|
14790
|
+
}
|
|
14791
|
+
|
|
14792
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
14793
|
+
background: ${t2(colors.gray[400], colors.darkGray[300])};
|
|
14794
|
+
}
|
|
14771
14795
|
`,
|
|
14772
14796
|
"devtoolsBtn-position-bottom-right": u`
|
|
14773
14797
|
bottom: 12px;
|
package/build/index.js
CHANGED
|
@@ -65,7 +65,7 @@ var TanstackQueryDevtools = class {
|
|
|
65
65
|
if (this.#Component) {
|
|
66
66
|
Devtools = this.#Component;
|
|
67
67
|
} else {
|
|
68
|
-
Devtools = lazy(() => import('./Devtools/
|
|
68
|
+
Devtools = lazy(() => import('./Devtools/N66J3ZXT.js'));
|
|
69
69
|
this.#Component = Devtools;
|
|
70
70
|
}
|
|
71
71
|
setupStyleSheet(this.#styleNonce);
|
package/build/index.jsx
CHANGED
|
@@ -70,7 +70,7 @@ var TanstackQueryDevtools = class {
|
|
|
70
70
|
if (this.#Component) {
|
|
71
71
|
Devtools = this.#Component;
|
|
72
72
|
} else {
|
|
73
|
-
Devtools = lazy(() => import("./Devtools/
|
|
73
|
+
Devtools = lazy(() => import("./Devtools/KEJBG6PF.jsx"));
|
|
74
74
|
this.#Component = Devtools;
|
|
75
75
|
}
|
|
76
76
|
setupStyleSheet(this.#styleNonce);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.5",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"superjson": "^1.12.4",
|
|
51
51
|
"tsup-preset-solid": "^2.1.0",
|
|
52
52
|
"vite-plugin-solid": "^2.7.2",
|
|
53
|
-
"@tanstack/query-core": "5.
|
|
53
|
+
"@tanstack/query-core": "5.13.4"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"clean": "rimraf ./build && rimraf ./coverage",
|
package/src/Devtools.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
For,
|
|
3
3
|
Show,
|
|
4
|
+
batch,
|
|
4
5
|
createEffect,
|
|
5
6
|
createMemo,
|
|
6
7
|
createSignal,
|
|
@@ -68,6 +69,7 @@ import type {
|
|
|
68
69
|
MutationCache,
|
|
69
70
|
Query,
|
|
70
71
|
QueryCache,
|
|
72
|
+
QueryCacheNotifyEvent,
|
|
71
73
|
QueryState,
|
|
72
74
|
} from '@tanstack/query-core'
|
|
73
75
|
import type { StorageObject, StorageSetter } from '@solid-primitives/storage'
|
|
@@ -599,6 +601,12 @@ const ContentView: Component<DevtoolsPanelProps> = (props) => {
|
|
|
599
601
|
height: 50%;
|
|
600
602
|
max-height: 50%;
|
|
601
603
|
`,
|
|
604
|
+
panelWidth() < secondBreakpoint &&
|
|
605
|
+
!(selectedQueryHash() || selectedMutationId()) &&
|
|
606
|
+
css`
|
|
607
|
+
height: 100%;
|
|
608
|
+
max-height: 100%;
|
|
609
|
+
`,
|
|
602
610
|
'tsqd-queries-container',
|
|
603
611
|
)}
|
|
604
612
|
ref={containerRef}
|
|
@@ -1053,6 +1061,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1053
1061
|
queryCache().find({
|
|
1054
1062
|
queryKey: props.query.queryKey,
|
|
1055
1063
|
})?.state,
|
|
1064
|
+
true,
|
|
1065
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1056
1066
|
)
|
|
1057
1067
|
|
|
1058
1068
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
@@ -1062,6 +1072,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1062
1072
|
queryKey: props.query.queryKey,
|
|
1063
1073
|
})
|
|
1064
1074
|
?.isDisabled() ?? false,
|
|
1075
|
+
true,
|
|
1076
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1065
1077
|
)
|
|
1066
1078
|
|
|
1067
1079
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
@@ -1071,6 +1083,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1071
1083
|
queryKey: props.query.queryKey,
|
|
1072
1084
|
})
|
|
1073
1085
|
?.isStale() ?? false,
|
|
1086
|
+
true,
|
|
1087
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1074
1088
|
)
|
|
1075
1089
|
|
|
1076
1090
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
@@ -1080,6 +1094,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1080
1094
|
queryKey: props.query.queryKey,
|
|
1081
1095
|
})
|
|
1082
1096
|
?.getObserversCount() ?? 0,
|
|
1097
|
+
true,
|
|
1098
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1083
1099
|
)
|
|
1084
1100
|
|
|
1085
1101
|
const color = createMemo(() =>
|
|
@@ -2035,7 +2051,13 @@ const MutationDetails = () => {
|
|
|
2035
2051
|
)
|
|
2036
2052
|
}
|
|
2037
2053
|
|
|
2038
|
-
const queryCacheMap = new Map<
|
|
2054
|
+
const queryCacheMap = new Map<
|
|
2055
|
+
(q: Accessor<QueryCache>) => any,
|
|
2056
|
+
{
|
|
2057
|
+
setter: Setter<any>
|
|
2058
|
+
shouldUpdate: (event: QueryCacheNotifyEvent) => boolean
|
|
2059
|
+
}
|
|
2060
|
+
>()
|
|
2039
2061
|
|
|
2040
2062
|
const setupQueryCacheSubscription = () => {
|
|
2041
2063
|
const queryCache = createMemo(() => {
|
|
@@ -2043,12 +2065,13 @@ const setupQueryCacheSubscription = () => {
|
|
|
2043
2065
|
return client.getQueryCache()
|
|
2044
2066
|
})
|
|
2045
2067
|
|
|
2046
|
-
const unsub = queryCache().subscribe(() => {
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2068
|
+
const unsub = queryCache().subscribe((q) => {
|
|
2069
|
+
batch(() => {
|
|
2070
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
2071
|
+
if (!value.shouldUpdate(q)) continue
|
|
2072
|
+
value.setter(callback(queryCache))
|
|
2073
|
+
}
|
|
2074
|
+
})
|
|
2052
2075
|
})
|
|
2053
2076
|
|
|
2054
2077
|
onCleanup(() => {
|
|
@@ -2062,6 +2085,7 @@ const setupQueryCacheSubscription = () => {
|
|
|
2062
2085
|
const createSubscribeToQueryCacheBatcher = <T,>(
|
|
2063
2086
|
callback: (queryCache: Accessor<QueryCache>) => Exclude<T, Function>,
|
|
2064
2087
|
equalityCheck: boolean = true,
|
|
2088
|
+
shouldUpdate: (event: QueryCacheNotifyEvent) => boolean = () => true,
|
|
2065
2089
|
) => {
|
|
2066
2090
|
const queryCache = createMemo(() => {
|
|
2067
2091
|
const client = useQueryDevtoolsContext().client
|
|
@@ -2077,8 +2101,10 @@ const createSubscribeToQueryCacheBatcher = <T,>(
|
|
|
2077
2101
|
setValue(callback(queryCache))
|
|
2078
2102
|
})
|
|
2079
2103
|
|
|
2080
|
-
|
|
2081
|
-
|
|
2104
|
+
queryCacheMap.set(callback, {
|
|
2105
|
+
setter: setValue,
|
|
2106
|
+
shouldUpdate: shouldUpdate,
|
|
2107
|
+
})
|
|
2082
2108
|
|
|
2083
2109
|
onCleanup(() => {
|
|
2084
2110
|
// @ts-ignore
|
|
@@ -2213,6 +2239,22 @@ const stylesFactory = (theme: 'light' | 'dark') => {
|
|
|
2213
2239
|
box-sizing: border-box;
|
|
2214
2240
|
text-transform: none;
|
|
2215
2241
|
}
|
|
2242
|
+
|
|
2243
|
+
& *::-webkit-scrollbar {
|
|
2244
|
+
width: 7px;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
& *::-webkit-scrollbar-track {
|
|
2248
|
+
background: transparent;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
& *::-webkit-scrollbar-thumb {
|
|
2252
|
+
background: ${t(colors.gray[300], colors.darkGray[200])};
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
2256
|
+
background: ${t(colors.gray[400], colors.darkGray[300])};
|
|
2257
|
+
}
|
|
2216
2258
|
`,
|
|
2217
2259
|
'devtoolsBtn-position-bottom-right': css`
|
|
2218
2260
|
bottom: 12px;
|