@tanstack/query-devtools 5.0.0-rc.9 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Devtools/{5OOWR6BQ.jsx → 3BAJISSX.jsx} +604 -266
- package/build/Devtools/{CIR3WCBJ.js → 4TNE5QTO.js} +733 -428
- package/build/Devtools/{336SHOD5.jsx → OWSLDUSP.jsx} +604 -266
- package/build/Devtools/{XXDYGLB2.js → YSRICXZI.js} +733 -428
- package/build/dev.cjs +781 -464
- package/build/dev.js +42 -32
- package/build/dev.jsx +42 -32
- package/build/index.cjs +781 -464
- package/build/index.d.cts +1 -14
- package/build/index.d.ts +1 -14
- package/build/index.js +42 -32
- package/build/index.jsx +42 -32
- package/package.json +2 -2
- package/src/Context.ts +9 -0
- package/src/Devtools.tsx +422 -206
- package/src/Explorer.tsx +140 -61
- package/src/icons/index.tsx +118 -19
- package/src/index.tsx +41 -41
- package/src/utils.tsx +17 -0
package/build/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
|
|
2
|
-
import { Component, Signal } from 'solid-js';
|
|
3
2
|
|
|
4
3
|
type XPosition = 'left' | 'right';
|
|
5
4
|
type YPosition = 'top' | 'bottom';
|
|
@@ -26,22 +25,10 @@ interface QueryDevtoolsProps {
|
|
|
26
25
|
errorTypes?: Array<DevToolsErrorType>;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
|
|
30
|
-
|
|
31
28
|
interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
|
|
32
29
|
}
|
|
33
30
|
declare class TanstackQueryDevtools {
|
|
34
|
-
|
|
35
|
-
onlineManager: typeof onlineManager;
|
|
36
|
-
queryFlavor: string;
|
|
37
|
-
version: string;
|
|
38
|
-
isMounted: boolean;
|
|
39
|
-
buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
|
|
40
|
-
position: Signal<DevtoolsPosition | undefined>;
|
|
41
|
-
initialIsOpen: Signal<boolean | undefined>;
|
|
42
|
-
errorTypes: Signal<Array<DevToolsErrorType> | undefined>;
|
|
43
|
-
Component: typeof DevtoolsComponent | undefined;
|
|
44
|
-
dispose?: () => void;
|
|
31
|
+
#private;
|
|
45
32
|
constructor(config: TanstackQueryDevtoolsConfig);
|
|
46
33
|
setButtonPosition(position: DevtoolsButtonPosition): void;
|
|
47
34
|
setPosition(position: DevtoolsPosition): void;
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
|
|
2
|
-
import { Component, Signal } from 'solid-js';
|
|
3
2
|
|
|
4
3
|
type XPosition = 'left' | 'right';
|
|
5
4
|
type YPosition = 'top' | 'bottom';
|
|
@@ -26,22 +25,10 @@ interface QueryDevtoolsProps {
|
|
|
26
25
|
errorTypes?: Array<DevToolsErrorType>;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
|
|
30
|
-
|
|
31
28
|
interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
|
|
32
29
|
}
|
|
33
30
|
declare class TanstackQueryDevtools {
|
|
34
|
-
|
|
35
|
-
onlineManager: typeof onlineManager;
|
|
36
|
-
queryFlavor: string;
|
|
37
|
-
version: string;
|
|
38
|
-
isMounted: boolean;
|
|
39
|
-
buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
|
|
40
|
-
position: Signal<DevtoolsPosition | undefined>;
|
|
41
|
-
initialIsOpen: Signal<boolean | undefined>;
|
|
42
|
-
errorTypes: Signal<Array<DevToolsErrorType> | undefined>;
|
|
43
|
-
Component: typeof DevtoolsComponent | undefined;
|
|
44
|
-
dispose?: () => void;
|
|
31
|
+
#private;
|
|
45
32
|
constructor(config: TanstackQueryDevtoolsConfig);
|
|
46
33
|
setButtonPosition(position: DevtoolsButtonPosition): void;
|
|
47
34
|
setPosition(position: DevtoolsPosition): void;
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,17 @@ import { createSignal, render, lazy, createComponent, mergeProps } from './chunk
|
|
|
2
2
|
|
|
3
3
|
// src/index.tsx
|
|
4
4
|
var TanstackQueryDevtools = class {
|
|
5
|
-
|
|
5
|
+
#client;
|
|
6
|
+
#onlineManager;
|
|
7
|
+
#queryFlavor;
|
|
8
|
+
#version;
|
|
9
|
+
#isMounted = false;
|
|
10
|
+
#buttonPosition;
|
|
11
|
+
#position;
|
|
12
|
+
#initialIsOpen;
|
|
13
|
+
#errorTypes;
|
|
14
|
+
#Component;
|
|
15
|
+
#dispose;
|
|
6
16
|
constructor(config) {
|
|
7
17
|
const {
|
|
8
18
|
client,
|
|
@@ -14,57 +24,57 @@ var TanstackQueryDevtools = class {
|
|
|
14
24
|
initialIsOpen,
|
|
15
25
|
errorTypes
|
|
16
26
|
} = config;
|
|
17
|
-
this
|
|
18
|
-
this
|
|
19
|
-
this
|
|
20
|
-
this
|
|
21
|
-
this
|
|
22
|
-
this
|
|
23
|
-
this
|
|
24
|
-
this
|
|
27
|
+
this.#client = createSignal(client);
|
|
28
|
+
this.#queryFlavor = queryFlavor;
|
|
29
|
+
this.#version = version;
|
|
30
|
+
this.#onlineManager = onlineManager;
|
|
31
|
+
this.#buttonPosition = createSignal(buttonPosition);
|
|
32
|
+
this.#position = createSignal(position);
|
|
33
|
+
this.#initialIsOpen = createSignal(initialIsOpen);
|
|
34
|
+
this.#errorTypes = createSignal(errorTypes);
|
|
25
35
|
}
|
|
26
36
|
setButtonPosition(position) {
|
|
27
|
-
this
|
|
37
|
+
this.#buttonPosition[1](position);
|
|
28
38
|
}
|
|
29
39
|
setPosition(position) {
|
|
30
|
-
this
|
|
40
|
+
this.#position[1](position);
|
|
31
41
|
}
|
|
32
42
|
setInitialIsOpen(isOpen) {
|
|
33
|
-
this
|
|
43
|
+
this.#initialIsOpen[1](isOpen);
|
|
34
44
|
}
|
|
35
45
|
setErrorTypes(errorTypes) {
|
|
36
|
-
this
|
|
46
|
+
this.#errorTypes[1](errorTypes);
|
|
37
47
|
}
|
|
38
48
|
setClient(client) {
|
|
39
|
-
this
|
|
49
|
+
this.#client[1](client);
|
|
40
50
|
}
|
|
41
51
|
mount(el) {
|
|
42
|
-
if (this
|
|
52
|
+
if (this.#isMounted) {
|
|
43
53
|
throw new Error("Devtools is already mounted");
|
|
44
54
|
}
|
|
45
55
|
const dispose = render(() => {
|
|
46
|
-
const [btnPosition] = this
|
|
47
|
-
const [pos] = this
|
|
48
|
-
const [isOpen] = this
|
|
49
|
-
const [errors] = this
|
|
50
|
-
const [queryClient] = this
|
|
56
|
+
const [btnPosition] = this.#buttonPosition;
|
|
57
|
+
const [pos] = this.#position;
|
|
58
|
+
const [isOpen] = this.#initialIsOpen;
|
|
59
|
+
const [errors] = this.#errorTypes;
|
|
60
|
+
const [queryClient] = this.#client;
|
|
51
61
|
let Devtools;
|
|
52
|
-
if (this
|
|
53
|
-
Devtools = this
|
|
62
|
+
if (this.#Component) {
|
|
63
|
+
Devtools = this.#Component;
|
|
54
64
|
} else {
|
|
55
|
-
Devtools = lazy(() => import('./Devtools/
|
|
56
|
-
this
|
|
65
|
+
Devtools = lazy(() => import('./Devtools/4TNE5QTO.js'));
|
|
66
|
+
this.#Component = Devtools;
|
|
57
67
|
}
|
|
58
68
|
const _self$ = this;
|
|
59
69
|
return createComponent(Devtools, mergeProps({
|
|
60
70
|
get queryFlavor() {
|
|
61
|
-
return _self
|
|
71
|
+
return _self$.#queryFlavor;
|
|
62
72
|
},
|
|
63
73
|
get version() {
|
|
64
|
-
return _self
|
|
74
|
+
return _self$.#version;
|
|
65
75
|
},
|
|
66
76
|
get onlineManager() {
|
|
67
|
-
return _self
|
|
77
|
+
return _self$.#onlineManager;
|
|
68
78
|
}
|
|
69
79
|
}, {
|
|
70
80
|
get client() {
|
|
@@ -84,15 +94,15 @@ var TanstackQueryDevtools = class {
|
|
|
84
94
|
}
|
|
85
95
|
}));
|
|
86
96
|
}, el);
|
|
87
|
-
this
|
|
88
|
-
this
|
|
97
|
+
this.#isMounted = true;
|
|
98
|
+
this.#dispose = dispose;
|
|
89
99
|
}
|
|
90
100
|
unmount() {
|
|
91
|
-
if (!this
|
|
101
|
+
if (!this.#isMounted) {
|
|
92
102
|
throw new Error("Devtools is not mounted");
|
|
93
103
|
}
|
|
94
|
-
this
|
|
95
|
-
this
|
|
104
|
+
this.#dispose?.();
|
|
105
|
+
this.#isMounted = false;
|
|
96
106
|
}
|
|
97
107
|
};
|
|
98
108
|
|
package/build/index.jsx
CHANGED
|
@@ -6,8 +6,18 @@ import {
|
|
|
6
6
|
|
|
7
7
|
// src/index.tsx
|
|
8
8
|
var TanstackQueryDevtools = class {
|
|
9
|
+
#client;
|
|
10
|
+
#onlineManager;
|
|
11
|
+
#queryFlavor;
|
|
12
|
+
#version;
|
|
13
|
+
#isMounted = false;
|
|
14
|
+
#buttonPosition;
|
|
15
|
+
#position;
|
|
16
|
+
#initialIsOpen;
|
|
17
|
+
#errorTypes;
|
|
18
|
+
#Component;
|
|
19
|
+
#dispose;
|
|
9
20
|
constructor(config) {
|
|
10
|
-
this.isMounted = false;
|
|
11
21
|
const {
|
|
12
22
|
client,
|
|
13
23
|
queryFlavor,
|
|
@@ -18,51 +28,51 @@ var TanstackQueryDevtools = class {
|
|
|
18
28
|
initialIsOpen,
|
|
19
29
|
errorTypes
|
|
20
30
|
} = config;
|
|
21
|
-
this
|
|
22
|
-
this
|
|
23
|
-
this
|
|
24
|
-
this
|
|
25
|
-
this
|
|
26
|
-
this
|
|
27
|
-
this
|
|
28
|
-
this
|
|
31
|
+
this.#client = createSignal(client);
|
|
32
|
+
this.#queryFlavor = queryFlavor;
|
|
33
|
+
this.#version = version;
|
|
34
|
+
this.#onlineManager = onlineManager;
|
|
35
|
+
this.#buttonPosition = createSignal(buttonPosition);
|
|
36
|
+
this.#position = createSignal(position);
|
|
37
|
+
this.#initialIsOpen = createSignal(initialIsOpen);
|
|
38
|
+
this.#errorTypes = createSignal(errorTypes);
|
|
29
39
|
}
|
|
30
40
|
setButtonPosition(position) {
|
|
31
|
-
this
|
|
41
|
+
this.#buttonPosition[1](position);
|
|
32
42
|
}
|
|
33
43
|
setPosition(position) {
|
|
34
|
-
this
|
|
44
|
+
this.#position[1](position);
|
|
35
45
|
}
|
|
36
46
|
setInitialIsOpen(isOpen) {
|
|
37
|
-
this
|
|
47
|
+
this.#initialIsOpen[1](isOpen);
|
|
38
48
|
}
|
|
39
49
|
setErrorTypes(errorTypes) {
|
|
40
|
-
this
|
|
50
|
+
this.#errorTypes[1](errorTypes);
|
|
41
51
|
}
|
|
42
52
|
setClient(client) {
|
|
43
|
-
this
|
|
53
|
+
this.#client[1](client);
|
|
44
54
|
}
|
|
45
55
|
mount(el) {
|
|
46
|
-
if (this
|
|
56
|
+
if (this.#isMounted) {
|
|
47
57
|
throw new Error("Devtools is already mounted");
|
|
48
58
|
}
|
|
49
59
|
const dispose = render(() => {
|
|
50
|
-
const [btnPosition] = this
|
|
51
|
-
const [pos] = this
|
|
52
|
-
const [isOpen] = this
|
|
53
|
-
const [errors] = this
|
|
54
|
-
const [queryClient] = this
|
|
60
|
+
const [btnPosition] = this.#buttonPosition;
|
|
61
|
+
const [pos] = this.#position;
|
|
62
|
+
const [isOpen] = this.#initialIsOpen;
|
|
63
|
+
const [errors] = this.#errorTypes;
|
|
64
|
+
const [queryClient] = this.#client;
|
|
55
65
|
let Devtools;
|
|
56
|
-
if (this
|
|
57
|
-
Devtools = this
|
|
66
|
+
if (this.#Component) {
|
|
67
|
+
Devtools = this.#Component;
|
|
58
68
|
} else {
|
|
59
|
-
Devtools = lazy(() => import("./Devtools/
|
|
60
|
-
this
|
|
69
|
+
Devtools = lazy(() => import("./Devtools/3BAJISSX.jsx"));
|
|
70
|
+
this.#Component = Devtools;
|
|
61
71
|
}
|
|
62
72
|
return <Devtools
|
|
63
|
-
queryFlavor={this
|
|
64
|
-
version={this
|
|
65
|
-
onlineManager={this
|
|
73
|
+
queryFlavor={this.#queryFlavor}
|
|
74
|
+
version={this.#version}
|
|
75
|
+
onlineManager={this.#onlineManager}
|
|
66
76
|
{...{
|
|
67
77
|
get client() {
|
|
68
78
|
return queryClient();
|
|
@@ -82,15 +92,15 @@ var TanstackQueryDevtools = class {
|
|
|
82
92
|
}}
|
|
83
93
|
/>;
|
|
84
94
|
}, el);
|
|
85
|
-
this
|
|
86
|
-
this
|
|
95
|
+
this.#isMounted = true;
|
|
96
|
+
this.#dispose = dispose;
|
|
87
97
|
}
|
|
88
98
|
unmount() {
|
|
89
|
-
if (!this
|
|
99
|
+
if (!this.#isMounted) {
|
|
90
100
|
throw new Error("Devtools is not mounted");
|
|
91
101
|
}
|
|
92
|
-
this
|
|
93
|
-
this
|
|
102
|
+
this.#dispose?.();
|
|
103
|
+
this.#isMounted = false;
|
|
94
104
|
}
|
|
95
105
|
};
|
|
96
106
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/query-devtools",
|
|
3
|
-
"version": "5.0.0
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack Query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"superjson": "^1.12.4",
|
|
51
51
|
"tsup-preset-solid": "^2.0.1",
|
|
52
52
|
"vite-plugin-solid": "^2.7.0",
|
|
53
|
-
"@tanstack/query-core": "5.0.0
|
|
53
|
+
"@tanstack/query-core": "5.0.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"clean": "rimraf ./build && rimraf ./coverage",
|
package/src/Context.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from 'solid-js'
|
|
2
|
+
import type { Accessor } from 'solid-js'
|
|
2
3
|
import type { Query, QueryClient, onlineManager } from '@tanstack/query-core'
|
|
3
4
|
|
|
4
5
|
type XPosition = 'left' | 'right'
|
|
@@ -39,3 +40,11 @@ export const QueryDevtoolsContext = createContext<QueryDevtoolsProps>({
|
|
|
39
40
|
export function useQueryDevtoolsContext() {
|
|
40
41
|
return useContext(QueryDevtoolsContext)
|
|
41
42
|
}
|
|
43
|
+
|
|
44
|
+
export const ThemeContext = createContext<Accessor<'light' | 'dark'>>(
|
|
45
|
+
() => 'dark' as const,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
export function useTheme() {
|
|
49
|
+
return useContext(ThemeContext)
|
|
50
|
+
}
|