@tanstack/react-query-devtools 5.9.0 → 5.12.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/legacy/{devtools-5fd5b190.d.ts → devtools-ZdlRR-0P.d.ts} +2 -5
- package/build/legacy/devtools.d.cts +1 -1
- package/build/legacy/devtools.d.ts +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/production.d.cts +1 -1
- package/build/legacy/production.d.ts +1 -1
- package/build/modern/{devtools-5fd5b190.d.ts → devtools-ZdlRR-0P.d.ts} +2 -5
- package/build/modern/devtools.d.cts +1 -1
- package/build/modern/devtools.d.ts +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/production.d.cts +1 -1
- package/build/modern/production.d.ts +1 -1
- package/package.json +4 -8
- package/src/__tests__/utils.tsx +0 -85
|
@@ -37,10 +37,7 @@ declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement
|
|
|
37
37
|
type devtools_DevtoolsOptions = DevtoolsOptions;
|
|
38
38
|
declare const devtools_ReactQueryDevtools: typeof ReactQueryDevtools;
|
|
39
39
|
declare namespace devtools {
|
|
40
|
-
export {
|
|
41
|
-
devtools_DevtoolsOptions as DevtoolsOptions,
|
|
42
|
-
devtools_ReactQueryDevtools as ReactQueryDevtools,
|
|
43
|
-
};
|
|
40
|
+
export { type devtools_DevtoolsOptions as DevtoolsOptions, devtools_ReactQueryDevtools as ReactQueryDevtools };
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
export { DevtoolsOptions as D, ReactQueryDevtools as R, devtools as d };
|
|
43
|
+
export { type DevtoolsOptions as D, ReactQueryDevtools as R, devtools as d };
|
package/build/legacy/index.d.cts
CHANGED
package/build/legacy/index.d.ts
CHANGED
|
@@ -37,10 +37,7 @@ declare function ReactQueryDevtools(props: DevtoolsOptions): React.ReactElement
|
|
|
37
37
|
type devtools_DevtoolsOptions = DevtoolsOptions;
|
|
38
38
|
declare const devtools_ReactQueryDevtools: typeof ReactQueryDevtools;
|
|
39
39
|
declare namespace devtools {
|
|
40
|
-
export {
|
|
41
|
-
devtools_DevtoolsOptions as DevtoolsOptions,
|
|
42
|
-
devtools_ReactQueryDevtools as ReactQueryDevtools,
|
|
43
|
-
};
|
|
40
|
+
export { type devtools_DevtoolsOptions as DevtoolsOptions, devtools_ReactQueryDevtools as ReactQueryDevtools };
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
export { DevtoolsOptions as D, ReactQueryDevtools as R, devtools as d };
|
|
43
|
+
export { type DevtoolsOptions as D, ReactQueryDevtools as R, devtools as d };
|
package/build/modern/index.d.cts
CHANGED
package/build/modern/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query-devtools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/react-query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,20 +57,16 @@
|
|
|
57
57
|
"src"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@tanstack/query-devtools": "5.
|
|
60
|
+
"@tanstack/query-devtools": "5.12.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/react": "^18.2.31",
|
|
64
|
-
"@types/react-dom": "^18.2.14",
|
|
65
64
|
"react": "^18.2.0",
|
|
66
|
-
"react-
|
|
67
|
-
"react-error-boundary": "^3.1.4",
|
|
68
|
-
"@tanstack/react-query": "5.9.0"
|
|
65
|
+
"@tanstack/react-query": "5.12.0"
|
|
69
66
|
},
|
|
70
67
|
"peerDependencies": {
|
|
71
68
|
"react": "^18.0.0",
|
|
72
|
-
"react-
|
|
73
|
-
"@tanstack/react-query": "^5.9.0"
|
|
69
|
+
"@tanstack/react-query": "^5.12.0"
|
|
74
70
|
},
|
|
75
71
|
"scripts": {
|
|
76
72
|
"clean": "rimraf ./build && rimraf ./coverage",
|
package/src/__tests__/utils.tsx
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { render } from '@testing-library/react'
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import {
|
|
4
|
-
QueryCache,
|
|
5
|
-
QueryClient,
|
|
6
|
-
QueryClientProvider,
|
|
7
|
-
} from '@tanstack/react-query'
|
|
8
|
-
import { ReactQueryDevtools } from '../devtools'
|
|
9
|
-
import type { RenderOptions } from '@testing-library/react'
|
|
10
|
-
|
|
11
|
-
export function renderWithClient(
|
|
12
|
-
client: QueryClient,
|
|
13
|
-
ui: React.ReactElement,
|
|
14
|
-
devtoolsOptions: Parameters<typeof ReactQueryDevtools>[number] = {},
|
|
15
|
-
renderOptions?: RenderOptions,
|
|
16
|
-
): ReturnType<typeof render> {
|
|
17
|
-
const { rerender, ...result } = render(
|
|
18
|
-
<QueryClientProvider client={client}>
|
|
19
|
-
<ReactQueryDevtools {...devtoolsOptions} />
|
|
20
|
-
{ui}
|
|
21
|
-
</QueryClientProvider>,
|
|
22
|
-
renderOptions,
|
|
23
|
-
)
|
|
24
|
-
return {
|
|
25
|
-
...result,
|
|
26
|
-
rerender: (rerenderUi: React.ReactElement) =>
|
|
27
|
-
rerender(
|
|
28
|
-
<QueryClientProvider client={client}>
|
|
29
|
-
<ReactQueryDevtools {...devtoolsOptions} />
|
|
30
|
-
{rerenderUi}
|
|
31
|
-
</QueryClientProvider>,
|
|
32
|
-
),
|
|
33
|
-
} as any
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function sleep(timeout: number): Promise<void> {
|
|
37
|
-
return new Promise((resolve) => {
|
|
38
|
-
setTimeout(resolve, timeout)
|
|
39
|
-
})
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* This method is useful for matching by text content when the text is splitted
|
|
44
|
-
* across different HTML elements which cannot be searched by normal
|
|
45
|
-
* *ByText methods. It returns a function that can be passed to the testing
|
|
46
|
-
* library's *ByText methods.
|
|
47
|
-
* @param textToMatch The string that needs to be matched
|
|
48
|
-
* @reference https://stackoverflow.com/a/56859650/8252081
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
type MatcherFunction = (content: string, element: Element | null) => boolean
|
|
52
|
-
|
|
53
|
-
export const getByTextContent =
|
|
54
|
-
(textToMatch: string): MatcherFunction =>
|
|
55
|
-
(_content, node) => {
|
|
56
|
-
if (!node) {
|
|
57
|
-
return false
|
|
58
|
-
}
|
|
59
|
-
const hasText = (currentNode: Element) =>
|
|
60
|
-
currentNode.textContent === textToMatch
|
|
61
|
-
const nodeHasText = hasText(node)
|
|
62
|
-
const childrenDontHaveText = Array.from(node.children).every(
|
|
63
|
-
(child) => !hasText(child as HTMLElement),
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
return nodeHasText && childrenDontHaveText
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
interface CreateQueryClientResponse {
|
|
70
|
-
queryClient: QueryClient
|
|
71
|
-
queryCache: QueryCache
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const createQueryClient = (): CreateQueryClientResponse => {
|
|
75
|
-
const queryCache = new QueryCache()
|
|
76
|
-
const queryClient = new QueryClient({
|
|
77
|
-
queryCache,
|
|
78
|
-
defaultOptions: {
|
|
79
|
-
queries: {
|
|
80
|
-
staleTime: 0,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
})
|
|
84
|
-
return { queryClient, queryCache }
|
|
85
|
-
}
|