Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: TanStack/query
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.48.0
Choose a base ref
...
head repository: TanStack/query
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.49.0
Choose a head ref
  • 15 commits
  • 222 files changed
  • 10 contributors

Commits on Jun 26, 2024

  1. docs(vue): up-to-date devtools information (#7578)

    * docs(vue):  up-to-date devtools information
    
    need to help users clarify their current status
    
    * Update devtools.md
    
    * Update devtools.md
    
    * Update devtools.md
    
    * docs: restructure devtools page
    
    ---------
    
    Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
    reslear and DamianOsipiuk authored Jun 26, 2024
    Copy the full SHA
    832d07a View commit details
  2. docs: typo (#7628)

    bnzone authored Jun 26, 2024
    Copy the full SHA
    52cc7b2 View commit details
  3. fix(vue-query): types should now properly accept computed queryOptions (

    DamianOsipiuk authored Jun 26, 2024
    Copy the full SHA
    f1f6592 View commit details
  4. release: v5.48.1

    tannerlinsley committed Jun 26, 2024
    Copy the full SHA
    bec24e7 View commit details
  5. fix(vue-query): useQueries type inference (#7416)

    DamianOsipiuk authored Jun 26, 2024
    Copy the full SHA
    11e979e View commit details
  6. release: v5.48.2

    tannerlinsley committed Jun 26, 2024
    Copy the full SHA
    e100e5d View commit details

Commits on Jun 27, 2024

  1. docs: Remove the variable assignment from example code (#7623)

    * Remove the variable assignment from example code
    
    * remove variable assignment in prefetch query docs
    
    ---------
    
    Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
    kenrick and TkDodo authored Jun 27, 2024
    Copy the full SHA
    8b89941 View commit details
  2. docs(examples): code refactoring and type improvement (#7634)

    * refactor: minor code refactoring and type improvement for react-native example
    
    * chore: slice the movie with original value
    aziyatali authored Jun 27, 2024
    Copy the full SHA
    8d75aaa View commit details
  3. chore: Migrate to ESLint flat config (#7636)

    * chore: Migrate to ESLint flat config
    
    * Migrate more packages
    
    * angular and solid
    
    * svelte packages
    
    * Hopefully more fixes
    
    * react packages
    
    * vue packages
    
    * Fix typescript errors
    
    * Update Nx config
    lachlancollins authored Jun 27, 2024
    Copy the full SHA
    e6a0fdd View commit details

Commits on Jun 28, 2024

  1. chore: Update ESLint config (#7637)

    * chore: Update ESLint config
    
    * Fix errors
    
    * Fix knip
    lachlancollins authored Jun 28, 2024
    Copy the full SHA
    febbde6 View commit details
  2. docs: remove suspense reference to useQuery (#7640)

    useQuery has no suspense option
    alexander-svendsen authored Jun 28, 2024
    Copy the full SHA
    87c8e01 View commit details

Commits on Jun 29, 2024

  1. tests: Use recommended @testing-library/svelte setup (#7645)

    lachlancollins authored Jun 29, 2024
    Copy the full SHA
    003e1a8 View commit details
  2. feat(hydration): dehydrate.serialize and hydrate.deserialize (#7615)

    * add transformData to restore resolved prefetches
    
    * add failing test
    
    * fix test
    
    * remove transformPromise
    
    * fix
    
    * rev
    
    * rm log
    
    * fix test
    
    * add another test
    
    * serialize/deserialize
    
    * chore: docs + minor refactor
    
    * indentation
    
    * chore: prettier
    
    ---------
    
    Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
    juliusmarminge and TkDodo authored Jun 29, 2024
    Copy the full SHA
    8cbe7d5 View commit details
  3. ci: Use Node 20 for CodeSandbox examples (#7646)

    * ci: Try to use Node 20 for CSB
    
    * Simplify install/build scripts
    
    * Fix installCommand
    
    * Remove installCommand
    
    * Undo
    
    * Remove install:csb
    lachlancollins authored Jun 29, 2024
    Copy the full SHA
    033e739 View commit details
  4. release: v5.49.0

    tannerlinsley committed Jun 29, 2024
    Copy the full SHA
    b5272df View commit details
Showing with 1,853 additions and 1,253 deletions.
  1. +1 −2 .codesandbox/ci.json
  2. +0 −142 .eslintrc.cjs
  3. +8 −9 docs/framework/react/guides/advanced-ssr.md
  4. +2 −0 docs/framework/react/reference/hydration.md
  5. +1 −1 docs/framework/react/reference/usePrefetchInfiniteQuery.md
  6. +1 −1 docs/framework/react/reference/usePrefetchQuery.md
  7. +0 −1 docs/framework/react/reference/useSuspenseQuery.md
  8. +25 −15 docs/framework/vue/devtools.md
  9. +43 −0 eslint.config.js
  10. +2 −2 examples/angular/basic/package.json
  11. +2 −2 examples/angular/infinite-query-with-max-pages/package.json
  12. +2 −2 examples/angular/router/package.json
  13. +2 −2 examples/angular/simple/package.json
  14. +3 −3 examples/react/algolia/package.json
  15. +2 −2 examples/react/auto-refetching/package.json
  16. +2 −2 examples/react/basic-graphql-request/package.json
  17. +5 −5 examples/react/basic-typescript/package.json
  18. +3 −3 examples/react/basic/package.json
  19. +2 −2 examples/react/default-query-function/package.json
  20. +2 −2 examples/react/infinite-query-with-max-pages/package.json
  21. +2 −2 examples/react/load-more-infinite-scroll/package.json
  22. +2 −2 examples/react/nextjs-app-prefetching/package.json
  23. +3 −3 examples/react/nextjs-suspense-streaming/package.json
  24. +2 −2 examples/react/nextjs/package.json
  25. +4 −4 examples/react/offline/package.json
  26. +2 −2 examples/react/optimistic-updates-cache/package.json
  27. +2 −2 examples/react/optimistic-updates-ui/package.json
  28. +2 −2 examples/react/pagination/package.json
  29. +2 −2 examples/react/playground/package.json
  30. +2 −2 examples/react/prefetching/package.json
  31. +2 −2 examples/react/react-native/package.json
  32. +3 −2 examples/react/react-native/src/components/ListItem.tsx
  33. +9 −9 examples/react/react-native/src/lib/api.ts
  34. +3 −4 examples/react/react-native/src/screens/MoviesListScreen.tsx
  35. +2 −2 examples/react/react-router/package.json
  36. +2 −2 examples/react/rick-morty/package.json
  37. +2 −2 examples/react/shadow-dom/package.json
  38. +2 −2 examples/react/simple/package.json
  39. +2 −2 examples/react/star-wars/package.json
  40. +2 −2 examples/react/suspense/package.json
  41. +2 −2 examples/solid/astro/package.json
  42. +2 −2 examples/solid/basic-graphql-request/package.json
  43. +2 −2 examples/solid/basic-typescript/package.json
  44. +2 −2 examples/solid/default-query-function/package.json
  45. +3 −3 examples/solid/simple/package.json
  46. +2 −2 examples/solid/solid-start-streaming/package.json
  47. +2 −2 examples/svelte/auto-refetching/package.json
  48. +2 −2 examples/svelte/basic/package.json
  49. +2 −2 examples/svelte/load-more-infinite-scroll/package.json
  50. +2 −2 examples/svelte/optimistic-updates-typescript/package.json
  51. +2 −2 examples/svelte/playground/package.json
  52. +2 −2 examples/svelte/simple/package.json
  53. +2 −2 examples/svelte/ssr/package.json
  54. +2 −2 examples/svelte/star-wars/package.json
  55. +1 −1 examples/vue/2.6-basic/package.json
  56. +1 −1 examples/vue/2.7-basic/package.json
  57. +2 −2 examples/vue/basic/package.json
  58. +1 −1 examples/vue/dependent-queries/package.json
  59. +1 −1 examples/vue/nuxt3/package.json
  60. +4 −4 examples/vue/persister/package.json
  61. +2 −2 examples/vue/simple/package.json
  62. +2 −1 integrations/react-next-15/app/make-query-client.ts
  63. +2 −2 integrations/react-next-15/app/page.tsx
  64. +2 −3 nx.json
  65. +4 −13 package.json
  66. +0 −15 packages/angular-query-devtools-experimental/.eslintrc.cjs
  67. +17 −0 packages/angular-query-devtools-experimental/eslint.config.js
  68. +2 −2 packages/angular-query-devtools-experimental/package.json
  69. +5 −5 packages/angular-query-devtools-experimental/src/angular-query-devtools.component.ts
  70. +1 −1 packages/angular-query-devtools-experimental/tsconfig.json
  71. +0 −21 packages/angular-query-experimental/.eslintrc.cjs
  72. +23 −0 packages/angular-query-experimental/eslint.config.js
  73. +2 −2 packages/angular-query-experimental/package.json
  74. +6 −3 packages/angular-query-experimental/src/infinite-query-options.ts
  75. +1 −1 packages/angular-query-experimental/src/util/assert-injector/assert-injector.test.ts
  76. +1 −1 packages/angular-query-experimental/src/util/assert-injector/assert-injector.ts
  77. +1 −1 packages/angular-query-experimental/src/util/create-injection-token/create-injection-token.test.ts
  78. +2 −2 packages/angular-query-experimental/src/util/create-injection-token/create-injection-token.ts
  79. +1 −1 packages/angular-query-experimental/tsconfig.json
  80. +0 −6 packages/eslint-plugin-query/.eslintrc.cjs
  81. +5 −0 packages/eslint-plugin-query/eslint.config.js
  82. +2 −2 packages/eslint-plugin-query/package.json
  83. +1 −1 packages/eslint-plugin-query/tsconfig.json
  84. +2 −2 packages/eslint-plugin-query/vite.config.ts
  85. +0 −6 packages/query-async-storage-persister/.eslintrc.cjs
  86. +5 −0 packages/query-async-storage-persister/eslint.config.js
  87. +2 −2 packages/query-async-storage-persister/package.json
  88. +1 −1 packages/query-async-storage-persister/tsconfig.json
  89. +0 −6 packages/query-broadcast-client-experimental/.eslintrc.cjs
  90. +5 −0 packages/query-broadcast-client-experimental/eslint.config.js
  91. +2 −2 packages/query-broadcast-client-experimental/package.json
  92. +1 −1 packages/query-broadcast-client-experimental/tsconfig.json
  93. +0 −18 packages/query-codemods/.eslintrc.cjs
  94. +18 −0 packages/query-codemods/eslint.config.js
  95. +2 −2 packages/query-codemods/package.json
  96. +0 −1 packages/query-codemods/src/v4/__tests__/key-transformation.test.cjs
  97. +0 −1 packages/query-codemods/src/v4/__tests__/replace-import-specifier.test.cjs
  98. +0 −5 packages/query-codemods/src/v4/key-transformation.cjs
  99. +0 −1 packages/query-codemods/src/v5/is-loading/__tests__/is-loading.test.cjs
  100. +0 −3 packages/query-codemods/src/v5/is-loading/is-loading.cjs
  101. +0 −1 packages/query-codemods/src/v5/keep-previous-data/__tests__/keep-previous-data.test.cjs
  102. +0 −4 packages/query-codemods/src/v5/keep-previous-data/keep-previous-data.cjs
  103. +0 −1 packages/query-codemods/src/v5/remove-overloads/__tests__/remove-overloads.test.cjs
  104. +0 −3 packages/query-codemods/src/v5/remove-overloads/remove-overloads.cjs
  105. +0 −5 packages/query-codemods/src/v5/remove-overloads/transformers/filter-aware-usage-transformer.cjs
  106. +0 −3 packages/query-codemods/src/v5/remove-overloads/transformers/query-fn-aware-usage-transformer.cjs
  107. +0 −1 packages/query-codemods/src/v5/remove-overloads/utils/index.cjs
  108. +0 −1 packages/query-codemods/src/v5/rename-hydrate/__tests__/rename-hydrate.test.cjs
  109. +0 −1 packages/query-codemods/src/v5/rename-properties/__tests__/rename-properties.test.cjs
  110. +1 −1 packages/query-codemods/tsconfig.json
  111. +0 −6 packages/query-core/.eslintrc.cjs
  112. +5 −0 packages/query-core/eslint.config.js
  113. +2 −2 packages/query-core/package.json
  114. +85 −2 packages/query-core/src/__tests__/hydration.test.tsx
  115. +2 −2 packages/query-core/src/focusManager.ts
  116. +41 −14 packages/query-core/src/hydration.ts
  117. +1 −1 packages/query-core/src/onlineManager.ts
  118. +3 −1 packages/query-core/src/queryClient.ts
  119. +1 −1 packages/query-core/tsconfig.json
  120. +0 −6 packages/query-devtools/.eslintrc.cjs
  121. +5 −0 packages/query-devtools/eslint.config.js
  122. +2 −2 packages/query-devtools/package.json
  123. +3 −3 packages/query-devtools/src/__tests__/utils.test.ts
  124. +1 −1 packages/query-devtools/tsconfig.json
  125. +0 −6 packages/query-persist-client-core/.eslintrc.cjs
  126. +5 −0 packages/query-persist-client-core/eslint.config.js
  127. +2 −2 packages/query-persist-client-core/package.json
  128. +1 −1 packages/query-persist-client-core/src/createPersister.ts
  129. +1 −1 packages/query-persist-client-core/tsconfig.json
  130. +0 −6 packages/query-sync-storage-persister/.eslintrc.cjs
  131. +5 −0 packages/query-sync-storage-persister/eslint.config.js
  132. +2 −2 packages/query-sync-storage-persister/package.json
  133. +1 −1 packages/query-sync-storage-persister/tsconfig.json
  134. +0 −12 packages/react-query-devtools/.eslintrc.cjs
  135. +23 −0 packages/react-query-devtools/eslint.config.js
  136. +2 −2 packages/react-query-devtools/package.json
  137. +1 −1 packages/react-query-devtools/tsconfig.json
  138. +0 −12 packages/react-query-next-experimental/.eslintrc.cjs
  139. +24 −0 packages/react-query-next-experimental/eslint.config.js
  140. +2 −2 packages/react-query-next-experimental/package.json
  141. +1 −1 packages/react-query-next-experimental/tsconfig.json
  142. +0 −12 packages/react-query-persist-client/.eslintrc.cjs
  143. +23 −0 packages/react-query-persist-client/eslint.config.js
  144. +2 −2 packages/react-query-persist-client/package.json
  145. +1 −1 packages/react-query-persist-client/tsconfig.json
  146. +0 −22 packages/react-query/.eslintrc.cjs
  147. +35 −0 packages/react-query/eslint.config.js
  148. +2 −2 packages/react-query/package.json
  149. +1 −1 packages/react-query/src/HydrationBoundary.tsx
  150. +1 −2 packages/react-query/src/__tests__/HydrationBoundary.test.tsx
  151. +1 −3 packages/react-query/src/__tests__/QueryClientProvider.test.tsx
  152. +1 −2 packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx
  153. +6 −3 packages/react-query/src/infiniteQueryOptions.ts
  154. +1 −1 packages/react-query/src/suspense.ts
  155. +2 −4 packages/react-query/src/useSuspenseInfiniteQuery.ts
  156. +1 −1 packages/react-query/tsconfig.json
  157. +0 −6 packages/solid-query-devtools/.eslintrc.cjs
  158. +5 −0 packages/solid-query-devtools/eslint.config.js
  159. +2 −2 packages/solid-query-devtools/package.json
  160. +1 −1 packages/solid-query-devtools/tsconfig.json
  161. +0 −6 packages/solid-query-persist-client/.eslintrc.cjs
  162. +5 −0 packages/solid-query-persist-client/eslint.config.js
  163. +2 −2 packages/solid-query-persist-client/package.json
  164. +1 −1 packages/solid-query-persist-client/tsconfig.json
  165. +0 −6 packages/solid-query/.eslintrc.cjs
  166. +5 −0 packages/solid-query/eslint.config.js
  167. +2 −2 packages/solid-query/package.json
  168. +1 −1 packages/solid-query/src/__tests__/createInfiniteQuery.test.tsx
  169. +1 −0 packages/solid-query/src/__tests__/createQuery.test.tsx
  170. +2 −2 packages/solid-query/src/__tests__/suspense.test.tsx
  171. +1 −1 packages/solid-query/tsconfig.json
  172. +0 −24 packages/svelte-query-devtools/.eslintrc.cjs
  173. +16 −0 packages/svelte-query-devtools/eslint.config.js
  174. +3 −4 packages/svelte-query-devtools/package.json
  175. +2 −1 packages/svelte-query-devtools/tsconfig.json
  176. +0 −24 packages/svelte-query-persist-client/.eslintrc.cjs
  177. +16 −0 packages/svelte-query-persist-client/eslint.config.js
  178. +3 −4 packages/svelte-query-persist-client/package.json
  179. +0 −6 packages/svelte-query-persist-client/test-setup.ts
  180. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/AwaitOnSuccess/AwaitOnSuccess.svelte
  181. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/AwaitOnSuccess/Provider.svelte
  182. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/FreshData/FreshData.svelte
  183. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/FreshData/Provider.svelte
  184. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/InitialData/InitialData.svelte
  185. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/InitialData/Provider.svelte
  186. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/OnSuccess/OnSuccess.svelte
  187. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/OnSuccess/Provider.svelte
  188. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/PersistQueryClientProvider.test.ts
  189. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/RemoveCache/Provider.svelte
  190. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/RemoveCache/RemoveCache.svelte
  191. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/RestoreCache/Provider.svelte
  192. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/RestoreCache/RestoreCache.svelte
  193. +1 −1 packages/svelte-query-persist-client/{src/__tests__ → tests}/UseQueries/Provider.svelte
  194. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/UseQueries/UseQueries.svelte
  195. +1 −0 packages/svelte-query-persist-client/tests/test-setup.ts
  196. 0 packages/svelte-query-persist-client/{src/__tests__ → tests}/utils.ts
  197. +5 −2 packages/svelte-query-persist-client/tsconfig.json
  198. +4 −3 packages/svelte-query-persist-client/vite.config.ts
  199. +0 −24 packages/svelte-query/.eslintrc.cjs
  200. +16 −0 packages/svelte-query/eslint.config.js
  201. +3 −4 packages/svelte-query/package.json
  202. +0 −5 packages/svelte-query/tests/test-setup.ts
  203. +2 −1 packages/svelte-query/tsconfig.json
  204. +2 −1 packages/svelte-query/vite.config.ts
  205. +0 −10 packages/vue-query-devtools/.eslintrc.cjs
  206. +7 −0 packages/vue-query-devtools/eslint.config.js
  207. +3 −2 packages/vue-query-devtools/package.json
  208. +1 −1 packages/vue-query-devtools/src/devtools.vue
  209. +6 −1 packages/vue-query-devtools/tsconfig.json
  210. +2 −2 packages/vue-query-devtools/vite.config.ts
  211. +0 −10 packages/vue-query/.eslintrc.cjs
  212. +7 −0 packages/vue-query/eslint.config.js
  213. +3 −2 packages/vue-query/package.json
  214. +77 −0 packages/vue-query/src/__tests__/useQueries.test-d.ts
  215. +45 −2 packages/vue-query/src/__tests__/useQuery.test-d.ts
  216. +6 −3 packages/vue-query/src/infiniteQueryOptions.ts
  217. +1 −1 packages/vue-query/src/queryClient.ts
  218. +2 −2 packages/vue-query/src/types.ts
  219. +41 −24 packages/vue-query/src/useQueries.ts
  220. +1 −1 packages/vue-query/tsconfig.json
  221. +924 −459 pnpm-lock.yaml
  222. +1 −1 tsconfig.json
3 changes: 1 addition & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"installCommand": "install:csb",
"buildCommand": "build:csb",
"sandboxes": [
"/examples/angular/basic",
@@ -9,5 +8,5 @@
"/examples/vue/basic"
],
"packages": ["packages/**"],
"node": "18"
"node": "20"
}
142 changes: 0 additions & 142 deletions .eslintrc.cjs

This file was deleted.

17 changes: 8 additions & 9 deletions docs/framework/react/guides/advanced-ssr.md
Original file line number Diff line number Diff line change
@@ -432,24 +432,23 @@ export default function Posts() {

> Note that you could also `useQuery` instead of `useSuspenseQuery`, and the Promise would still be picked up correctly. However, NextJs won't suspend in that case and the component will render in the `pending` status, which also opts out of server rendering the content.
If you're using non-JSON data types and serialize the query results on the server, you can specify the `hydrate.transformPromise` option to deserialize the data on the client after the promise is resolved, before the data is put into the cache:
If you're using non-JSON data types and serialize the query results on the server, you can specify the `dehydrate.serializeData` and `hydrate.deserializeData` options to serialize and deserialize the data on each side of the boundary to ensure the data in the cache is the same format both on the server and the client:

```tsx
// app/get-query-client.ts
import { QueryClient, defaultShouldDehydrateQuery } from '@tanstack/react-query'
import { deserialize } from './transformer'
import { deserialize, serialize } from './transformer'

export function makeQueryClient() {
return new QueryClient({
defaultOptions: {
// ...
hydrate: {
/**
* Called when the query is rebuilt from a prefetched
* promise, before the query data is put into the cache.
*/
transformPromise: (promise) => promise.then(deserialize),
deserializeData: deserialize,
},
dehydrate: {
serializeData: serialize,
},
// ...
},
})
}
@@ -471,7 +470,7 @@ export default function PostsPage() {
// look ma, no await
queryClient.prefetchQuery({
queryKey: ['posts'],
queryFn: () => getPosts().then(serialize), // <-- serilize the data on the server
queryFn: () => getPosts().then(serialize), // <-- serialize the data on the server
})

return (
2 changes: 2 additions & 0 deletions docs/framework/react/reference/hydration.md
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ const dehydratedState = dehydrate(queryClient, {
- Return `true` to include this query in dehydration, or `false` otherwise
- Defaults to only including successful queries
- If you would like to extend the function while retaining the default behavior, import and execute `defaultShouldDehydrateQuery` as part of the return statement
- `serializeData?: (data: any) => any` A function to transform (serialize) data during dehydration.

**Returns**

@@ -83,6 +84,7 @@ hydrate(queryClient, dehydratedState, options)
- Optional
- `mutations: MutationOptions` The default mutation options to use for the hydrated mutations.
- `queries: QueryOptions` The default query options to use for the hydrated queries.
- `deserializeData?: (data: any) => any` A function to transform (deserialize) data before it is put into the cache.
- `queryClient?: QueryClient`,
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.

2 changes: 1 addition & 1 deletion docs/framework/react/reference/usePrefetchInfiniteQuery.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ title: usePrefetchInfiniteQuery
---

```tsx
const result = usePrefetchInfiniteQuery(options)
usePrefetchInfiniteQuery(options)
```

**Options**
2 changes: 1 addition & 1 deletion docs/framework/react/reference/usePrefetchQuery.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ title: usePrefetchQuery
---

```tsx
const result = usePrefetchQuery(options)
usePrefetchQuery(options)
```

**Options**
1 change: 0 additions & 1 deletion docs/framework/react/reference/useSuspenseQuery.md
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@ const result = useSuspenseQuery(options)

The same as for [useQuery](../useQuery), except for:

- `suspense`
- `throwOnError`
- `enabled`
- `placeholderData`
40 changes: 25 additions & 15 deletions docs/framework/vue/devtools.md
Original file line number Diff line number Diff line change
@@ -7,15 +7,10 @@ Wave your hands in the air and shout hooray because Vue Query comes with dedicat

When you begin your Vue Query journey, you'll want these devtools by your side. They help visualize all of the inner workings of Vue Query and will likely save you hours of debugging if you find yourself in a pinch!

The only thing you need to do is to install the official **[Vue Devtools](https://devtools.vuejs.org/guide/installation.html)**.

Vue Query will seamlessly integrate with the official devtools, adding custom inspector and timeline events.
Devtool code will be treeshaken from production bundles by default.

## Component based Devtools (Vue 3)

You can embeed devtools component into your page by using dedicated package.
Component based devtools are using the same framework-agnostic implementation, have more features and are updated more frequently.
You can directly integrate the devtools component into your page using a dedicated package.
Component-based devtools use a framework-agnostic implementation and are always up-to-date.

The devtools component is a separate package that you need to install:

@@ -49,19 +44,34 @@ import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
### Options

- `initialIsOpen: Boolean`
- Set this `true` if you want the dev tools to default to being open
- Set this `true` if you want the dev tools to default to being open.
- `buttonPosition?: "top-left" | "top-right" | "bottom-left" | "bottom-right"`
- Defaults to `bottom-right`
- The position of the React Query logo to open and close the devtools panel
- Defaults to `bottom-right`.
- The position of the React Query logo to open and close the devtools panel.
- `position?: "top" | "bottom" | "left" | "right"`
- Defaults to `bottom`
- The position of the React Query devtools panel
- `client?: QueryClient`,
- Defaults to `bottom`.
- The position of the React Query devtools panel.
- `client?: QueryClient`
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.
- `errorTypes?: { name: string; initializer: (query: Query) => TError}`
- Use this to predefine some errors that can be triggered on your queries. Initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
- Use this to predefine some errors that can be triggered on your queries. The initializer will be called (with the specific query) when that error is toggled on from the UI. It must return an Error.
- `styleNonce?: string`
- Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
- `shadowDOMTarget?: ShadowRoot`
- Default behavior will apply the devtool's styles to the head tag within the DOM.
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instad of within the head tag in the light DOM.
- Use this to pass a shadow DOM target to the devtools so that the styles will be applied within the shadow DOM instead of within the head tag in the light DOM.

## Traditional Devtools

Vue Query will seamlessly integrate with the [Official Vue devtools](https://github.com/vuejs/devtools-next), adding custom inspector and timeline events.
Devtool code will be treeshaken from production bundles by default.

To make it work, you only need to enable it in the plugin options:

```ts
app.use(VueQueryPlugin, {
enableDevtoolsV6Plugin: true,
})
```

Both v6 and v7 versions of devtools are supported.
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// @ts-check

// @ts-ignore Needed due to moduleResolution Node vs Bundler
import { tanstackConfig } from '@tanstack/config/eslint'
import pluginCspell from '@cspell/eslint-plugin'

export default [
...tanstackConfig,
{
name: 'tanstack/temp',
plugins: {
cspell: pluginCspell,
},
rules: {
'cspell/spellchecker': [
'warn',
{
cspell: {
words: [
'codemod', // We support our codemod
'extralight', // Our public interface
'jscodeshift',
'Promisable', // Our public interface
'retryer', // Our public interface
'solidjs', // Our target framework
'tabular-nums', // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric
'tanstack', // Our package scope
'todos', // Too general word to be caught as error
'TSES', // @typescript-eslint package's interface
'tsqd', // Our public interface (TanStack Query Devtools shorthand)
'tsup', // We use tsup as builder
'typecheck', // Field of vite.config.ts
'vue-demi', // dependency of @tanstack/vue-query
],
},
},
],
'ts/ban-types': 'off',
'ts/no-empty-function': 'off',
'no-case-declarations': 'off',
},
},
]
4 changes: 2 additions & 2 deletions examples/angular/basic/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"@angular/core": "^17.3.10",
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@tanstack/angular-query-experimental": "^5.48.0",
"@tanstack/angular-query-experimental": "^5.49.0",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"zone.js": "^0.14.6"
@@ -23,7 +23,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.10",
"@tanstack/angular-query-devtools-experimental": "^5.48.0",
"@tanstack/angular-query-devtools-experimental": "^5.49.0",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/angular/infinite-query-with-max-pages/package.json
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
"@angular/core": "^17.3.10",
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@tanstack/angular-query-experimental": "^5.48.0",
"@tanstack/angular-query-experimental": "^5.49.0",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"zone.js": "^0.14.6"
@@ -23,7 +23,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.10",
"@tanstack/angular-query-devtools-experimental": "^5.48.0",
"@tanstack/angular-query-devtools-experimental": "^5.49.0",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions examples/angular/router/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@angular/router": "^17.3.10",
"@tanstack/angular-query-experimental": "^5.48.0",
"@tanstack/angular-query-experimental": "^5.49.0",
"rxjs": "^7.8.1",
"tslib": "^2.6.2",
"zone.js": "^0.14.6"
@@ -24,7 +24,7 @@
"@angular-devkit/build-angular": "^17.3.8",
"@angular/cli": "^17.3.8",
"@angular/compiler-cli": "^17.3.10",
"@tanstack/angular-query-devtools-experimental": "^5.48.0",
"@tanstack/angular-query-devtools-experimental": "^5.49.0",
"typescript": "5.3.3"
}
}
Loading