@tanstack/react-query-devtools 4.13.6 → 4.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-query-devtools",
3
- "version": "4.13.6",
3
+ "version": "4.14.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.13.5"
49
+ "@tanstack/react-query": "4.14.0"
50
50
  },
51
51
  "dependencies": {
52
52
  "@tanstack/match-sorter-utils": "^8.1.1",
@@ -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.13.5"
59
+ "@tanstack/react-query": "4.14.0"
60
60
  },
61
61
  "scripts": {
62
62
  "clean": "rm -rf ./build",
package/src/devtools.tsx CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  getResizeHandleStyle,
23
23
  getSidedProp,
24
24
  defaultPanelSize,
25
+ displayValue,
25
26
  } from './utils'
26
27
  import type { Corner, Side } from './utils'
27
28
  import {
@@ -846,7 +847,7 @@ const ActiveQuery = ({
846
847
  overflow: 'auto',
847
848
  }}
848
849
  >
849
- {JSON.stringify(activeQuery.queryKey, null, 2)}
850
+ {displayValue(activeQuery.queryKey, true)}
850
851
  </pre>
851
852
  </Code>
852
853
  <span
package/src/utils.ts CHANGED
@@ -117,11 +117,12 @@ export function useIsMounted() {
117
117
  /**
118
118
  * Displays a string regardless the type of the data
119
119
  * @param {unknown} value Value to be stringified
120
+ * @param {boolean} beautify Formats json to multiline
120
121
  */
121
- export const displayValue = (value: unknown) => {
122
+ export const displayValue = (value: unknown, beautify: boolean = false) => {
122
123
  const { json } = SuperJSON.serialize(value)
123
124
 
124
- return JSON.stringify(json)
125
+ return JSON.stringify(json, null, beautify ? 2 : undefined)
125
126
  }
126
127
 
127
128
  // Sorting functions