@tanstack/solid-query-devtools 6.0.0-beta.4 → 6.0.0-beta.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/_tsup-dts-rollup.d.cts +5 -15
- package/build/_tsup-dts-rollup.d.ts +5 -15
- package/build/chunk/{RNXRSYV2.js → 5YUDKRGO.js} +10 -5
- package/build/chunk/{OUUOFKOT.js → OIFXIFGE.js} +10 -5
- package/build/dev.cjs +51 -46
- package/build/dev.js +3 -3
- package/build/dev.jsx +7 -7
- package/build/devtools/{R2AGYIME.jsx → 7WZM3IT7.jsx} +15 -13
- package/build/devtools/{BN3QOQGH.js → FNDI35UR.js} +20 -20
- package/build/devtools/{DAAYGNEN.js → T3N3FX25.js} +20 -20
- package/build/devtoolsPanel/{SQHQ34QQ.js → 5CAQ2WGQ.js} +24 -24
- package/build/devtoolsPanel/{FI3ZIJCV.js → DXOBITS6.js} +24 -24
- package/build/devtoolsPanel/{QZBU22C7.jsx → FQC5JHFZ.jsx} +15 -13
- package/build/index.cjs +53 -48
- package/build/index.js +3 -3
- package/build/index.jsx +7 -7
- package/package.json +7 -7
- package/src/clientOnly.tsx +2 -1
- package/src/devtools.tsx +21 -17
- package/src/devtoolsPanel.tsx +20 -16
|
@@ -3,11 +3,9 @@ import type { ComponentProps } from 'solid-js';
|
|
|
3
3
|
import type { DevtoolsButtonPosition } from '@tanstack/query-devtools';
|
|
4
4
|
import type { DevtoolsErrorType } from '@tanstack/query-devtools';
|
|
5
5
|
import type { DevtoolsPosition } from '@tanstack/query-devtools';
|
|
6
|
-
import { JSX } from '
|
|
7
|
-
import { Options } from 'tsup';
|
|
6
|
+
import { JSX } from '@solidjs/web';
|
|
8
7
|
import type { QueryClient } from '@tanstack/solid-query';
|
|
9
8
|
import type { Theme } from '@tanstack/query-devtools';
|
|
10
|
-
import { UserConfig } from 'vite';
|
|
11
9
|
|
|
12
10
|
export declare function default_alias<T extends Component<any>>(fn: () => Promise<{
|
|
13
11
|
default: T;
|
|
@@ -19,27 +17,19 @@ export declare function default_alias_1(props: DevtoolsOptions): JSX;
|
|
|
19
17
|
|
|
20
18
|
export declare function default_alias_2(props: DevtoolsPanelOptions): JSX.Element;
|
|
21
19
|
|
|
22
|
-
export declare const default_alias_3: any[];
|
|
23
|
-
|
|
24
|
-
export declare const default_alias_4: any[];
|
|
25
|
-
|
|
26
|
-
export declare const default_alias_5: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
27
|
-
|
|
28
|
-
export declare const default_alias_6: UserConfig;
|
|
29
|
-
|
|
30
20
|
declare interface DevtoolsOptions {
|
|
31
21
|
/**
|
|
32
22
|
* Set this true if you want the dev tools to default to being open
|
|
33
23
|
*/
|
|
34
24
|
initialIsOpen?: boolean;
|
|
35
25
|
/**
|
|
36
|
-
* The position of the
|
|
37
|
-
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
26
|
+
* The position of the TanStack logo to open and close the devtools panel.
|
|
27
|
+
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
38
28
|
* Defaults to 'bottom-right'.
|
|
39
29
|
*/
|
|
40
30
|
buttonPosition?: DevtoolsButtonPosition;
|
|
41
31
|
/**
|
|
42
|
-
* The position of the
|
|
32
|
+
* The position of the Solid Query devtools panel.
|
|
43
33
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
44
34
|
* Defaults to 'bottom'.
|
|
45
35
|
*/
|
|
@@ -98,7 +88,7 @@ declare interface DevtoolsPanelOptions {
|
|
|
98
88
|
/**
|
|
99
89
|
* Callback function that is called when the devtools panel is closed
|
|
100
90
|
*/
|
|
101
|
-
onClose?: () =>
|
|
91
|
+
onClose?: () => void;
|
|
102
92
|
/**
|
|
103
93
|
* Set this to true to hide disabled queries from the devtools panel.
|
|
104
94
|
*/
|
|
@@ -3,11 +3,9 @@ import type { ComponentProps } from 'solid-js';
|
|
|
3
3
|
import type { DevtoolsButtonPosition } from '@tanstack/query-devtools';
|
|
4
4
|
import type { DevtoolsErrorType } from '@tanstack/query-devtools';
|
|
5
5
|
import type { DevtoolsPosition } from '@tanstack/query-devtools';
|
|
6
|
-
import { JSX } from '
|
|
7
|
-
import { Options } from 'tsup';
|
|
6
|
+
import { JSX } from '@solidjs/web';
|
|
8
7
|
import type { QueryClient } from '@tanstack/solid-query';
|
|
9
8
|
import type { Theme } from '@tanstack/query-devtools';
|
|
10
|
-
import { UserConfig } from 'vite';
|
|
11
9
|
|
|
12
10
|
export declare function default_alias<T extends Component<any>>(fn: () => Promise<{
|
|
13
11
|
default: T;
|
|
@@ -19,27 +17,19 @@ export declare function default_alias_1(props: DevtoolsOptions): JSX;
|
|
|
19
17
|
|
|
20
18
|
export declare function default_alias_2(props: DevtoolsPanelOptions): JSX.Element;
|
|
21
19
|
|
|
22
|
-
export declare const default_alias_3: any[];
|
|
23
|
-
|
|
24
|
-
export declare const default_alias_4: any[];
|
|
25
|
-
|
|
26
|
-
export declare const default_alias_5: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
|
27
|
-
|
|
28
|
-
export declare const default_alias_6: UserConfig;
|
|
29
|
-
|
|
30
20
|
declare interface DevtoolsOptions {
|
|
31
21
|
/**
|
|
32
22
|
* Set this true if you want the dev tools to default to being open
|
|
33
23
|
*/
|
|
34
24
|
initialIsOpen?: boolean;
|
|
35
25
|
/**
|
|
36
|
-
* The position of the
|
|
37
|
-
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
26
|
+
* The position of the TanStack logo to open and close the devtools panel.
|
|
27
|
+
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
38
28
|
* Defaults to 'bottom-right'.
|
|
39
29
|
*/
|
|
40
30
|
buttonPosition?: DevtoolsButtonPosition;
|
|
41
31
|
/**
|
|
42
|
-
* The position of the
|
|
32
|
+
* The position of the Solid Query devtools panel.
|
|
43
33
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
44
34
|
* Defaults to 'bottom'.
|
|
45
35
|
*/
|
|
@@ -98,7 +88,7 @@ declare interface DevtoolsPanelOptions {
|
|
|
98
88
|
/**
|
|
99
89
|
* Callback function that is called when the devtools panel is closed
|
|
100
90
|
*/
|
|
101
|
-
onClose?: () =>
|
|
91
|
+
onClose?: () => void;
|
|
102
92
|
/**
|
|
103
93
|
* Set this to true to hide disabled queries from the devtools panel.
|
|
104
94
|
*/
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { createRenderEffect, untrack, runWithOwner, sharedConfig } from 'solid-js';
|
|
2
2
|
|
|
3
|
-
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
4
|
-
var
|
|
5
|
-
transparent: true
|
|
6
|
-
|
|
3
|
+
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/web.js
|
|
4
|
+
var transparentOptions = {
|
|
5
|
+
transparent: true,
|
|
6
|
+
sync: true
|
|
7
|
+
};
|
|
8
|
+
var effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
|
|
9
|
+
transparent: true,
|
|
10
|
+
sync: true,
|
|
11
|
+
...options
|
|
12
|
+
} : transparentOptions);
|
|
7
13
|
function create(html, bypassGuard, flag) {
|
|
8
14
|
const t = document.createElement("template");
|
|
9
15
|
t.innerHTML = html;
|
|
@@ -27,7 +33,6 @@ function style(node, value, prev) {
|
|
|
27
33
|
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
28
34
|
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
29
35
|
prev || (prev = {});
|
|
30
|
-
value || (value = {});
|
|
31
36
|
let v, s;
|
|
32
37
|
for (s in value) {
|
|
33
38
|
v = value[s];
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { createRenderEffect, untrack, runWithOwner, sharedConfig } from 'solid-js';
|
|
2
2
|
|
|
3
|
-
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
4
|
-
var
|
|
5
|
-
transparent: true
|
|
6
|
-
|
|
3
|
+
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/dev.js
|
|
4
|
+
var transparentOptions = {
|
|
5
|
+
transparent: true,
|
|
6
|
+
sync: true
|
|
7
|
+
};
|
|
8
|
+
var effect = (fn, effectFn, options) => createRenderEffect(fn, effectFn, options ? {
|
|
9
|
+
transparent: true,
|
|
10
|
+
sync: true,
|
|
11
|
+
...options
|
|
12
|
+
} : transparentOptions);
|
|
7
13
|
function create(html, bypassGuard, flag) {
|
|
8
14
|
if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
9
15
|
const t = document.createElement("template");
|
|
@@ -29,7 +35,6 @@ function style(node, value, prev) {
|
|
|
29
35
|
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
30
36
|
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
31
37
|
prev || (prev = {});
|
|
32
|
-
value || (value = {});
|
|
33
38
|
let v, s;
|
|
34
39
|
for (s in value) {
|
|
35
40
|
v = value[s];
|
package/build/dev.cjs
CHANGED
|
@@ -38,7 +38,6 @@ function style(node, value, prev) {
|
|
|
38
38
|
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
39
39
|
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
40
40
|
prev || (prev = {});
|
|
41
|
-
value || (value = {});
|
|
42
41
|
let v, s;
|
|
43
42
|
for (s in value) {
|
|
44
43
|
v = value[s];
|
|
@@ -57,12 +56,18 @@ function ref(fn, element) {
|
|
|
57
56
|
function isHydrating(node) {
|
|
58
57
|
return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
|
|
59
58
|
}
|
|
60
|
-
var effect, isServer, isDev;
|
|
59
|
+
var transparentOptions, effect, isServer, isDev;
|
|
61
60
|
var init_dev = __esm({
|
|
62
|
-
"../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
63
|
-
|
|
64
|
-
transparent: true
|
|
65
|
-
|
|
61
|
+
"../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/dev.js"() {
|
|
62
|
+
transparentOptions = {
|
|
63
|
+
transparent: true,
|
|
64
|
+
sync: true
|
|
65
|
+
};
|
|
66
|
+
effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
67
|
+
transparent: true,
|
|
68
|
+
sync: true,
|
|
69
|
+
...options
|
|
70
|
+
} : transparentOptions);
|
|
66
71
|
isServer = false;
|
|
67
72
|
isDev = true;
|
|
68
73
|
}
|
|
@@ -113,25 +118,25 @@ function SolidQueryDevtools(props) {
|
|
|
113
118
|
solidJs.createEffect(() => props.theme, (theme) => {
|
|
114
119
|
devtools.setTheme(theme || "system");
|
|
115
120
|
});
|
|
116
|
-
let
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
let mounted = false;
|
|
122
|
+
let disposed = false;
|
|
123
|
+
solidJs.onSettled(() => {
|
|
124
|
+
queueMicrotask(() => {
|
|
125
|
+
if (disposed) return;
|
|
126
|
+
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
127
|
+
mounted = true;
|
|
128
|
+
});
|
|
129
|
+
return () => {
|
|
130
|
+
disposed = true;
|
|
131
|
+
if (mounted) {
|
|
132
|
+
devtools.unmount();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
128
135
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
return _el$;
|
|
134
|
-
})();
|
|
136
|
+
var _el$ = _tmpl$();
|
|
137
|
+
var _ref$ = ref2;
|
|
138
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
139
|
+
return _el$;
|
|
135
140
|
}
|
|
136
141
|
var _tmpl$;
|
|
137
142
|
var init_devtools = __esm({
|
|
@@ -185,30 +190,30 @@ function SolidQueryDevtoolsPanel(props) {
|
|
|
185
190
|
solidJs.createEffect(() => props.theme, (theme) => {
|
|
186
191
|
devtools.setTheme(theme || "system");
|
|
187
192
|
});
|
|
188
|
-
let
|
|
189
|
-
let
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
let mounted = false;
|
|
194
|
+
let disposed = false;
|
|
195
|
+
solidJs.onSettled(() => {
|
|
196
|
+
queueMicrotask(() => {
|
|
197
|
+
if (disposed) return;
|
|
198
|
+
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
199
|
+
mounted = true;
|
|
200
|
+
});
|
|
201
|
+
return () => {
|
|
202
|
+
disposed = true;
|
|
203
|
+
if (mounted) {
|
|
204
|
+
devtools.unmount();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
194
207
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
208
|
+
var _el$ = _tmpl$2();
|
|
209
|
+
var _ref$ = ref2;
|
|
210
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
211
|
+
effect(() => ({
|
|
212
|
+
...props.style
|
|
213
|
+
}), (_v$, _$p) => {
|
|
214
|
+
style(_el$, _v$, _$p);
|
|
200
215
|
});
|
|
201
|
-
return
|
|
202
|
-
var _el$ = _tmpl$2();
|
|
203
|
-
var _ref$ = ref2;
|
|
204
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
205
|
-
effect(() => ({
|
|
206
|
-
...props.style
|
|
207
|
-
}), (_v$, _$p) => {
|
|
208
|
-
style(_el$, _v$, _$p);
|
|
209
|
-
});
|
|
210
|
-
return _el$;
|
|
211
|
-
})();
|
|
216
|
+
return _el$;
|
|
212
217
|
}
|
|
213
218
|
var _tmpl$2;
|
|
214
219
|
var init_devtoolsPanel = __esm({
|
package/build/dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDev, isServer } from './chunk/
|
|
1
|
+
import { isDev, isServer } from './chunk/OIFXIFGE.js';
|
|
2
2
|
import { createSignal, omit, sharedConfig, onSettled, createMemo, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
function clientOnly(fn) {
|
|
@@ -19,10 +19,10 @@ function clientOnly(fn) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// src/index.tsx
|
|
22
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/
|
|
22
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/T3N3FX25.js')) : function() {
|
|
23
23
|
return null;
|
|
24
24
|
};
|
|
25
|
-
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/
|
|
25
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/5CAQ2WGQ.js')) : function() {
|
|
26
26
|
return null;
|
|
27
27
|
};
|
|
28
28
|
|
package/build/dev.jsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
2
|
-
import { createRenderEffect, createMemo
|
|
3
|
-
import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner
|
|
1
|
+
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/dev.js
|
|
2
|
+
import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, flatten, createRoot, merge, createComponent, omit, getOwner, createEffect, $DEVCOMP, enableHydration, enforceLoadingBoundary, flush } from "solid-js";
|
|
3
|
+
import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent as createComponent2, getOwner as getOwner2, untrack as untrack2 } from "solid-js";
|
|
4
4
|
var isServer = false;
|
|
5
5
|
var isDev = true;
|
|
6
6
|
|
|
7
7
|
// src/clientOnly.tsx
|
|
8
8
|
import {
|
|
9
|
-
createMemo,
|
|
9
|
+
createMemo as createMemo2,
|
|
10
10
|
createSignal,
|
|
11
11
|
omit as omit2,
|
|
12
12
|
onSettled,
|
|
@@ -27,17 +27,17 @@ function clientOnly(fn) {
|
|
|
27
27
|
onSettled(() => {
|
|
28
28
|
setMounted(true);
|
|
29
29
|
});
|
|
30
|
-
return
|
|
30
|
+
return createMemo2(
|
|
31
31
|
() => (Comp = comp(), m = mounted(), untrack3(() => Comp && m ? Comp(rest) : props.fallback))
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/index.tsx
|
|
37
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/
|
|
37
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/7WZM3IT7.jsx")) : function() {
|
|
38
38
|
return null;
|
|
39
39
|
};
|
|
40
|
-
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/
|
|
40
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/FQC5JHFZ.jsx")) : function() {
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/devtools.tsx
|
|
2
|
-
import { createEffect, createMemo,
|
|
2
|
+
import { createEffect, createMemo, onSettled, runWithOwner } from "solid-js";
|
|
3
3
|
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
4
|
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
5
5
|
function SolidQueryDevtools(props) {
|
|
@@ -60,18 +60,20 @@ function SolidQueryDevtools(props) {
|
|
|
60
60
|
devtools.setTheme(theme || "system");
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
let
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
let mounted = false;
|
|
64
|
+
let disposed = false;
|
|
65
|
+
onSettled(() => {
|
|
66
|
+
queueMicrotask(() => {
|
|
67
|
+
if (disposed) return;
|
|
68
|
+
runWithOwner(null, () => devtools.mount(ref));
|
|
69
|
+
mounted = true;
|
|
70
|
+
});
|
|
71
|
+
return () => {
|
|
72
|
+
disposed = true;
|
|
73
|
+
if (mounted) {
|
|
74
|
+
devtools.unmount();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
75
77
|
});
|
|
76
78
|
return <div class="tsqd-parent-container" ref={ref} />;
|
|
77
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref, template } from '../chunk/
|
|
2
|
-
import { createMemo, createEffect,
|
|
1
|
+
import { ref, template } from '../chunk/5YUDKRGO.js';
|
|
2
|
+
import { createMemo, createEffect, onSettled, runWithOwner } from 'solid-js';
|
|
3
3
|
import { useQueryClient, onlineManager } from '@tanstack/solid-query';
|
|
4
4
|
import { TanstackQueryDevtools } from '@tanstack/query-devtools';
|
|
5
5
|
|
|
@@ -44,25 +44,25 @@ function SolidQueryDevtools(props) {
|
|
|
44
44
|
createEffect(() => props.theme, (theme) => {
|
|
45
45
|
devtools.setTheme(theme || "system");
|
|
46
46
|
});
|
|
47
|
-
let
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
let mounted = false;
|
|
48
|
+
let disposed = false;
|
|
49
|
+
onSettled(() => {
|
|
50
|
+
queueMicrotask(() => {
|
|
51
|
+
if (disposed) return;
|
|
52
|
+
runWithOwner(null, () => devtools.mount(ref2));
|
|
53
|
+
mounted = true;
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
disposed = true;
|
|
57
|
+
if (mounted) {
|
|
58
|
+
devtools.unmount();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
53
61
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return (() => {
|
|
61
|
-
var _el$ = _tmpl$();
|
|
62
|
-
var _ref$ = ref2;
|
|
63
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
64
|
-
return _el$;
|
|
65
|
-
})();
|
|
62
|
+
var _el$ = _tmpl$();
|
|
63
|
+
var _ref$ = ref2;
|
|
64
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
65
|
+
return _el$;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export { SolidQueryDevtools as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref, template } from '../chunk/
|
|
2
|
-
import { createMemo, createEffect,
|
|
1
|
+
import { ref, template } from '../chunk/OIFXIFGE.js';
|
|
2
|
+
import { createMemo, createEffect, onSettled, runWithOwner } from 'solid-js';
|
|
3
3
|
import { useQueryClient, onlineManager } from '@tanstack/solid-query';
|
|
4
4
|
import { TanstackQueryDevtools } from '@tanstack/query-devtools';
|
|
5
5
|
|
|
@@ -44,25 +44,25 @@ function SolidQueryDevtools(props) {
|
|
|
44
44
|
createEffect(() => props.theme, (theme) => {
|
|
45
45
|
devtools.setTheme(theme || "system");
|
|
46
46
|
});
|
|
47
|
-
let
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
let mounted = false;
|
|
48
|
+
let disposed = false;
|
|
49
|
+
onSettled(() => {
|
|
50
|
+
queueMicrotask(() => {
|
|
51
|
+
if (disposed) return;
|
|
52
|
+
runWithOwner(null, () => devtools.mount(ref2));
|
|
53
|
+
mounted = true;
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
disposed = true;
|
|
57
|
+
if (mounted) {
|
|
58
|
+
devtools.unmount();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
53
61
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return (() => {
|
|
61
|
-
var _el$ = _tmpl$();
|
|
62
|
-
var _ref$ = ref2;
|
|
63
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
64
|
-
return _el$;
|
|
65
|
-
})();
|
|
62
|
+
var _el$ = _tmpl$();
|
|
63
|
+
var _ref$ = ref2;
|
|
64
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
65
|
+
return _el$;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export { SolidQueryDevtools as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref, effect, style, template } from '../chunk/
|
|
2
|
-
import { createMemo, createEffect,
|
|
1
|
+
import { ref, effect, style, template } from '../chunk/OIFXIFGE.js';
|
|
2
|
+
import { createMemo, createEffect, onSettled, runWithOwner } from 'solid-js';
|
|
3
3
|
import { useQueryClient, onlineManager } from '@tanstack/solid-query';
|
|
4
4
|
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools';
|
|
5
5
|
|
|
@@ -42,30 +42,30 @@ function SolidQueryDevtoolsPanel(props) {
|
|
|
42
42
|
createEffect(() => props.theme, (theme) => {
|
|
43
43
|
devtools.setTheme(theme || "system");
|
|
44
44
|
});
|
|
45
|
-
let
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
let mounted = false;
|
|
46
|
+
let disposed = false;
|
|
47
|
+
onSettled(() => {
|
|
48
|
+
queueMicrotask(() => {
|
|
49
|
+
if (disposed) return;
|
|
50
|
+
runWithOwner(null, () => devtools.mount(ref2));
|
|
51
|
+
mounted = true;
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
disposed = true;
|
|
55
|
+
if (mounted) {
|
|
56
|
+
devtools.unmount();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
51
59
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
var _el$ = _tmpl$();
|
|
61
|
+
var _ref$ = ref2;
|
|
62
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
63
|
+
effect(() => ({
|
|
64
|
+
...props.style
|
|
65
|
+
}), (_v$, _$p) => {
|
|
66
|
+
style(_el$, _v$, _$p);
|
|
57
67
|
});
|
|
58
|
-
return
|
|
59
|
-
var _el$ = _tmpl$();
|
|
60
|
-
var _ref$ = ref2;
|
|
61
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
62
|
-
effect(() => ({
|
|
63
|
-
...props.style
|
|
64
|
-
}), (_v$, _$p) => {
|
|
65
|
-
style(_el$, _v$, _$p);
|
|
66
|
-
});
|
|
67
|
-
return _el$;
|
|
68
|
-
})();
|
|
68
|
+
return _el$;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref, effect, style, template } from '../chunk/
|
|
2
|
-
import { createMemo, createEffect,
|
|
1
|
+
import { ref, effect, style, template } from '../chunk/5YUDKRGO.js';
|
|
2
|
+
import { createMemo, createEffect, onSettled, runWithOwner } from 'solid-js';
|
|
3
3
|
import { useQueryClient, onlineManager } from '@tanstack/solid-query';
|
|
4
4
|
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools';
|
|
5
5
|
|
|
@@ -42,30 +42,30 @@ function SolidQueryDevtoolsPanel(props) {
|
|
|
42
42
|
createEffect(() => props.theme, (theme) => {
|
|
43
43
|
devtools.setTheme(theme || "system");
|
|
44
44
|
});
|
|
45
|
-
let
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
let mounted = false;
|
|
46
|
+
let disposed = false;
|
|
47
|
+
onSettled(() => {
|
|
48
|
+
queueMicrotask(() => {
|
|
49
|
+
if (disposed) return;
|
|
50
|
+
runWithOwner(null, () => devtools.mount(ref2));
|
|
51
|
+
mounted = true;
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
disposed = true;
|
|
55
|
+
if (mounted) {
|
|
56
|
+
devtools.unmount();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
51
59
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
var _el$ = _tmpl$();
|
|
61
|
+
var _ref$ = ref2;
|
|
62
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
63
|
+
effect(() => ({
|
|
64
|
+
...props.style
|
|
65
|
+
}), (_v$, _$p) => {
|
|
66
|
+
style(_el$, _v$, _$p);
|
|
57
67
|
});
|
|
58
|
-
return
|
|
59
|
-
var _el$ = _tmpl$();
|
|
60
|
-
var _ref$ = ref2;
|
|
61
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
62
|
-
effect(() => ({
|
|
63
|
-
...props.style
|
|
64
|
-
}), (_v$, _$p) => {
|
|
65
|
-
style(_el$, _v$, _$p);
|
|
66
|
-
});
|
|
67
|
-
return _el$;
|
|
68
|
-
})();
|
|
68
|
+
return _el$;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export { SolidQueryDevtoolsPanel as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/devtoolsPanel.tsx
|
|
2
|
-
import { createEffect, createMemo,
|
|
2
|
+
import { createEffect, createMemo, onSettled, runWithOwner } from "solid-js";
|
|
3
3
|
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
4
|
import { TanstackQueryDevtoolsPanel } from "@tanstack/query-devtools";
|
|
5
5
|
function SolidQueryDevtoolsPanel(props) {
|
|
@@ -47,18 +47,20 @@ function SolidQueryDevtoolsPanel(props) {
|
|
|
47
47
|
devtools.setTheme(theme || "system");
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
let
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
let mounted = false;
|
|
51
|
+
let disposed = false;
|
|
52
|
+
onSettled(() => {
|
|
53
|
+
queueMicrotask(() => {
|
|
54
|
+
if (disposed) return;
|
|
55
|
+
runWithOwner(null, () => devtools.mount(ref));
|
|
56
|
+
mounted = true;
|
|
57
|
+
});
|
|
58
|
+
return () => {
|
|
59
|
+
disposed = true;
|
|
60
|
+
if (mounted) {
|
|
61
|
+
devtools.unmount();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
62
64
|
});
|
|
63
65
|
return <div
|
|
64
66
|
style={{ height: "500px", ...props.style }}
|
package/build/index.cjs
CHANGED
|
@@ -36,7 +36,6 @@ function style(node, value, prev) {
|
|
|
36
36
|
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
37
37
|
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
38
38
|
prev || (prev = {});
|
|
39
|
-
value || (value = {});
|
|
40
39
|
let v, s;
|
|
41
40
|
for (s in value) {
|
|
42
41
|
v = value[s];
|
|
@@ -55,12 +54,18 @@ function ref(fn, element) {
|
|
|
55
54
|
function isHydrating(node) {
|
|
56
55
|
return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
|
|
57
56
|
}
|
|
58
|
-
var effect, isServer, isDev;
|
|
57
|
+
var transparentOptions, effect, isServer, isDev;
|
|
59
58
|
var init_web = __esm({
|
|
60
|
-
"../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
61
|
-
|
|
62
|
-
transparent: true
|
|
63
|
-
|
|
59
|
+
"../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/web.js"() {
|
|
60
|
+
transparentOptions = {
|
|
61
|
+
transparent: true,
|
|
62
|
+
sync: true
|
|
63
|
+
};
|
|
64
|
+
effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
|
|
65
|
+
transparent: true,
|
|
66
|
+
sync: true,
|
|
67
|
+
...options
|
|
68
|
+
} : transparentOptions);
|
|
64
69
|
isServer = false;
|
|
65
70
|
isDev = false;
|
|
66
71
|
}
|
|
@@ -111,25 +116,25 @@ function SolidQueryDevtools(props) {
|
|
|
111
116
|
solidJs.createEffect(() => props.theme, (theme) => {
|
|
112
117
|
devtools.setTheme(theme || "system");
|
|
113
118
|
});
|
|
114
|
-
let
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
let mounted = false;
|
|
120
|
+
let disposed = false;
|
|
121
|
+
solidJs.onSettled(() => {
|
|
122
|
+
queueMicrotask(() => {
|
|
123
|
+
if (disposed) return;
|
|
124
|
+
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
125
|
+
mounted = true;
|
|
126
|
+
});
|
|
127
|
+
return () => {
|
|
128
|
+
disposed = true;
|
|
129
|
+
if (mounted) {
|
|
130
|
+
devtools.unmount();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
var _el$ = _tmpl$();
|
|
135
|
+
var _ref$ = ref2;
|
|
136
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
137
|
+
return _el$;
|
|
133
138
|
}
|
|
134
139
|
var _tmpl$;
|
|
135
140
|
var init_devtools = __esm({
|
|
@@ -183,30 +188,30 @@ function SolidQueryDevtoolsPanel(props) {
|
|
|
183
188
|
solidJs.createEffect(() => props.theme, (theme) => {
|
|
184
189
|
devtools.setTheme(theme || "system");
|
|
185
190
|
});
|
|
186
|
-
let
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
solidJs.onCleanup(() => {
|
|
194
|
-
isDisposed = true;
|
|
195
|
-
if (isMounted) {
|
|
196
|
-
devtools.unmount();
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
return (() => {
|
|
200
|
-
var _el$ = _tmpl$2();
|
|
201
|
-
var _ref$ = ref2;
|
|
202
|
-
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
203
|
-
effect(() => ({
|
|
204
|
-
...props.style
|
|
205
|
-
}), (_v$, _$p) => {
|
|
206
|
-
style(_el$, _v$, _$p);
|
|
191
|
+
let mounted = false;
|
|
192
|
+
let disposed = false;
|
|
193
|
+
solidJs.onSettled(() => {
|
|
194
|
+
queueMicrotask(() => {
|
|
195
|
+
if (disposed) return;
|
|
196
|
+
solidJs.runWithOwner(null, () => devtools.mount(ref2));
|
|
197
|
+
mounted = true;
|
|
207
198
|
});
|
|
208
|
-
return
|
|
209
|
-
|
|
199
|
+
return () => {
|
|
200
|
+
disposed = true;
|
|
201
|
+
if (mounted) {
|
|
202
|
+
devtools.unmount();
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
var _el$ = _tmpl$2();
|
|
207
|
+
var _ref$ = ref2;
|
|
208
|
+
typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
|
|
209
|
+
effect(() => ({
|
|
210
|
+
...props.style
|
|
211
|
+
}), (_v$, _$p) => {
|
|
212
|
+
style(_el$, _v$, _$p);
|
|
213
|
+
});
|
|
214
|
+
return _el$;
|
|
210
215
|
}
|
|
211
216
|
var _tmpl$2;
|
|
212
217
|
var init_devtoolsPanel = __esm({
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDev, isServer } from './chunk/
|
|
1
|
+
import { isDev, isServer } from './chunk/5YUDKRGO.js';
|
|
2
2
|
import { createSignal, omit, sharedConfig, onSettled, createMemo, untrack } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
function clientOnly(fn) {
|
|
@@ -19,10 +19,10 @@ function clientOnly(fn) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// src/index.tsx
|
|
22
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/
|
|
22
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/FNDI35UR.js')) : function() {
|
|
23
23
|
return null;
|
|
24
24
|
};
|
|
25
|
-
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/
|
|
25
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/DXOBITS6.js')) : function() {
|
|
26
26
|
return null;
|
|
27
27
|
};
|
|
28
28
|
|
package/build/index.jsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.
|
|
2
|
-
import { createRenderEffect, createMemo
|
|
3
|
-
import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner
|
|
1
|
+
// ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.15_solid-js@2.0.0-beta.15/node_modules/@solidjs/web/dist/web.js
|
|
2
|
+
import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, flatten, createRoot, merge, createComponent, omit, getOwner, createEffect, enableHydration, flush } from "solid-js";
|
|
3
|
+
import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent as createComponent2, getOwner as getOwner2, untrack as untrack2 } from "solid-js";
|
|
4
4
|
var isServer = false;
|
|
5
5
|
var isDev = false;
|
|
6
6
|
|
|
7
7
|
// src/clientOnly.tsx
|
|
8
8
|
import {
|
|
9
|
-
createMemo,
|
|
9
|
+
createMemo as createMemo2,
|
|
10
10
|
createSignal,
|
|
11
11
|
omit as omit2,
|
|
12
12
|
onSettled,
|
|
@@ -27,17 +27,17 @@ function clientOnly(fn) {
|
|
|
27
27
|
onSettled(() => {
|
|
28
28
|
setMounted(true);
|
|
29
29
|
});
|
|
30
|
-
return
|
|
30
|
+
return createMemo2(
|
|
31
31
|
() => (Comp = comp(), m = mounted(), untrack3(() => Comp && m ? Comp(rest) : props.fallback))
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/index.tsx
|
|
37
|
-
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/
|
|
37
|
+
var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/7WZM3IT7.jsx")) : function() {
|
|
38
38
|
return null;
|
|
39
39
|
};
|
|
40
|
-
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/
|
|
40
|
+
var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/FQC5JHFZ.jsx")) : function() {
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
43
43
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-devtools",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.5",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/solid-query Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,23 +44,23 @@
|
|
|
44
44
|
"!src/__tests__"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-devtools": "5.
|
|
47
|
+
"@tanstack/query-devtools": "5.101.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/core": "^7.28.0",
|
|
51
51
|
"@babel/preset-typescript": "^7.18.6",
|
|
52
52
|
"@solidjs/testing-library": "^0.8.10",
|
|
53
|
-
"@solidjs/web": "2.0.0-beta.
|
|
54
|
-
"babel-preset-solid": "2.0.0-beta.
|
|
53
|
+
"@solidjs/web": "2.0.0-beta.15",
|
|
54
|
+
"babel-preset-solid": "2.0.0-beta.15",
|
|
55
55
|
"npm-run-all2": "^5.0.0",
|
|
56
|
-
"solid-js": "2.0.0-beta.
|
|
56
|
+
"solid-js": "2.0.0-beta.15",
|
|
57
57
|
"tsup-preset-solid": "^2.2.0",
|
|
58
58
|
"vite-plugin-solid": "3.0.0-next.5",
|
|
59
|
-
"@tanstack/solid-query": "6.0.0-beta.
|
|
59
|
+
"@tanstack/solid-query": "6.0.0-beta.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"solid-js": ">=2.0.0-beta.0 <3.0.0",
|
|
63
|
-
"@tanstack/solid-query": "^6.0.0-beta.
|
|
63
|
+
"@tanstack/solid-query": "^6.0.0-beta.5"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"clean": "premove ./build ./coverage ./dist-ts",
|
package/src/clientOnly.tsx
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
untrack,
|
|
8
8
|
} from 'solid-js'
|
|
9
9
|
import { isServer } from '@solidjs/web'
|
|
10
|
-
import type { Component, ComponentProps
|
|
10
|
+
import type { Component, ComponentProps } from 'solid-js'
|
|
11
|
+
import type { JSX } from '@solidjs/web'
|
|
11
12
|
|
|
12
13
|
/*
|
|
13
14
|
This function has been taken from solid-start's codebase
|
package/src/devtools.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createEffect, createMemo,
|
|
1
|
+
import { createEffect, createMemo, onSettled, runWithOwner } from 'solid-js'
|
|
2
2
|
import { onlineManager, useQueryClient } from '@tanstack/solid-query'
|
|
3
3
|
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
|
|
4
4
|
import type {
|
|
@@ -15,13 +15,13 @@ interface DevtoolsOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
initialIsOpen?: boolean
|
|
17
17
|
/**
|
|
18
|
-
* The position of the
|
|
19
|
-
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
18
|
+
* The position of the TanStack logo to open and close the devtools panel.
|
|
19
|
+
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
|
20
20
|
* Defaults to 'bottom-right'.
|
|
21
21
|
*/
|
|
22
22
|
buttonPosition?: DevtoolsButtonPosition
|
|
23
23
|
/**
|
|
24
|
-
* The position of the
|
|
24
|
+
* The position of the Solid Query devtools panel.
|
|
25
25
|
* 'top' | 'bottom' | 'left' | 'right'
|
|
26
26
|
* Defaults to 'bottom'.
|
|
27
27
|
*/
|
|
@@ -118,19 +118,23 @@ export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
|
118
118
|
},
|
|
119
119
|
)
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
// devtools.mount() calls render() from solid-js/web, which calls flush().
|
|
122
|
+
// flush() is not reentrant inside onSettled, so defer the mount to a
|
|
123
|
+
// microtask. runWithOwner(null) escapes the owned scope because
|
|
124
|
+
// devtools.mount renders a nested Solid app (creating reactive primitives).
|
|
125
|
+
let mounted = false
|
|
126
|
+
let disposed = false
|
|
127
|
+
onSettled(() => {
|
|
128
|
+
queueMicrotask(() => {
|
|
129
|
+
if (disposed) return
|
|
130
|
+
runWithOwner(null, () => devtools.mount(ref))
|
|
131
|
+
mounted = true
|
|
132
|
+
})
|
|
133
|
+
return () => {
|
|
134
|
+
disposed = true
|
|
135
|
+
if (mounted) {
|
|
136
|
+
devtools.unmount()
|
|
137
|
+
}
|
|
134
138
|
}
|
|
135
139
|
})
|
|
136
140
|
|
package/src/devtoolsPanel.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createEffect, createMemo,
|
|
1
|
+
import { createEffect, createMemo, onSettled, runWithOwner } from 'solid-js'
|
|
2
2
|
import { onlineManager, useQueryClient } from '@tanstack/solid-query'
|
|
3
3
|
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'
|
|
4
4
|
import type { DevtoolsErrorType, Theme } from '@tanstack/query-devtools'
|
|
5
5
|
import type { QueryClient } from '@tanstack/solid-query'
|
|
6
|
-
import type { JSX } from '
|
|
6
|
+
import type { JSX } from '@solidjs/web'
|
|
7
7
|
|
|
8
8
|
export interface DevtoolsPanelOptions {
|
|
9
9
|
/**
|
|
@@ -34,7 +34,7 @@ export interface DevtoolsPanelOptions {
|
|
|
34
34
|
/**
|
|
35
35
|
* Callback function that is called when the devtools panel is closed
|
|
36
36
|
*/
|
|
37
|
-
onClose?: () =>
|
|
37
|
+
onClose?: () => void
|
|
38
38
|
/**
|
|
39
39
|
* Set this to true to hide disabled queries from the devtools panel.
|
|
40
40
|
*/
|
|
@@ -93,19 +93,23 @@ export default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {
|
|
|
93
93
|
},
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
// devtools.mount() calls render() from solid-js/web, which calls flush().
|
|
97
|
+
// flush() is not reentrant inside onSettled, so defer the mount to a
|
|
98
|
+
// microtask. runWithOwner(null) escapes the owned scope because
|
|
99
|
+
// devtools.mount renders a nested Solid app (creating reactive primitives).
|
|
100
|
+
let mounted = false
|
|
101
|
+
let disposed = false
|
|
102
|
+
onSettled(() => {
|
|
103
|
+
queueMicrotask(() => {
|
|
104
|
+
if (disposed) return
|
|
105
|
+
runWithOwner(null, () => devtools.mount(ref))
|
|
106
|
+
mounted = true
|
|
107
|
+
})
|
|
108
|
+
return () => {
|
|
109
|
+
disposed = true
|
|
110
|
+
if (mounted) {
|
|
111
|
+
devtools.unmount()
|
|
112
|
+
}
|
|
109
113
|
}
|
|
110
114
|
})
|
|
111
115
|
|