@tanstack/react-query-devtools 4.9.0 → 4.10.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/lib/index.prod.esm.js +5 -3
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +8 -3
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +5 -3
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/lib/utils.esm.js +5 -3
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +8 -3
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +5 -3
- package/build/lib/utils.mjs.map +1 -1
- package/build/umd/index.development.js +951 -3
- package/build/umd/index.development.js.map +1 -1
- package/package.json +4 -3
- package/src/__tests__/Explorer.test.tsx +14 -2
- package/src/utils.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-query-devtools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.1",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,16 +40,17 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/use-sync-external-store": "^0.0.3",
|
|
42
42
|
"react-error-boundary": "^3.1.4",
|
|
43
|
-
"@tanstack/react-query": "4.
|
|
43
|
+
"@tanstack/react-query": "4.10.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@tanstack/match-sorter-utils": "^8.1.1",
|
|
47
|
+
"superjson": "^1.10.0",
|
|
47
48
|
"use-sync-external-store": "^1.2.0"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
51
52
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
52
|
-
"@tanstack/react-query": "4.
|
|
53
|
+
"@tanstack/react-query": "4.10.1"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
56
|
"clean": "rm -rf ./build",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
1
|
import { fireEvent, render, screen } from '@testing-library/react'
|
|
2
|
+
import * as React from 'react'
|
|
3
3
|
|
|
4
4
|
import { chunkArray, DefaultRenderer } from '../Explorer'
|
|
5
5
|
import { displayValue } from '../utils'
|
|
@@ -62,7 +62,19 @@ describe('Explorer', () => {
|
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
it('when the value is a BigInt', () => {
|
|
65
|
-
expect(displayValue(BigInt(1))).toBe('"
|
|
65
|
+
expect(displayValue(BigInt(1))).toBe('"1"')
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('when the value is an Error', () => {
|
|
69
|
+
expect(displayValue(new Error('err'))).toBe(
|
|
70
|
+
'{"name":"Error","message":"err"}',
|
|
71
|
+
)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('when the value is an object', () => {
|
|
75
|
+
expect(displayValue({ error: new Error('err'), bigint: 1n })).toBe(
|
|
76
|
+
'{"error":{"name":"Error","message":"err"},"bigint":"1"}',
|
|
77
|
+
)
|
|
66
78
|
})
|
|
67
79
|
})
|
|
68
80
|
})
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import type { Query } from '@tanstack/react-query'
|
|
3
|
+
import SuperJSON from 'superjson'
|
|
3
4
|
|
|
4
5
|
import type { Theme } from './theme'
|
|
5
6
|
import { useTheme } from './theme'
|
|
@@ -118,10 +119,9 @@ export function useIsMounted() {
|
|
|
118
119
|
* @param {unknown} value Value to be stringified
|
|
119
120
|
*/
|
|
120
121
|
export const displayValue = (value: unknown) => {
|
|
121
|
-
const
|
|
122
|
-
const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value
|
|
122
|
+
const { json } = SuperJSON.serialize(value)
|
|
123
123
|
|
|
124
|
-
return JSON.stringify(
|
|
124
|
+
return JSON.stringify(json)
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const getStatusRank = (q: Query) =>
|