@tanstack/react-query-devtools 4.27.0 → 4.29.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/lib/Explorer.esm.js +1 -0
- package/build/lib/Explorer.esm.js.map +1 -1
- package/build/lib/Explorer.js +1 -0
- package/build/lib/Explorer.js.map +1 -1
- package/build/lib/Explorer.mjs +1 -0
- package/build/lib/Explorer.mjs.map +1 -1
- package/build/lib/devtools.esm.js +12 -1
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +12 -1
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +12 -1
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.esm.js +1 -0
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +1 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +1 -0
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/index.prod.esm.js +11 -1
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +11 -1
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +11 -1
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/lib/theme.esm.js +1 -0
- package/build/lib/theme.esm.js.map +1 -1
- package/build/lib/theme.js +1 -0
- package/build/lib/theme.js.map +1 -1
- package/build/lib/theme.mjs +1 -0
- package/build/lib/theme.mjs.map +1 -1
- package/build/umd/index.development.js +11 -1
- package/build/umd/index.development.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/devtools.test.tsx +37 -0
- package/src/devtools.tsx +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query-devtools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.29.0",
|
|
4
4
|
"description": "Developer tools to interact with and visualize the TanStack/react-query cache",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-dom": "^18.2.0",
|
|
47
47
|
"react-dom-17": "npm:react-dom@^17.0.2",
|
|
48
48
|
"react-error-boundary": "^3.1.4",
|
|
49
|
-
"@tanstack/react-query": "4.
|
|
49
|
+
"@tanstack/react-query": "4.28.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@tanstack/match-sorter-utils": "^8.7.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
58
58
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
59
|
-
"@tanstack/react-query": "4.
|
|
59
|
+
"@tanstack/react-query": "4.28.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"clean": "rimraf ./build",
|
|
@@ -661,6 +661,43 @@ describe('ReactQueryDevtools', () => {
|
|
|
661
661
|
expect(filterInput.value).toEqual('posts')
|
|
662
662
|
})
|
|
663
663
|
|
|
664
|
+
it('should not show queries after clear', async () => {
|
|
665
|
+
const { queryClient, queryCache } = createQueryClient()
|
|
666
|
+
|
|
667
|
+
function Page() {
|
|
668
|
+
const query1Result = useQuery(['query-1'], async () => {
|
|
669
|
+
return 'query-1-result'
|
|
670
|
+
})
|
|
671
|
+
const query2Result = useQuery(['query-2'], async () => {
|
|
672
|
+
return 'query-2-result'
|
|
673
|
+
})
|
|
674
|
+
const query3Result = useQuery(['query-3'], async () => {
|
|
675
|
+
return 'query-3-result'
|
|
676
|
+
})
|
|
677
|
+
|
|
678
|
+
return (
|
|
679
|
+
<div>
|
|
680
|
+
<h1>
|
|
681
|
+
{query1Result.data} {query2Result.data} {query3Result.data}{' '}
|
|
682
|
+
</h1>
|
|
683
|
+
</div>
|
|
684
|
+
)
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
renderWithClient(queryClient, <Page />)
|
|
688
|
+
|
|
689
|
+
fireEvent.click(
|
|
690
|
+
screen.getByRole('button', { name: /open react query devtools/i }),
|
|
691
|
+
)
|
|
692
|
+
|
|
693
|
+
expect(queryCache.getAll()).toHaveLength(3)
|
|
694
|
+
|
|
695
|
+
const clearButton = screen.getByLabelText(/clear/i)
|
|
696
|
+
fireEvent.click(clearButton)
|
|
697
|
+
|
|
698
|
+
expect(queryCache.getAll()).toHaveLength(0)
|
|
699
|
+
})
|
|
700
|
+
|
|
664
701
|
it('style should have a nonce', async () => {
|
|
665
702
|
const { queryClient } = createQueryClient()
|
|
666
703
|
|
package/src/devtools.tsx
CHANGED
|
@@ -597,6 +597,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef<
|
|
|
597
597
|
<Logo aria-hidden />
|
|
598
598
|
<ScreenReader text="Close React Query Devtools" />
|
|
599
599
|
</button>
|
|
600
|
+
|
|
600
601
|
<div
|
|
601
602
|
style={{
|
|
602
603
|
display: 'flex',
|
|
@@ -673,6 +674,18 @@ export const ReactQueryDevtoolsPanel = React.forwardRef<
|
|
|
673
674
|
>
|
|
674
675
|
{baseSort === 1 ? '⬆ Asc' : '⬇ Desc'}
|
|
675
676
|
</Button>
|
|
677
|
+
<Button
|
|
678
|
+
title="Clear cache"
|
|
679
|
+
aria-label="Clear cache"
|
|
680
|
+
type="button"
|
|
681
|
+
onClick={() => queryCache.clear()}
|
|
682
|
+
style={{
|
|
683
|
+
padding: '.3em .4em',
|
|
684
|
+
marginRight: '.5em',
|
|
685
|
+
}}
|
|
686
|
+
>
|
|
687
|
+
Clear
|
|
688
|
+
</Button>
|
|
676
689
|
<Button
|
|
677
690
|
type="button"
|
|
678
691
|
onClick={() => {
|
|
@@ -1330,5 +1343,7 @@ const QueryRow = React.memo(
|
|
|
1330
1343
|
},
|
|
1331
1344
|
)
|
|
1332
1345
|
|
|
1346
|
+
QueryRow.displayName = 'QueryRow'
|
|
1347
|
+
|
|
1333
1348
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1334
1349
|
function noop() {}
|