@tanstack/solid-query-devtools 6.0.0-beta.4 → 6.0.0-beta.6

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.
@@ -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 'solid-js';
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 React Query logo to open and close the devtools panel.
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 React Query devtools panel.
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?: () => unknown;
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 'solid-js';
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 React Query logo to open and close the devtools panel.
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 React Query devtools panel.
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?: () => unknown;
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.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/dev.js
4
- var effect = (fn, effectFn) => createRenderEffect(fn, effectFn, {
5
- transparent: true
6
- });
3
+ // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/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
+ sync: true,
10
+ ...options,
11
+ transparent: !options.scope
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");
@@ -22,21 +28,41 @@ function setAttribute(node, name, value) {
22
28
  }
23
29
  function style(node, value, prev) {
24
30
  if (!value) {
25
- if (prev) setAttribute(node, "style");
31
+ if (prev || node._$styles) {
32
+ setAttribute(node, "style");
33
+ node._$styles = void 0;
34
+ }
26
35
  return;
27
36
  }
28
37
  const nodeStyle = node.style;
29
- if (typeof value === "string") return nodeStyle.cssText = value;
30
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
31
- prev || (prev = {});
32
- value || (value = {});
38
+ if (typeof value === "string") {
39
+ node._$styles = void 0;
40
+ return nodeStyle.cssText = value;
41
+ }
42
+ if (typeof prev === "string") {
43
+ nodeStyle.cssText = "";
44
+ prev = void 0;
45
+ }
46
+ let applied = node._$styles;
47
+ if (!applied) {
48
+ applied = node._$styles = prev ? {
49
+ ...prev
50
+ } : {};
51
+ }
33
52
  let v, s;
53
+ for (s in applied) {
54
+ if (value[s] == null) {
55
+ nodeStyle.removeProperty(s);
56
+ delete applied[s];
57
+ }
58
+ }
34
59
  for (s in value) {
35
60
  v = value[s];
36
- if (v !== prev[s]) nodeStyle.setProperty(s, v);
37
- delete prev[s];
61
+ if (v != null && v !== applied[s]) {
62
+ nodeStyle.setProperty(s, v);
63
+ applied[s] = v;
64
+ }
38
65
  }
39
- for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
40
66
  }
41
67
  function applyRef(r, element) {
42
68
  Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
@@ -48,6 +74,14 @@ function ref(fn, element) {
48
74
  function isHydrating(node) {
49
75
  return sharedConfig.hydrating && (!node || node.isConnected);
50
76
  }
77
+ var ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
78
+ var ResponseEnvelope = class {
79
+ constructor(response, value) {
80
+ this.response = response;
81
+ this.value = value;
82
+ }
83
+ };
84
+ ResponseEnvelope.prototype[ENVELOPE] = true;
51
85
  var isServer = false;
52
86
  var isDev = true;
53
87
 
@@ -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.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/web.js
4
- var effect = (fn, effectFn) => createRenderEffect(fn, effectFn, {
5
- transparent: true
6
- });
3
+ // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/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
+ sync: true,
10
+ ...options,
11
+ transparent: !options.scope
12
+ } : transparentOptions);
7
13
  function create(html, bypassGuard, flag) {
8
14
  const t = document.createElement("template");
9
15
  t.innerHTML = html;
@@ -20,21 +26,41 @@ function setAttribute(node, name, value) {
20
26
  }
21
27
  function style(node, value, prev) {
22
28
  if (!value) {
23
- if (prev) setAttribute(node, "style");
29
+ if (prev || node._$styles) {
30
+ setAttribute(node, "style");
31
+ node._$styles = void 0;
32
+ }
24
33
  return;
25
34
  }
26
35
  const nodeStyle = node.style;
27
- if (typeof value === "string") return nodeStyle.cssText = value;
28
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
29
- prev || (prev = {});
30
- value || (value = {});
36
+ if (typeof value === "string") {
37
+ node._$styles = void 0;
38
+ return nodeStyle.cssText = value;
39
+ }
40
+ if (typeof prev === "string") {
41
+ nodeStyle.cssText = "";
42
+ prev = void 0;
43
+ }
44
+ let applied = node._$styles;
45
+ if (!applied) {
46
+ applied = node._$styles = prev ? {
47
+ ...prev
48
+ } : {};
49
+ }
31
50
  let v, s;
51
+ for (s in applied) {
52
+ if (value[s] == null) {
53
+ nodeStyle.removeProperty(s);
54
+ delete applied[s];
55
+ }
56
+ }
32
57
  for (s in value) {
33
58
  v = value[s];
34
- if (v !== prev[s]) nodeStyle.setProperty(s, v);
35
- delete prev[s];
59
+ if (v != null && v !== applied[s]) {
60
+ nodeStyle.setProperty(s, v);
61
+ applied[s] = v;
62
+ }
36
63
  }
37
- for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
38
64
  }
39
65
  function applyRef(r, element) {
40
66
  Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
@@ -46,6 +72,14 @@ function ref(fn, element) {
46
72
  function isHydrating(node) {
47
73
  return sharedConfig.hydrating && (!node || node.isConnected);
48
74
  }
75
+ var ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
76
+ var ResponseEnvelope = class {
77
+ constructor(response, value) {
78
+ this.response = response;
79
+ this.value = value;
80
+ }
81
+ };
82
+ ResponseEnvelope.prototype[ENVELOPE] = true;
49
83
  var isServer = false;
50
84
  var isDev = false;
51
85
 
package/build/dev.cjs CHANGED
@@ -31,21 +31,41 @@ function setAttribute(node, name, value) {
31
31
  }
32
32
  function style(node, value, prev) {
33
33
  if (!value) {
34
- if (prev) setAttribute(node, "style");
34
+ if (prev || node._$styles) {
35
+ setAttribute(node, "style");
36
+ node._$styles = void 0;
37
+ }
35
38
  return;
36
39
  }
37
40
  const nodeStyle = node.style;
38
- if (typeof value === "string") return nodeStyle.cssText = value;
39
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
40
- prev || (prev = {});
41
- value || (value = {});
41
+ if (typeof value === "string") {
42
+ node._$styles = void 0;
43
+ return nodeStyle.cssText = value;
44
+ }
45
+ if (typeof prev === "string") {
46
+ nodeStyle.cssText = "";
47
+ prev = void 0;
48
+ }
49
+ let applied = node._$styles;
50
+ if (!applied) {
51
+ applied = node._$styles = prev ? {
52
+ ...prev
53
+ } : {};
54
+ }
42
55
  let v, s;
56
+ for (s in applied) {
57
+ if (value[s] == null) {
58
+ nodeStyle.removeProperty(s);
59
+ delete applied[s];
60
+ }
61
+ }
43
62
  for (s in value) {
44
63
  v = value[s];
45
- if (v !== prev[s]) nodeStyle.setProperty(s, v);
46
- delete prev[s];
64
+ if (v != null && v !== applied[s]) {
65
+ nodeStyle.setProperty(s, v);
66
+ applied[s] = v;
67
+ }
47
68
  }
48
- for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
49
69
  }
50
70
  function applyRef(r, element) {
51
71
  Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
@@ -57,12 +77,26 @@ function ref(fn, element) {
57
77
  function isHydrating(node) {
58
78
  return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
59
79
  }
60
- var effect, isServer, isDev;
80
+ var transparentOptions, effect, ENVELOPE, ResponseEnvelope, isServer, isDev;
61
81
  var init_dev = __esm({
62
- "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/dev.js"() {
63
- effect = (fn, effectFn) => solidJs.createRenderEffect(fn, effectFn, {
64
- transparent: true
65
- });
82
+ "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/node_modules/@solidjs/web/dist/dev.js"() {
83
+ transparentOptions = {
84
+ transparent: true,
85
+ sync: true
86
+ };
87
+ effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
88
+ sync: true,
89
+ ...options,
90
+ transparent: !options.scope
91
+ } : transparentOptions);
92
+ ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
93
+ ResponseEnvelope = class {
94
+ constructor(response, value) {
95
+ this.response = response;
96
+ this.value = value;
97
+ }
98
+ };
99
+ ResponseEnvelope.prototype[ENVELOPE] = true;
66
100
  isServer = false;
67
101
  isDev = true;
68
102
  }
@@ -113,25 +147,25 @@ function SolidQueryDevtools(props) {
113
147
  solidJs.createEffect(() => props.theme, (theme) => {
114
148
  devtools.setTheme(theme || "system");
115
149
  });
116
- let isMounted = false;
117
- let isDisposed = false;
118
- queueMicrotask(() => {
119
- if (isDisposed) return;
120
- devtools.mount(ref2);
121
- isMounted = true;
122
- });
123
- solidJs.onCleanup(() => {
124
- isDisposed = true;
125
- if (isMounted) {
126
- devtools.unmount();
127
- }
150
+ let mounted = false;
151
+ let disposed = false;
152
+ solidJs.onSettled(() => {
153
+ queueMicrotask(() => {
154
+ if (disposed) return;
155
+ solidJs.runWithOwner(null, () => devtools.mount(ref2));
156
+ mounted = true;
157
+ });
158
+ return () => {
159
+ disposed = true;
160
+ if (mounted) {
161
+ devtools.unmount();
162
+ }
163
+ };
128
164
  });
129
- return (() => {
130
- var _el$ = _tmpl$();
131
- var _ref$ = ref2;
132
- typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
133
- return _el$;
134
- })();
165
+ var _el$ = _tmpl$();
166
+ var _ref$ = ref2;
167
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
168
+ return _el$;
135
169
  }
136
170
  var _tmpl$;
137
171
  var init_devtools = __esm({
@@ -185,30 +219,30 @@ function SolidQueryDevtoolsPanel(props) {
185
219
  solidJs.createEffect(() => props.theme, (theme) => {
186
220
  devtools.setTheme(theme || "system");
187
221
  });
188
- let isMounted = false;
189
- let isDisposed = false;
190
- queueMicrotask(() => {
191
- if (isDisposed) return;
192
- devtools.mount(ref2);
193
- isMounted = true;
222
+ let mounted = false;
223
+ let disposed = false;
224
+ solidJs.onSettled(() => {
225
+ queueMicrotask(() => {
226
+ if (disposed) return;
227
+ solidJs.runWithOwner(null, () => devtools.mount(ref2));
228
+ mounted = true;
229
+ });
230
+ return () => {
231
+ disposed = true;
232
+ if (mounted) {
233
+ devtools.unmount();
234
+ }
235
+ };
194
236
  });
195
- solidJs.onCleanup(() => {
196
- isDisposed = true;
197
- if (isMounted) {
198
- devtools.unmount();
199
- }
237
+ var _el$ = _tmpl$2();
238
+ var _ref$ = ref2;
239
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
240
+ effect(() => ({
241
+ ...props.style
242
+ }), (_v$, _$p) => {
243
+ style(_el$, _v$, _$p);
200
244
  });
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
- })();
245
+ return _el$;
212
246
  }
213
247
  var _tmpl$2;
214
248
  var init_devtoolsPanel = __esm({
package/build/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isDev, isServer } from './chunk/OUUOFKOT.js';
1
+ import { isDev, isServer } from './chunk/C73S7YTW.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/DAAYGNEN.js')) : function() {
22
+ var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/JA7A2ZGS.js')) : function() {
23
23
  return null;
24
24
  };
25
- var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/SQHQ34QQ.js')) : function() {
25
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/CMV5IMZB.js')) : function() {
26
26
  return null;
27
27
  };
28
28
 
package/build/dev.jsx CHANGED
@@ -1,12 +1,20 @@
1
- // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/dev.js
2
- import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, $DEVCOMP, enableHydration, enforceLoadingBoundary } from "solid-js";
3
- import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge, untrack as untrack2 } from "solid-js";
1
+ // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/node_modules/@solidjs/web/dist/dev.js
2
+ import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, flatten, createRoot, merge, createComponent, omit, createOwner, $DEVCOMP, enableHydration, enforceLoadingBoundary, flush, getOwner, createEffect } 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
+ var ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
5
+ var ResponseEnvelope = class {
6
+ constructor(response, value) {
7
+ this.response = response;
8
+ this.value = value;
9
+ }
10
+ };
11
+ ResponseEnvelope.prototype[ENVELOPE] = true;
4
12
  var isServer = false;
5
13
  var isDev = true;
6
14
 
7
15
  // src/clientOnly.tsx
8
16
  import {
9
- createMemo,
17
+ createMemo as createMemo2,
10
18
  createSignal,
11
19
  omit as omit2,
12
20
  onSettled,
@@ -27,17 +35,17 @@ function clientOnly(fn) {
27
35
  onSettled(() => {
28
36
  setMounted(true);
29
37
  });
30
- return createMemo(
38
+ return createMemo2(
31
39
  () => (Comp = comp(), m = mounted(), untrack3(() => Comp && m ? Comp(rest) : props.fallback))
32
40
  );
33
41
  };
34
42
  }
35
43
 
36
44
  // src/index.tsx
37
- var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/R2AGYIME.jsx")) : function() {
45
+ var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/7WZM3IT7.jsx")) : function() {
38
46
  return null;
39
47
  };
40
- var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/QZBU22C7.jsx")) : function() {
48
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/FQC5JHFZ.jsx")) : function() {
41
49
  return null;
42
50
  };
43
51
  export {
@@ -1,5 +1,5 @@
1
1
  // src/devtools.tsx
2
- import { createEffect, createMemo, onCleanup } from "solid-js";
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 isMounted = false;
64
- let isDisposed = false;
65
- queueMicrotask(() => {
66
- if (isDisposed) return;
67
- devtools.mount(ref);
68
- isMounted = true;
69
- });
70
- onCleanup(() => {
71
- isDisposed = true;
72
- if (isMounted) {
73
- devtools.unmount();
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/RNXRSYV2.js';
2
- import { createMemo, createEffect, onCleanup } from 'solid-js';
1
+ import { ref, template } from '../chunk/C73S7YTW.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 isMounted = false;
48
- let isDisposed = false;
49
- queueMicrotask(() => {
50
- if (isDisposed) return;
51
- devtools.mount(ref2);
52
- isMounted = true;
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
- onCleanup(() => {
55
- isDisposed = true;
56
- if (isMounted) {
57
- devtools.unmount();
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/OUUOFKOT.js';
2
- import { createMemo, createEffect, onCleanup } from 'solid-js';
1
+ import { ref, template } from '../chunk/KGLMGK4M.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 isMounted = false;
48
- let isDisposed = false;
49
- queueMicrotask(() => {
50
- if (isDisposed) return;
51
- devtools.mount(ref2);
52
- isMounted = true;
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
- onCleanup(() => {
55
- isDisposed = true;
56
- if (isMounted) {
57
- devtools.unmount();
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/OUUOFKOT.js';
2
- import { createMemo, createEffect, onCleanup } from 'solid-js';
1
+ import { ref, effect, style, template } from '../chunk/C73S7YTW.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 isMounted = false;
46
- let isDisposed = false;
47
- queueMicrotask(() => {
48
- if (isDisposed) return;
49
- devtools.mount(ref2);
50
- isMounted = true;
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
- onCleanup(() => {
53
- isDisposed = true;
54
- if (isMounted) {
55
- devtools.unmount();
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, onCleanup } from "solid-js";
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 isMounted = false;
51
- let isDisposed = false;
52
- queueMicrotask(() => {
53
- if (isDisposed) return;
54
- devtools.mount(ref);
55
- isMounted = true;
56
- });
57
- onCleanup(() => {
58
- isDisposed = true;
59
- if (isMounted) {
60
- devtools.unmount();
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 }}
@@ -1,5 +1,5 @@
1
- import { ref, effect, style, template } from '../chunk/RNXRSYV2.js';
2
- import { createMemo, createEffect, onCleanup } from 'solid-js';
1
+ import { ref, effect, style, template } from '../chunk/KGLMGK4M.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 isMounted = false;
46
- let isDisposed = false;
47
- queueMicrotask(() => {
48
- if (isDisposed) return;
49
- devtools.mount(ref2);
50
- isMounted = true;
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
- onCleanup(() => {
53
- isDisposed = true;
54
- if (isMounted) {
55
- devtools.unmount();
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 };
package/build/index.cjs CHANGED
@@ -29,21 +29,41 @@ function setAttribute(node, name, value) {
29
29
  }
30
30
  function style(node, value, prev) {
31
31
  if (!value) {
32
- if (prev) setAttribute(node, "style");
32
+ if (prev || node._$styles) {
33
+ setAttribute(node, "style");
34
+ node._$styles = void 0;
35
+ }
33
36
  return;
34
37
  }
35
38
  const nodeStyle = node.style;
36
- if (typeof value === "string") return nodeStyle.cssText = value;
37
- typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
38
- prev || (prev = {});
39
- value || (value = {});
39
+ if (typeof value === "string") {
40
+ node._$styles = void 0;
41
+ return nodeStyle.cssText = value;
42
+ }
43
+ if (typeof prev === "string") {
44
+ nodeStyle.cssText = "";
45
+ prev = void 0;
46
+ }
47
+ let applied = node._$styles;
48
+ if (!applied) {
49
+ applied = node._$styles = prev ? {
50
+ ...prev
51
+ } : {};
52
+ }
40
53
  let v, s;
54
+ for (s in applied) {
55
+ if (value[s] == null) {
56
+ nodeStyle.removeProperty(s);
57
+ delete applied[s];
58
+ }
59
+ }
41
60
  for (s in value) {
42
61
  v = value[s];
43
- if (v !== prev[s]) nodeStyle.setProperty(s, v);
44
- delete prev[s];
62
+ if (v != null && v !== applied[s]) {
63
+ nodeStyle.setProperty(s, v);
64
+ applied[s] = v;
65
+ }
45
66
  }
46
- for (s in prev) value[s] == null && nodeStyle.removeProperty(s);
47
67
  }
48
68
  function applyRef(r, element) {
49
69
  Array.isArray(r) ? r.flat(Infinity).forEach((f) => f && f(element)) : r(element);
@@ -55,12 +75,26 @@ function ref(fn, element) {
55
75
  function isHydrating(node) {
56
76
  return solidJs.sharedConfig.hydrating && (!node || node.isConnected);
57
77
  }
58
- var effect, isServer, isDev;
78
+ var transparentOptions, effect, ENVELOPE, ResponseEnvelope, isServer, isDev;
59
79
  var init_web = __esm({
60
- "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/web.js"() {
61
- effect = (fn, effectFn) => solidJs.createRenderEffect(fn, effectFn, {
62
- transparent: true
63
- });
80
+ "../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/node_modules/@solidjs/web/dist/web.js"() {
81
+ transparentOptions = {
82
+ transparent: true,
83
+ sync: true
84
+ };
85
+ effect = (fn, effectFn, options) => solidJs.createRenderEffect(fn, effectFn, options ? {
86
+ sync: true,
87
+ ...options,
88
+ transparent: !options.scope
89
+ } : transparentOptions);
90
+ ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
91
+ ResponseEnvelope = class {
92
+ constructor(response, value) {
93
+ this.response = response;
94
+ this.value = value;
95
+ }
96
+ };
97
+ ResponseEnvelope.prototype[ENVELOPE] = true;
64
98
  isServer = false;
65
99
  isDev = false;
66
100
  }
@@ -111,25 +145,25 @@ function SolidQueryDevtools(props) {
111
145
  solidJs.createEffect(() => props.theme, (theme) => {
112
146
  devtools.setTheme(theme || "system");
113
147
  });
114
- let isMounted = false;
115
- let isDisposed = false;
116
- queueMicrotask(() => {
117
- if (isDisposed) return;
118
- devtools.mount(ref2);
119
- isMounted = true;
120
- });
121
- solidJs.onCleanup(() => {
122
- isDisposed = true;
123
- if (isMounted) {
124
- devtools.unmount();
125
- }
148
+ let mounted = false;
149
+ let disposed = false;
150
+ solidJs.onSettled(() => {
151
+ queueMicrotask(() => {
152
+ if (disposed) return;
153
+ solidJs.runWithOwner(null, () => devtools.mount(ref2));
154
+ mounted = true;
155
+ });
156
+ return () => {
157
+ disposed = true;
158
+ if (mounted) {
159
+ devtools.unmount();
160
+ }
161
+ };
126
162
  });
127
- return (() => {
128
- var _el$ = _tmpl$();
129
- var _ref$ = ref2;
130
- typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
131
- return _el$;
132
- })();
163
+ var _el$ = _tmpl$();
164
+ var _ref$ = ref2;
165
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
166
+ return _el$;
133
167
  }
134
168
  var _tmpl$;
135
169
  var init_devtools = __esm({
@@ -183,30 +217,30 @@ function SolidQueryDevtoolsPanel(props) {
183
217
  solidJs.createEffect(() => props.theme, (theme) => {
184
218
  devtools.setTheme(theme || "system");
185
219
  });
186
- let isMounted = false;
187
- let isDisposed = false;
188
- queueMicrotask(() => {
189
- if (isDisposed) return;
190
- devtools.mount(ref2);
191
- isMounted = true;
220
+ let mounted = false;
221
+ let disposed = false;
222
+ solidJs.onSettled(() => {
223
+ queueMicrotask(() => {
224
+ if (disposed) return;
225
+ solidJs.runWithOwner(null, () => devtools.mount(ref2));
226
+ mounted = true;
227
+ });
228
+ return () => {
229
+ disposed = true;
230
+ if (mounted) {
231
+ devtools.unmount();
232
+ }
233
+ };
192
234
  });
193
- solidJs.onCleanup(() => {
194
- isDisposed = true;
195
- if (isMounted) {
196
- devtools.unmount();
197
- }
235
+ var _el$ = _tmpl$2();
236
+ var _ref$ = ref2;
237
+ typeof _ref$ === "function" || Array.isArray(_ref$) ? ref(() => _ref$, _el$) : ref2 = _el$;
238
+ effect(() => ({
239
+ ...props.style
240
+ }), (_v$, _$p) => {
241
+ style(_el$, _v$, _$p);
198
242
  });
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);
207
- });
208
- return _el$;
209
- })();
243
+ return _el$;
210
244
  }
211
245
  var _tmpl$2;
212
246
  var init_devtoolsPanel = __esm({
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isDev, isServer } from './chunk/RNXRSYV2.js';
1
+ import { isDev, isServer } from './chunk/KGLMGK4M.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/BN3QOQGH.js')) : function() {
22
+ var SolidQueryDevtools = isDev ? clientOnly(() => import('./devtools/N77BMJWV.js')) : function() {
23
23
  return null;
24
24
  };
25
- var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/FI3ZIJCV.js')) : function() {
25
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import('./devtoolsPanel/PHKM6EE4.js')) : function() {
26
26
  return null;
27
27
  };
28
28
 
package/build/index.jsx CHANGED
@@ -1,12 +1,20 @@
1
- // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.7_@solidjs+signals@2.0.0-beta.7_solid-js@2.0.0-beta.7/node_modules/@solidjs/web/dist/web.js
2
- import { createRenderEffect, createMemo as createMemo$1, sharedConfig, untrack, runWithOwner, flatten, createRoot, omit, enableHydration } from "solid-js";
3
- import { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, getOwner, merge, untrack as untrack2 } from "solid-js";
1
+ // ../../node_modules/.pnpm/@solidjs+web@2.0.0-beta.21_solid-js@2.0.0-beta.21/node_modules/@solidjs/web/dist/web.js
2
+ import { createRenderEffect, createMemo, sharedConfig, untrack, runWithOwner, flatten, createRoot, merge, createComponent, omit, createOwner, enableHydration, flush, getOwner, createEffect } 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
+ var ENVELOPE = /* @__PURE__ */ Symbol.for("solid.ResponseEnvelope");
5
+ var ResponseEnvelope = class {
6
+ constructor(response, value) {
7
+ this.response = response;
8
+ this.value = value;
9
+ }
10
+ };
11
+ ResponseEnvelope.prototype[ENVELOPE] = true;
4
12
  var isServer = false;
5
13
  var isDev = false;
6
14
 
7
15
  // src/clientOnly.tsx
8
16
  import {
9
- createMemo,
17
+ createMemo as createMemo2,
10
18
  createSignal,
11
19
  omit as omit2,
12
20
  onSettled,
@@ -27,17 +35,17 @@ function clientOnly(fn) {
27
35
  onSettled(() => {
28
36
  setMounted(true);
29
37
  });
30
- return createMemo(
38
+ return createMemo2(
31
39
  () => (Comp = comp(), m = mounted(), untrack3(() => Comp && m ? Comp(rest) : props.fallback))
32
40
  );
33
41
  };
34
42
  }
35
43
 
36
44
  // src/index.tsx
37
- var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/R2AGYIME.jsx")) : function() {
45
+ var SolidQueryDevtools = isDev ? clientOnly(() => import("./devtools/7WZM3IT7.jsx")) : function() {
38
46
  return null;
39
47
  };
40
- var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/QZBU22C7.jsx")) : function() {
48
+ var SolidQueryDevtoolsPanel = isDev ? clientOnly(() => import("./devtoolsPanel/FQC5JHFZ.jsx")) : function() {
41
49
  return null;
42
50
  };
43
51
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-query-devtools",
3
- "version": "6.0.0-beta.4",
3
+ "version": "6.0.0-beta.6",
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,24 @@
44
44
  "!src/__tests__"
45
45
  ],
46
46
  "dependencies": {
47
- "@tanstack/query-devtools": "5.93.0"
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
+ "@solidjs/signals": "^2.0.0-beta.21",
52
53
  "@solidjs/testing-library": "^0.8.10",
53
- "@solidjs/web": "2.0.0-beta.7",
54
- "babel-preset-solid": "2.0.0-beta.7",
54
+ "@solidjs/web": "2.0.0-beta.21",
55
+ "babel-preset-solid": "2.0.0-beta.21",
55
56
  "npm-run-all2": "^5.0.0",
56
- "solid-js": "2.0.0-beta.7",
57
+ "solid-js": "2.0.0-beta.21",
57
58
  "tsup-preset-solid": "^2.2.0",
58
- "vite-plugin-solid": "3.0.0-next.5",
59
- "@tanstack/solid-query": "6.0.0-beta.4"
59
+ "vite-plugin-solid": "3.0.0-next.14",
60
+ "@tanstack/solid-query": "6.0.0-beta.6"
60
61
  },
61
62
  "peerDependencies": {
62
63
  "solid-js": ">=2.0.0-beta.0 <3.0.0",
63
- "@tanstack/solid-query": "^6.0.0-beta.4"
64
+ "@tanstack/solid-query": "^6.0.0-beta.6"
64
65
  },
65
66
  "scripts": {
66
67
  "clean": "premove ./build ./coverage ./dist-ts",
@@ -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, JSX } from 'solid-js'
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, onCleanup } from 'solid-js'
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 React Query logo to open and close the devtools panel.
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 React Query devtools panel.
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
- let isMounted = false
122
- let isDisposed = false
123
-
124
- queueMicrotask(() => {
125
- if (isDisposed) return
126
- devtools.mount(ref)
127
- isMounted = true
128
- })
129
-
130
- onCleanup(() => {
131
- isDisposed = true
132
- if (isMounted) {
133
- devtools.unmount()
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
 
@@ -1,9 +1,9 @@
1
- import { createEffect, createMemo, onCleanup } from 'solid-js'
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 'solid-js'
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?: () => unknown
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
- let isMounted = false
97
- let isDisposed = false
98
-
99
- queueMicrotask(() => {
100
- if (isDisposed) return
101
- devtools.mount(ref)
102
- isMounted = true
103
- })
104
-
105
- onCleanup(() => {
106
- isDisposed = true
107
- if (isMounted) {
108
- devtools.unmount()
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