@tanstack/solid-query-devtools 5.94.5 → 6.0.0-alpha.1
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/chunk/75V4Q6CI.js +1231 -0
- package/build/chunk/AU2REB6C.js +1195 -0
- package/build/dev.cjs +1310 -44
- package/build/dev.js +10 -9
- package/build/dev.jsx +1202 -16
- package/build/devtools/{BCD44V6M.js → BK5V6NH3.js} +27 -21
- package/build/devtools/CBPRJMAC.js +68 -0
- package/build/devtools/R2AGYIME.jsx +80 -0
- package/build/devtoolsPanel/{VOW4J2DZ.js → A5BO2WVY.js} +29 -19
- package/build/devtoolsPanel/KNUODKZO.js +71 -0
- package/build/devtoolsPanel/{NDFIDQLQ.jsx → QZBU22C7.jsx} +37 -16
- package/build/index.cjs +1274 -44
- package/build/index.js +10 -9
- package/build/index.jsx +1165 -16
- package/package.json +11 -7
- package/src/clientOnly.tsx +9 -7
- package/src/devtools.tsx +54 -27
- package/src/devtoolsPanel.tsx +38 -15
- package/src/index.tsx +1 -1
- package/build/devtools/32HRKFKI.jsx +0 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query-devtools",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.1",
|
|
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,19 +44,23 @@
|
|
|
44
44
|
"!src/__tests__"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@tanstack/query-devtools": "5.
|
|
47
|
+
"@tanstack/query-devtools": "5.93.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
+
"@babel/core": "^7.28.0",
|
|
51
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
50
52
|
"@solidjs/testing-library": "^0.8.10",
|
|
53
|
+
"@solidjs/web": "2.0.0-beta.4",
|
|
54
|
+
"babel-preset-solid": "2.0.0-beta.4",
|
|
51
55
|
"npm-run-all2": "^5.0.0",
|
|
52
|
-
"solid-js": "
|
|
56
|
+
"solid-js": "2.0.0-beta.4",
|
|
53
57
|
"tsup-preset-solid": "^2.2.0",
|
|
54
|
-
"vite-plugin-solid": "
|
|
55
|
-
"@tanstack/solid-query": "
|
|
58
|
+
"vite-plugin-solid": "3.0.0-next.2",
|
|
59
|
+
"@tanstack/solid-query": "6.0.0-alpha.1"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
58
|
-
"solid-js": "
|
|
59
|
-
"@tanstack/solid-query": "^
|
|
62
|
+
"solid-js": ">=2.0.0-beta.0 <3.0.0",
|
|
63
|
+
"@tanstack/solid-query": "^6.0.0-alpha.1"
|
|
60
64
|
},
|
|
61
65
|
"scripts": {
|
|
62
66
|
"clean": "premove ./build ./coverage ./dist-ts",
|
package/src/clientOnly.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMemo,
|
|
3
3
|
createSignal,
|
|
4
|
-
|
|
4
|
+
omit,
|
|
5
|
+
onSettled,
|
|
5
6
|
sharedConfig,
|
|
6
|
-
splitProps,
|
|
7
7
|
untrack,
|
|
8
8
|
} from 'solid-js'
|
|
9
|
-
import { isServer } from '
|
|
9
|
+
import { isServer } from '@solidjs/web'
|
|
10
10
|
import type { Component, ComponentProps, JSX } from 'solid-js'
|
|
11
11
|
|
|
12
12
|
/*
|
|
@@ -28,10 +28,12 @@ export default function clientOnly<T extends Component<any>>(
|
|
|
28
28
|
return (props: ComponentProps<T>) => {
|
|
29
29
|
let Comp: T | undefined
|
|
30
30
|
let m: boolean
|
|
31
|
-
const
|
|
32
|
-
if ((Comp = comp()) && !sharedConfig.
|
|
33
|
-
const [mounted, setMounted] = createSignal(!sharedConfig.
|
|
34
|
-
|
|
31
|
+
const rest = omit(props, 'fallback')
|
|
32
|
+
if ((Comp = comp()) && !sharedConfig.hydrating) return Comp(rest)
|
|
33
|
+
const [mounted, setMounted] = createSignal(!sharedConfig.hydrating)
|
|
34
|
+
onSettled(() => {
|
|
35
|
+
setMounted(true)
|
|
36
|
+
})
|
|
35
37
|
return createMemo(
|
|
36
38
|
() => (
|
|
37
39
|
(Comp = comp()),
|
package/src/devtools.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup
|
|
1
|
+
import { createEffect, createMemo, onCleanup } from 'solid-js'
|
|
2
2
|
import { onlineManager, useQueryClient } from '@tanstack/solid-query'
|
|
3
3
|
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
|
|
4
4
|
import type {
|
|
@@ -72,39 +72,66 @@ export default function SolidQueryDevtools(props: DevtoolsOptions) {
|
|
|
72
72
|
theme: props.theme,
|
|
73
73
|
})
|
|
74
74
|
|
|
75
|
-
createEffect(
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
createEffect(
|
|
76
|
+
() => client(),
|
|
77
|
+
(c) => {
|
|
78
|
+
devtools.setClient(c)
|
|
79
|
+
},
|
|
80
|
+
)
|
|
78
81
|
|
|
79
|
-
createEffect(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
createEffect(
|
|
83
|
+
() => props.buttonPosition,
|
|
84
|
+
(buttonPos) => {
|
|
85
|
+
if (buttonPos) {
|
|
86
|
+
devtools.setButtonPosition(buttonPos)
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
)
|
|
85
90
|
|
|
86
|
-
createEffect(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
createEffect(
|
|
92
|
+
() => props.position,
|
|
93
|
+
(pos) => {
|
|
94
|
+
if (pos) {
|
|
95
|
+
devtools.setPosition(pos)
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
)
|
|
92
99
|
|
|
93
|
-
createEffect(
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
createEffect(
|
|
101
|
+
() => props.initialIsOpen,
|
|
102
|
+
(initialIsOpen) => {
|
|
103
|
+
devtools.setInitialIsOpen(initialIsOpen || false)
|
|
104
|
+
},
|
|
105
|
+
)
|
|
96
106
|
|
|
97
|
-
createEffect(
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
createEffect(
|
|
108
|
+
() => props.errorTypes,
|
|
109
|
+
(errorTypes) => {
|
|
110
|
+
devtools.setErrorTypes(errorTypes || [])
|
|
111
|
+
},
|
|
112
|
+
)
|
|
100
113
|
|
|
101
|
-
createEffect(
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
createEffect(
|
|
115
|
+
() => props.theme,
|
|
116
|
+
(theme) => {
|
|
117
|
+
devtools.setTheme(theme || 'system')
|
|
118
|
+
},
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
let isMounted = false
|
|
122
|
+
let isDisposed = false
|
|
104
123
|
|
|
105
|
-
|
|
124
|
+
queueMicrotask(() => {
|
|
125
|
+
if (isDisposed) return
|
|
106
126
|
devtools.mount(ref)
|
|
107
|
-
|
|
127
|
+
isMounted = true
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
onCleanup(() => {
|
|
131
|
+
isDisposed = true
|
|
132
|
+
if (isMounted) {
|
|
133
|
+
devtools.unmount()
|
|
134
|
+
}
|
|
108
135
|
})
|
|
109
136
|
|
|
110
137
|
return <div class="tsqd-parent-container" ref={ref}></div>
|
package/src/devtoolsPanel.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createEffect, createMemo, onCleanup
|
|
1
|
+
import { createEffect, createMemo, onCleanup } 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'
|
|
@@ -66,24 +66,47 @@ export default function SolidQueryDevtoolsPanel(props: DevtoolsPanelOptions) {
|
|
|
66
66
|
hideDisabledQueries,
|
|
67
67
|
theme: props.theme,
|
|
68
68
|
})
|
|
69
|
-
createEffect(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
createEffect(
|
|
70
|
+
() => client(),
|
|
71
|
+
(c) => {
|
|
72
|
+
devtools.setClient(c)
|
|
73
|
+
},
|
|
74
|
+
)
|
|
75
|
+
createEffect(
|
|
76
|
+
() => props.onClose,
|
|
77
|
+
(onClose) => {
|
|
78
|
+
devtools.setOnClose(onClose ?? (() => {}))
|
|
79
|
+
},
|
|
80
|
+
)
|
|
75
81
|
|
|
76
|
-
createEffect(
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
createEffect(
|
|
83
|
+
() => props.errorTypes,
|
|
84
|
+
(errorTypes2) => {
|
|
85
|
+
devtools.setErrorTypes(errorTypes2 || [])
|
|
86
|
+
},
|
|
87
|
+
)
|
|
79
88
|
|
|
80
|
-
createEffect(
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
createEffect(
|
|
90
|
+
() => props.theme,
|
|
91
|
+
(theme) => {
|
|
92
|
+
devtools.setTheme(theme || 'system')
|
|
93
|
+
},
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
let isMounted = false
|
|
97
|
+
let isDisposed = false
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
queueMicrotask(() => {
|
|
100
|
+
if (isDisposed) return
|
|
85
101
|
devtools.mount(ref)
|
|
86
|
-
|
|
102
|
+
isMounted = true
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
onCleanup(() => {
|
|
106
|
+
isDisposed = true
|
|
107
|
+
if (isMounted) {
|
|
108
|
+
devtools.unmount()
|
|
109
|
+
}
|
|
87
110
|
})
|
|
88
111
|
|
|
89
112
|
return (
|
package/src/index.tsx
CHANGED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// src/devtools.tsx
|
|
2
|
-
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
|
|
3
|
-
import { onlineManager, useQueryClient } from "@tanstack/solid-query";
|
|
4
|
-
import { TanstackQueryDevtools } from "@tanstack/query-devtools";
|
|
5
|
-
function SolidQueryDevtools(props) {
|
|
6
|
-
const queryClient = useQueryClient(props.client);
|
|
7
|
-
const client = createMemo(() => queryClient);
|
|
8
|
-
let ref;
|
|
9
|
-
const devtools = new TanstackQueryDevtools({
|
|
10
|
-
client: client(),
|
|
11
|
-
queryFlavor: "Solid Query",
|
|
12
|
-
version: "5",
|
|
13
|
-
onlineManager,
|
|
14
|
-
buttonPosition: props.buttonPosition,
|
|
15
|
-
position: props.position,
|
|
16
|
-
initialIsOpen: props.initialIsOpen,
|
|
17
|
-
errorTypes: props.errorTypes,
|
|
18
|
-
styleNonce: props.styleNonce,
|
|
19
|
-
shadowDOMTarget: props.shadowDOMTarget,
|
|
20
|
-
hideDisabledQueries: props.hideDisabledQueries,
|
|
21
|
-
theme: props.theme
|
|
22
|
-
});
|
|
23
|
-
createEffect(() => {
|
|
24
|
-
devtools.setClient(client());
|
|
25
|
-
});
|
|
26
|
-
createEffect(() => {
|
|
27
|
-
const buttonPos = props.buttonPosition;
|
|
28
|
-
if (buttonPos) {
|
|
29
|
-
devtools.setButtonPosition(buttonPos);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
createEffect(() => {
|
|
33
|
-
const pos = props.position;
|
|
34
|
-
if (pos) {
|
|
35
|
-
devtools.setPosition(pos);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
createEffect(() => {
|
|
39
|
-
devtools.setInitialIsOpen(props.initialIsOpen || false);
|
|
40
|
-
});
|
|
41
|
-
createEffect(() => {
|
|
42
|
-
devtools.setErrorTypes(props.errorTypes || []);
|
|
43
|
-
});
|
|
44
|
-
createEffect(() => {
|
|
45
|
-
devtools.setTheme(props.theme || "system");
|
|
46
|
-
});
|
|
47
|
-
onMount(() => {
|
|
48
|
-
devtools.mount(ref);
|
|
49
|
-
onCleanup(() => devtools.unmount());
|
|
50
|
-
});
|
|
51
|
-
return <div class="tsqd-parent-container" ref={ref} />;
|
|
52
|
-
}
|
|
53
|
-
export {
|
|
54
|
-
SolidQueryDevtools as default
|
|
55
|
-
};
|