@tanstack/query-devtools 5.12.1 → 5.13.3
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/{OG2NFD3H.jsx → EN5OW4QY.jsx} +25 -12
- package/build/Devtools/{Y6OLANNQ.jsx → HI6IFUTD.jsx} +25 -12
- package/build/Devtools/{ANE6OXOK.js → VWYHBKXD.js} +17 -12
- package/build/Devtools/{E3UEEC63.js → XEIAQO4C.js} +17 -12
- package/build/dev.cjs +17 -12
- package/build/dev.js +1 -1
- package/build/dev.jsx +1 -1
- package/build/index.cjs +17 -12
- package/build/index.js +1 -1
- package/build/index.jsx +1 -1
- package/package.json +1 -1
- package/src/Devtools.tsx +29 -9
|
@@ -11152,22 +11152,30 @@ var QueryRow = (props) => {
|
|
|
11152
11152
|
const queryState = createSubscribeToQueryCacheBatcher(
|
|
11153
11153
|
(queryCache) => queryCache().find({
|
|
11154
11154
|
queryKey: props.query.queryKey
|
|
11155
|
-
})?.state
|
|
11155
|
+
})?.state,
|
|
11156
|
+
true,
|
|
11157
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11156
11158
|
);
|
|
11157
11159
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
11158
11160
|
(queryCache) => queryCache().find({
|
|
11159
11161
|
queryKey: props.query.queryKey
|
|
11160
|
-
})?.isDisabled() ?? false
|
|
11162
|
+
})?.isDisabled() ?? false,
|
|
11163
|
+
true,
|
|
11164
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11161
11165
|
);
|
|
11162
11166
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
11163
11167
|
(queryCache) => queryCache().find({
|
|
11164
11168
|
queryKey: props.query.queryKey
|
|
11165
|
-
})?.isStale() ?? false
|
|
11169
|
+
})?.isStale() ?? false,
|
|
11170
|
+
true,
|
|
11171
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11166
11172
|
);
|
|
11167
11173
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
11168
11174
|
(queryCache) => queryCache().find({
|
|
11169
11175
|
queryKey: props.query.queryKey
|
|
11170
|
-
})?.getObserversCount() ?? 0
|
|
11176
|
+
})?.getObserversCount() ?? 0,
|
|
11177
|
+
true,
|
|
11178
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11171
11179
|
);
|
|
11172
11180
|
const color = createMemo(
|
|
11173
11181
|
() => getQueryStatusColor({
|
|
@@ -11911,12 +11919,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11911
11919
|
const client = useQueryDevtoolsContext().client;
|
|
11912
11920
|
return client.getQueryCache();
|
|
11913
11921
|
});
|
|
11914
|
-
const unsub = queryCache().subscribe(() => {
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11922
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11923
|
+
batch(() => {
|
|
11924
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11925
|
+
if (!value.shouldUpdate(q))
|
|
11926
|
+
continue;
|
|
11927
|
+
value.setter(callback(queryCache));
|
|
11928
|
+
}
|
|
11929
|
+
});
|
|
11920
11930
|
});
|
|
11921
11931
|
onCleanup(() => {
|
|
11922
11932
|
queryCacheMap.clear();
|
|
@@ -11924,7 +11934,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11924
11934
|
});
|
|
11925
11935
|
return unsub;
|
|
11926
11936
|
};
|
|
11927
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11937
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11928
11938
|
const queryCache = createMemo(() => {
|
|
11929
11939
|
const client = useQueryDevtoolsContext().client;
|
|
11930
11940
|
return client.getQueryCache();
|
|
@@ -11936,7 +11946,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11936
11946
|
createEffect(() => {
|
|
11937
11947
|
setValue(callback(queryCache));
|
|
11938
11948
|
});
|
|
11939
|
-
queryCacheMap.set(callback,
|
|
11949
|
+
queryCacheMap.set(callback, {
|
|
11950
|
+
setter: setValue,
|
|
11951
|
+
shouldUpdate
|
|
11952
|
+
});
|
|
11940
11953
|
onCleanup(() => {
|
|
11941
11954
|
queryCacheMap.delete(callback);
|
|
11942
11955
|
});
|
|
@@ -11151,22 +11151,30 @@ var QueryRow = (props) => {
|
|
|
11151
11151
|
const queryState = createSubscribeToQueryCacheBatcher(
|
|
11152
11152
|
(queryCache) => queryCache().find({
|
|
11153
11153
|
queryKey: props.query.queryKey
|
|
11154
|
-
})?.state
|
|
11154
|
+
})?.state,
|
|
11155
|
+
true,
|
|
11156
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11155
11157
|
);
|
|
11156
11158
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
11157
11159
|
(queryCache) => queryCache().find({
|
|
11158
11160
|
queryKey: props.query.queryKey
|
|
11159
|
-
})?.isDisabled() ?? false
|
|
11161
|
+
})?.isDisabled() ?? false,
|
|
11162
|
+
true,
|
|
11163
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11160
11164
|
);
|
|
11161
11165
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
11162
11166
|
(queryCache) => queryCache().find({
|
|
11163
11167
|
queryKey: props.query.queryKey
|
|
11164
|
-
})?.isStale() ?? false
|
|
11168
|
+
})?.isStale() ?? false,
|
|
11169
|
+
true,
|
|
11170
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11165
11171
|
);
|
|
11166
11172
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
11167
11173
|
(queryCache) => queryCache().find({
|
|
11168
11174
|
queryKey: props.query.queryKey
|
|
11169
|
-
})?.getObserversCount() ?? 0
|
|
11175
|
+
})?.getObserversCount() ?? 0,
|
|
11176
|
+
true,
|
|
11177
|
+
(e2) => e2.query.queryHash === props.query.queryHash
|
|
11170
11178
|
);
|
|
11171
11179
|
const color = createMemo(
|
|
11172
11180
|
() => getQueryStatusColor({
|
|
@@ -11910,12 +11918,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11910
11918
|
const client = useQueryDevtoolsContext().client;
|
|
11911
11919
|
return client.getQueryCache();
|
|
11912
11920
|
});
|
|
11913
|
-
const unsub = queryCache().subscribe(() => {
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11921
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11922
|
+
batch(() => {
|
|
11923
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11924
|
+
if (!value.shouldUpdate(q))
|
|
11925
|
+
continue;
|
|
11926
|
+
value.setter(callback(queryCache));
|
|
11927
|
+
}
|
|
11928
|
+
});
|
|
11919
11929
|
});
|
|
11920
11930
|
onCleanup(() => {
|
|
11921
11931
|
queryCacheMap.clear();
|
|
@@ -11923,7 +11933,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11923
11933
|
});
|
|
11924
11934
|
return unsub;
|
|
11925
11935
|
};
|
|
11926
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11936
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11927
11937
|
const queryCache = createMemo(() => {
|
|
11928
11938
|
const client = useQueryDevtoolsContext().client;
|
|
11929
11939
|
return client.getQueryCache();
|
|
@@ -11935,7 +11945,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11935
11945
|
createEffect(() => {
|
|
11936
11946
|
setValue(callback(queryCache));
|
|
11937
11947
|
});
|
|
11938
|
-
queryCacheMap.set(callback,
|
|
11948
|
+
queryCacheMap.set(callback, {
|
|
11949
|
+
setter: setValue,
|
|
11950
|
+
shouldUpdate
|
|
11951
|
+
});
|
|
11939
11952
|
onCleanup(() => {
|
|
11940
11953
|
queryCacheMap.delete(callback);
|
|
11941
11954
|
});
|
|
@@ -10308,16 +10308,16 @@ var QueryRow = (props) => {
|
|
|
10308
10308
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
10309
10309
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10310
10310
|
queryKey: props.query.queryKey
|
|
10311
|
-
})?.state);
|
|
10311
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10312
10312
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10313
10313
|
queryKey: props.query.queryKey
|
|
10314
|
-
})?.isDisabled() ?? false);
|
|
10314
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10315
10315
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10316
10316
|
queryKey: props.query.queryKey
|
|
10317
|
-
})?.isStale() ?? false);
|
|
10317
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10318
10318
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10319
10319
|
queryKey: props.query.queryKey
|
|
10320
|
-
})?.getObserversCount() ?? 0);
|
|
10320
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10321
10321
|
const color = createMemo(() => getQueryStatusColor({
|
|
10322
10322
|
queryState: queryState(),
|
|
10323
10323
|
observerCount: observers(),
|
|
@@ -11107,12 +11107,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11107
11107
|
const client = useQueryDevtoolsContext().client;
|
|
11108
11108
|
return client.getQueryCache();
|
|
11109
11109
|
});
|
|
11110
|
-
const unsub = queryCache().subscribe(() => {
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11110
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11111
|
+
batch(() => {
|
|
11112
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11113
|
+
if (!value.shouldUpdate(q))
|
|
11114
|
+
continue;
|
|
11115
|
+
value.setter(callback(queryCache));
|
|
11116
|
+
}
|
|
11117
|
+
});
|
|
11116
11118
|
});
|
|
11117
11119
|
onCleanup(() => {
|
|
11118
11120
|
queryCacheMap.clear();
|
|
@@ -11120,7 +11122,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11120
11122
|
});
|
|
11121
11123
|
return unsub;
|
|
11122
11124
|
};
|
|
11123
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11125
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11124
11126
|
const queryCache = createMemo(() => {
|
|
11125
11127
|
const client = useQueryDevtoolsContext().client;
|
|
11126
11128
|
return client.getQueryCache();
|
|
@@ -11131,7 +11133,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11131
11133
|
createEffect(() => {
|
|
11132
11134
|
setValue(callback(queryCache));
|
|
11133
11135
|
});
|
|
11134
|
-
queryCacheMap.set(callback,
|
|
11136
|
+
queryCacheMap.set(callback, {
|
|
11137
|
+
setter: setValue,
|
|
11138
|
+
shouldUpdate
|
|
11139
|
+
});
|
|
11135
11140
|
onCleanup(() => {
|
|
11136
11141
|
queryCacheMap.delete(callback);
|
|
11137
11142
|
});
|
|
@@ -10307,16 +10307,16 @@ var QueryRow = (props) => {
|
|
|
10307
10307
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
10308
10308
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10309
10309
|
queryKey: props.query.queryKey
|
|
10310
|
-
})?.state);
|
|
10310
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10311
10311
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10312
10312
|
queryKey: props.query.queryKey
|
|
10313
|
-
})?.isDisabled() ?? false);
|
|
10313
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10314
10314
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10315
10315
|
queryKey: props.query.queryKey
|
|
10316
|
-
})?.isStale() ?? false);
|
|
10316
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10317
10317
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
10318
10318
|
queryKey: props.query.queryKey
|
|
10319
|
-
})?.getObserversCount() ?? 0);
|
|
10319
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
10320
10320
|
const color = createMemo(() => getQueryStatusColor({
|
|
10321
10321
|
queryState: queryState(),
|
|
10322
10322
|
observerCount: observers(),
|
|
@@ -11106,12 +11106,14 @@ var setupQueryCacheSubscription = () => {
|
|
|
11106
11106
|
const client = useQueryDevtoolsContext().client;
|
|
11107
11107
|
return client.getQueryCache();
|
|
11108
11108
|
});
|
|
11109
|
-
const unsub = queryCache().subscribe(() => {
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11109
|
+
const unsub = queryCache().subscribe((q) => {
|
|
11110
|
+
batch(() => {
|
|
11111
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
11112
|
+
if (!value.shouldUpdate(q))
|
|
11113
|
+
continue;
|
|
11114
|
+
value.setter(callback(queryCache));
|
|
11115
|
+
}
|
|
11116
|
+
});
|
|
11115
11117
|
});
|
|
11116
11118
|
onCleanup(() => {
|
|
11117
11119
|
queryCacheMap.clear();
|
|
@@ -11119,7 +11121,7 @@ var setupQueryCacheSubscription = () => {
|
|
|
11119
11121
|
});
|
|
11120
11122
|
return unsub;
|
|
11121
11123
|
};
|
|
11122
|
-
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
11124
|
+
var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
11123
11125
|
const queryCache = createMemo(() => {
|
|
11124
11126
|
const client = useQueryDevtoolsContext().client;
|
|
11125
11127
|
return client.getQueryCache();
|
|
@@ -11130,7 +11132,10 @@ var createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
|
11130
11132
|
createEffect(() => {
|
|
11131
11133
|
setValue(callback(queryCache));
|
|
11132
11134
|
});
|
|
11133
|
-
queryCacheMap.set(callback,
|
|
11135
|
+
queryCacheMap.set(callback, {
|
|
11136
|
+
setter: setValue,
|
|
11137
|
+
shouldUpdate
|
|
11138
|
+
});
|
|
11134
11139
|
onCleanup(() => {
|
|
11135
11140
|
queryCacheMap.delete(callback);
|
|
11136
11141
|
});
|
package/build/dev.cjs
CHANGED
|
@@ -13831,16 +13831,16 @@ var init_Devtools = __esm({
|
|
|
13831
13831
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
13832
13832
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13833
13833
|
queryKey: props.query.queryKey
|
|
13834
|
-
})?.state);
|
|
13834
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13835
13835
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13836
13836
|
queryKey: props.query.queryKey
|
|
13837
|
-
})?.isDisabled() ?? false);
|
|
13837
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13838
13838
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13839
13839
|
queryKey: props.query.queryKey
|
|
13840
|
-
})?.isStale() ?? false);
|
|
13840
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13841
13841
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13842
13842
|
queryKey: props.query.queryKey
|
|
13843
|
-
})?.getObserversCount() ?? 0);
|
|
13843
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13844
13844
|
const color = createMemo(() => getQueryStatusColor({
|
|
13845
13845
|
queryState: queryState(),
|
|
13846
13846
|
observerCount: observers(),
|
|
@@ -14630,12 +14630,14 @@ var init_Devtools = __esm({
|
|
|
14630
14630
|
const client = useQueryDevtoolsContext().client;
|
|
14631
14631
|
return client.getQueryCache();
|
|
14632
14632
|
});
|
|
14633
|
-
const unsub = queryCache().subscribe(() => {
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
|
|
14633
|
+
const unsub = queryCache().subscribe((q) => {
|
|
14634
|
+
batch(() => {
|
|
14635
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
14636
|
+
if (!value.shouldUpdate(q))
|
|
14637
|
+
continue;
|
|
14638
|
+
value.setter(callback(queryCache));
|
|
14639
|
+
}
|
|
14640
|
+
});
|
|
14639
14641
|
});
|
|
14640
14642
|
onCleanup(() => {
|
|
14641
14643
|
queryCacheMap.clear();
|
|
@@ -14643,7 +14645,7 @@ var init_Devtools = __esm({
|
|
|
14643
14645
|
});
|
|
14644
14646
|
return unsub;
|
|
14645
14647
|
};
|
|
14646
|
-
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
14648
|
+
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
14647
14649
|
const queryCache = createMemo(() => {
|
|
14648
14650
|
const client = useQueryDevtoolsContext().client;
|
|
14649
14651
|
return client.getQueryCache();
|
|
@@ -14654,7 +14656,10 @@ var init_Devtools = __esm({
|
|
|
14654
14656
|
createEffect(() => {
|
|
14655
14657
|
setValue(callback(queryCache));
|
|
14656
14658
|
});
|
|
14657
|
-
queryCacheMap.set(callback,
|
|
14659
|
+
queryCacheMap.set(callback, {
|
|
14660
|
+
setter: setValue,
|
|
14661
|
+
shouldUpdate
|
|
14662
|
+
});
|
|
14658
14663
|
onCleanup(() => {
|
|
14659
14664
|
queryCacheMap.delete(callback);
|
|
14660
14665
|
});
|
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/VWYHBKXD.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/EN5OW4QY.jsx"));
|
|
74
74
|
this.#Component = Devtools;
|
|
75
75
|
}
|
|
76
76
|
setupStyleSheet(this.#styleNonce);
|
package/build/index.cjs
CHANGED
|
@@ -13829,16 +13829,16 @@ var init_Devtools = __esm({
|
|
|
13829
13829
|
const t2 = (light, dark) => theme() === "dark" ? dark : light;
|
|
13830
13830
|
const queryState = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13831
13831
|
queryKey: props.query.queryKey
|
|
13832
|
-
})?.state);
|
|
13832
|
+
})?.state, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13833
13833
|
const isDisabled = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13834
13834
|
queryKey: props.query.queryKey
|
|
13835
|
-
})?.isDisabled() ?? false);
|
|
13835
|
+
})?.isDisabled() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13836
13836
|
const isStale = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13837
13837
|
queryKey: props.query.queryKey
|
|
13838
|
-
})?.isStale() ?? false);
|
|
13838
|
+
})?.isStale() ?? false, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13839
13839
|
const observers = createSubscribeToQueryCacheBatcher((queryCache) => queryCache().find({
|
|
13840
13840
|
queryKey: props.query.queryKey
|
|
13841
|
-
})?.getObserversCount() ?? 0);
|
|
13841
|
+
})?.getObserversCount() ?? 0, true, (e2) => e2.query.queryHash === props.query.queryHash);
|
|
13842
13842
|
const color = createMemo(() => getQueryStatusColor({
|
|
13843
13843
|
queryState: queryState(),
|
|
13844
13844
|
observerCount: observers(),
|
|
@@ -14628,12 +14628,14 @@ var init_Devtools = __esm({
|
|
|
14628
14628
|
const client = useQueryDevtoolsContext().client;
|
|
14629
14629
|
return client.getQueryCache();
|
|
14630
14630
|
});
|
|
14631
|
-
const unsub = queryCache().subscribe(() => {
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14631
|
+
const unsub = queryCache().subscribe((q) => {
|
|
14632
|
+
batch(() => {
|
|
14633
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
14634
|
+
if (!value.shouldUpdate(q))
|
|
14635
|
+
continue;
|
|
14636
|
+
value.setter(callback(queryCache));
|
|
14637
|
+
}
|
|
14638
|
+
});
|
|
14637
14639
|
});
|
|
14638
14640
|
onCleanup(() => {
|
|
14639
14641
|
queryCacheMap.clear();
|
|
@@ -14641,7 +14643,7 @@ var init_Devtools = __esm({
|
|
|
14641
14643
|
});
|
|
14642
14644
|
return unsub;
|
|
14643
14645
|
};
|
|
14644
|
-
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true) => {
|
|
14646
|
+
createSubscribeToQueryCacheBatcher = (callback, equalityCheck = true, shouldUpdate = () => true) => {
|
|
14645
14647
|
const queryCache = createMemo(() => {
|
|
14646
14648
|
const client = useQueryDevtoolsContext().client;
|
|
14647
14649
|
return client.getQueryCache();
|
|
@@ -14652,7 +14654,10 @@ var init_Devtools = __esm({
|
|
|
14652
14654
|
createEffect(() => {
|
|
14653
14655
|
setValue(callback(queryCache));
|
|
14654
14656
|
});
|
|
14655
|
-
queryCacheMap.set(callback,
|
|
14657
|
+
queryCacheMap.set(callback, {
|
|
14658
|
+
setter: setValue,
|
|
14659
|
+
shouldUpdate
|
|
14660
|
+
});
|
|
14656
14661
|
onCleanup(() => {
|
|
14657
14662
|
queryCacheMap.delete(callback);
|
|
14658
14663
|
});
|
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/XEIAQO4C.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/HI6IFUTD.jsx"));
|
|
74
74
|
this.#Component = Devtools;
|
|
75
75
|
}
|
|
76
76
|
setupStyleSheet(this.#styleNonce);
|
package/package.json
CHANGED
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'
|
|
@@ -1053,6 +1055,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1053
1055
|
queryCache().find({
|
|
1054
1056
|
queryKey: props.query.queryKey,
|
|
1055
1057
|
})?.state,
|
|
1058
|
+
true,
|
|
1059
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1056
1060
|
)
|
|
1057
1061
|
|
|
1058
1062
|
const isDisabled = createSubscribeToQueryCacheBatcher(
|
|
@@ -1062,6 +1066,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1062
1066
|
queryKey: props.query.queryKey,
|
|
1063
1067
|
})
|
|
1064
1068
|
?.isDisabled() ?? false,
|
|
1069
|
+
true,
|
|
1070
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1065
1071
|
)
|
|
1066
1072
|
|
|
1067
1073
|
const isStale = createSubscribeToQueryCacheBatcher(
|
|
@@ -1071,6 +1077,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1071
1077
|
queryKey: props.query.queryKey,
|
|
1072
1078
|
})
|
|
1073
1079
|
?.isStale() ?? false,
|
|
1080
|
+
true,
|
|
1081
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1074
1082
|
)
|
|
1075
1083
|
|
|
1076
1084
|
const observers = createSubscribeToQueryCacheBatcher(
|
|
@@ -1080,6 +1088,8 @@ const QueryRow: Component<{ query: Query }> = (props) => {
|
|
|
1080
1088
|
queryKey: props.query.queryKey,
|
|
1081
1089
|
})
|
|
1082
1090
|
?.getObserversCount() ?? 0,
|
|
1091
|
+
true,
|
|
1092
|
+
(e) => e.query.queryHash === props.query.queryHash,
|
|
1083
1093
|
)
|
|
1084
1094
|
|
|
1085
1095
|
const color = createMemo(() =>
|
|
@@ -2035,7 +2045,13 @@ const MutationDetails = () => {
|
|
|
2035
2045
|
)
|
|
2036
2046
|
}
|
|
2037
2047
|
|
|
2038
|
-
const queryCacheMap = new Map<
|
|
2048
|
+
const queryCacheMap = new Map<
|
|
2049
|
+
(q: Accessor<QueryCache>) => any,
|
|
2050
|
+
{
|
|
2051
|
+
setter: Setter<any>
|
|
2052
|
+
shouldUpdate: (event: QueryCacheNotifyEvent) => boolean
|
|
2053
|
+
}
|
|
2054
|
+
>()
|
|
2039
2055
|
|
|
2040
2056
|
const setupQueryCacheSubscription = () => {
|
|
2041
2057
|
const queryCache = createMemo(() => {
|
|
@@ -2043,12 +2059,13 @@ const setupQueryCacheSubscription = () => {
|
|
|
2043
2059
|
return client.getQueryCache()
|
|
2044
2060
|
})
|
|
2045
2061
|
|
|
2046
|
-
const unsub = queryCache().subscribe(() => {
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2062
|
+
const unsub = queryCache().subscribe((q) => {
|
|
2063
|
+
batch(() => {
|
|
2064
|
+
for (const [callback, value] of queryCacheMap.entries()) {
|
|
2065
|
+
if (!value.shouldUpdate(q)) continue
|
|
2066
|
+
value.setter(callback(queryCache))
|
|
2067
|
+
}
|
|
2068
|
+
})
|
|
2052
2069
|
})
|
|
2053
2070
|
|
|
2054
2071
|
onCleanup(() => {
|
|
@@ -2062,6 +2079,7 @@ const setupQueryCacheSubscription = () => {
|
|
|
2062
2079
|
const createSubscribeToQueryCacheBatcher = <T,>(
|
|
2063
2080
|
callback: (queryCache: Accessor<QueryCache>) => Exclude<T, Function>,
|
|
2064
2081
|
equalityCheck: boolean = true,
|
|
2082
|
+
shouldUpdate: (event: QueryCacheNotifyEvent) => boolean = () => true,
|
|
2065
2083
|
) => {
|
|
2066
2084
|
const queryCache = createMemo(() => {
|
|
2067
2085
|
const client = useQueryDevtoolsContext().client
|
|
@@ -2077,8 +2095,10 @@ const createSubscribeToQueryCacheBatcher = <T,>(
|
|
|
2077
2095
|
setValue(callback(queryCache))
|
|
2078
2096
|
})
|
|
2079
2097
|
|
|
2080
|
-
|
|
2081
|
-
|
|
2098
|
+
queryCacheMap.set(callback, {
|
|
2099
|
+
setter: setValue,
|
|
2100
|
+
shouldUpdate: shouldUpdate,
|
|
2101
|
+
})
|
|
2082
2102
|
|
|
2083
2103
|
onCleanup(() => {
|
|
2084
2104
|
// @ts-ignore
|