Skip to content

Commit 3202f1b

Browse files
authored
Merge branch 'main' into query-core/test/use-fake-timers-infiniteQueryBehavior.test.tsx
2 parents 59dde5c + f16d7af commit 3202f1b

File tree

191 files changed

+1884
-2153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+1884
-2153
lines changed

.github/workflows/pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ jobs:
6969
Sizes for commit ${{ env.COMMIT_SHA }}:
7070
| Branch | Bundle Size |
7171
|--------|--------|
72-
| Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.0.0/jsx-runtime?target=es2022%22,%22react@^19.0.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.0.0/jsx-runtime?target=es2022%22,%22react@%5E19.0.0?target=es2022%22%5D%7D%7D) |
73-
| This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.0.0/jsx-runtime?target=es2022%22,%22react@^19.0.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.0.0/jsx-runtime?target=es2022%22,%22react@%5E19.0.0?target=es2022%22%5D%7D%7D) |
72+
| Main | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.0/jsx-runtime?target=es2022%22,%22react@^19.1.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) |
73+
| This PR | [![](https://deno.bundlejs.com/badge?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config={%22esbuild%22:{%22external%22:[%22react@^19.1.0/jsx-runtime?target=es2022%22,%22react@^19.1.0?target=es2022%22]}}&badge=detailed)](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) |
7474
continue-on-error: true

.prettierignore

-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@
88
pnpm-lock.yaml
99
packages/**/tsup.config.bundled*.mjs
1010
**/tsconfig.vitest-temp.json
11-
12-
# API Extractor report
13-
packages/angular-query-experimental/etc/*.md

docs/framework/react/guides/migrating-to-v5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ v5 is a major version, so there are some breaking changes to be aware of:
99

1010
### Supports a single signature, one object
1111

12-
useQuery and friends used to have many overloads in TypeScript - different ways how the function can be invoked. Not only this was tough to maintain, type wise, it also required a runtime check to see which type the first and the second parameter, to correctly create options.
12+
useQuery and friends used to have many overloads in TypeScript: different ways how the function could be invoked. Not only was this tough to maintain, type wise, it also required a runtime check to see which types the first and the second parameter were, to correctly create options.
1313

1414
now we only support the object format.
1515

docs/framework/react/plugins/createPersister.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ bun add @tanstack/query-persist-client-core
3939
- Pass that `persister` as an option to your Query. This can be done either by passing it to the `defaultOptions` of the `QueryClient` or to any `useQuery` hook instance.
4040
- If you pass this `persister` as `defaultOptions`, all queries will be persisted to the provided `storage`. You can additionally narrow this down by passing `filters`. In contrast to the `persistClient` plugin, this will not persist the whole query client as a single item, but each query separately. As a key, the query hash is used.
4141
- If you provide this `persister` to a single `useQuery` hook, only this Query will be persisted.
42+
- Note: `queryClient.setQueryData()` operations are not persisted, this means that if you perform an optimistic update and refresh the page before the query has been invalidated, your changes to the query data will be lost. See https://github.com/TanStack/query/issues/6310
4243

4344
This way, you do not need to store whole `QueryClient`, but choose what is worth to be persisted in your application. Each query is lazily restored (when the Query is first used) and persisted (after each run of the `queryFn`), so it does not need to be throttled. `staleTime` is also respected after restoring the Query, so if data is considered `stale`, it will be refetched immediately after restoring. If data is `fresh`, the `queryFn` will not run.
4445

docs/framework/react/plugins/persistQueryClient.md

+4
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ ReactDOM.createRoot(rootElement).render(
219219
- will be called when the initial restore is finished
220220
- can be used to [resumePausedMutations](../../../reference/QueryClient.md#queryclientresumepausedmutations)
221221
- if a Promise is returned, it will be awaited; restoring is seen as ongoing until then
222+
- `onError?: () => Promise<unknown> | unknown`
223+
- optional
224+
- will be called when an error is thrown during restoration
225+
- if a Promise is returned, it will be awaited
222226

223227
### useIsRestoring
224228

docs/framework/vue/guides/disabling-queries.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ const { isLoading, isError, data, error, refetch, isFetching } = useQuery({
1818
</script>
1919
2020
<template>
21-
<button @click="refetch">Fetch Todos</button>
22-
<span v-if="isIdle">Not ready...</span>
23-
<span v-else-if="isError">Error: {{ error.message }}</span>
21+
<button @click="refetch()">Fetch Todos</button>
22+
<span v-if="isLoading">Loading...</span>
23+
<span v-else-if="isError">Error: {{ error?.message }}</span>
2424
<div v-else-if="data">
2525
<span v-if="isFetching">Fetching...</span>
2626
<ul>
2727
<li v-for="todo in data" :key="todo.id">{{ todo.title }}</li>
2828
</ul>
2929
</div>
30+
<span v-else>Not ready...</span>
3031
</template>
3132
```
3233

examples/angular/auto-refetching/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^19.2.4",
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
17-
"@tanstack/angular-query-experimental": "^5.72.3",
17+
"@tanstack/angular-query-experimental": "^5.73.3",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"
@@ -23,6 +23,6 @@
2323
"@angular/build": "^19.2.5",
2424
"@angular/cli": "^19.2.5",
2525
"@angular/compiler-cli": "^19.2.4",
26-
"typescript": "5.8.2"
26+
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/auto-refetching/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/basic/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^19.2.4",
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
17-
"@tanstack/angular-query-experimental": "^5.72.3",
17+
"@tanstack/angular-query-experimental": "^5.73.3",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"
@@ -23,6 +23,6 @@
2323
"@angular/build": "^19.2.5",
2424
"@angular/cli": "^19.2.5",
2525
"@angular/compiler-cli": "^19.2.4",
26-
"typescript": "5.8.2"
26+
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/basic/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/devtools-panel/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
1717
"@angular/router": "^19.2.4",
18-
"@tanstack/angular-query-devtools-experimental": "^5.72.3",
19-
"@tanstack/angular-query-experimental": "^5.72.3",
18+
"@tanstack/angular-query-devtools-experimental": "^5.73.3",
19+
"@tanstack/angular-query-experimental": "^5.73.3",
2020
"rxjs": "^7.8.2",
2121
"tslib": "^2.8.1",
2222
"zone.js": "0.15.0"
@@ -25,6 +25,6 @@
2525
"@angular/build": "^19.2.5",
2626
"@angular/cli": "^19.2.5",
2727
"@angular/compiler-cli": "^19.2.4",
28-
"typescript": "5.8.2"
28+
"typescript": "5.8.3"
2929
}
3030
}

examples/angular/devtools-panel/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/infinite-query-with-max-pages/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^19.2.4",
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
17-
"@tanstack/angular-query-experimental": "^5.72.3",
17+
"@tanstack/angular-query-experimental": "^5.73.3",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"
@@ -23,6 +23,6 @@
2323
"@angular/build": "^19.2.5",
2424
"@angular/cli": "^19.2.5",
2525
"@angular/compiler-cli": "^19.2.4",
26-
"typescript": "5.8.2"
26+
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/infinite-query-with-max-pages/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/optimistic-updates/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@angular/forms": "^19.2.4",
1616
"@angular/platform-browser": "^19.2.4",
1717
"@angular/platform-browser-dynamic": "^19.2.4",
18-
"@tanstack/angular-query-experimental": "^5.72.3",
18+
"@tanstack/angular-query-experimental": "^5.73.3",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"
@@ -24,6 +24,6 @@
2424
"@angular/build": "^19.2.5",
2525
"@angular/cli": "^19.2.5",
2626
"@angular/compiler-cli": "^19.2.4",
27-
"typescript": "5.8.2"
27+
"typescript": "5.8.3"
2828
}
2929
}

examples/angular/optimistic-updates/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/pagination/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^19.2.4",
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
17-
"@tanstack/angular-query-experimental": "^5.72.3",
17+
"@tanstack/angular-query-experimental": "^5.73.3",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"
@@ -23,6 +23,6 @@
2323
"@angular/build": "^19.2.5",
2424
"@angular/cli": "^19.2.5",
2525
"@angular/compiler-cli": "^19.2.4",
26-
"typescript": "5.8.2"
26+
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/pagination/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/query-options-from-a-service/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
1717
"@angular/router": "^19.2.4",
18-
"@tanstack/angular-query-experimental": "^5.72.3",
18+
"@tanstack/angular-query-experimental": "^5.73.3",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"
@@ -24,6 +24,6 @@
2424
"@angular/build": "^19.2.5",
2525
"@angular/cli": "^19.2.5",
2626
"@angular/compiler-cli": "^19.2.4",
27-
"typescript": "5.8.2"
27+
"typescript": "5.8.3"
2828
}
2929
}

examples/angular/query-options-from-a-service/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/router/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
1717
"@angular/router": "^19.2.4",
18-
"@tanstack/angular-query-experimental": "^5.72.3",
18+
"@tanstack/angular-query-experimental": "^5.73.3",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"
@@ -24,6 +24,6 @@
2424
"@angular/build": "^19.2.5",
2525
"@angular/cli": "^19.2.5",
2626
"@angular/compiler-cli": "^19.2.4",
27-
"typescript": "5.8.2"
27+
"typescript": "5.8.3"
2828
}
2929
}

examples/angular/router/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/rxjs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@angular/forms": "^19.2.4",
1616
"@angular/platform-browser": "^19.2.4",
1717
"@angular/platform-browser-dynamic": "^19.2.4",
18-
"@tanstack/angular-query-experimental": "^5.72.3",
18+
"@tanstack/angular-query-experimental": "^5.73.3",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"
@@ -24,6 +24,6 @@
2424
"@angular/build": "^19.2.5",
2525
"@angular/cli": "^19.2.5",
2626
"@angular/compiler-cli": "^19.2.4",
27-
"typescript": "5.8.2"
27+
"typescript": "5.8.3"
2828
}
2929
}

examples/angular/rxjs/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/angular/simple/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^19.2.4",
1515
"@angular/platform-browser": "^19.2.4",
1616
"@angular/platform-browser-dynamic": "^19.2.4",
17-
"@tanstack/angular-query-experimental": "^5.72.3",
17+
"@tanstack/angular-query-experimental": "^5.73.3",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"
@@ -23,6 +23,6 @@
2323
"@angular/build": "^19.2.5",
2424
"@angular/cli": "^19.2.5",
2525
"@angular/compiler-cli": "^19.2.4",
26-
"typescript": "5.8.2"
26+
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/simple/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"sourceMap": true,
1515
"declaration": false,
1616
"experimentalDecorators": true,
17-
"moduleResolution": "bundler",
17+
"moduleResolution": "Bundler",
1818
"importHelpers": true,
1919
"target": "ES2022",
2020
"module": "ES2022",

examples/react/algolia/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
},
1010
"dependencies": {
1111
"@algolia/client-search": "5.2.1",
12-
"@tanstack/react-query": "^5.72.2",
13-
"@tanstack/react-query-devtools": "^5.72.2",
12+
"@tanstack/react-query": "^5.73.3",
13+
"@tanstack/react-query-devtools": "^5.73.3",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0"
1616
},
1717
"devDependencies": {
18-
"@tanstack/eslint-plugin-query": "^5.72.2",
18+
"@tanstack/eslint-plugin-query": "^5.73.3",
1919
"@types/react": "^18.2.79",
2020
"@types/react-dom": "^18.2.25",
2121
"@vitejs/plugin-react": "^4.3.4",
22-
"typescript": "5.8.2",
22+
"typescript": "5.8.3",
2323
"vite": "^6.2.4"
2424
}
2525
}

examples/react/auto-refetching/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
5+
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

examples/react/auto-refetching/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"start": "next start"
99
},
1010
"dependencies": {
11-
"@tanstack/react-query": "^5.72.2",
12-
"@tanstack/react-query-devtools": "^5.72.2",
13-
"next": "^15.0.0",
11+
"@tanstack/react-query": "^5.73.3",
12+
"@tanstack/react-query-devtools": "^5.73.3",
13+
"next": "^15.1.2",
1414
"react": "^18.2.0",
1515
"react-dom": "^18.2.0"
1616
},
1717
"devDependencies": {
1818
"@types/react": "^18.2.79",
1919
"@types/react-dom": "^18.2.25",
20-
"typescript": "5.8.2"
20+
"typescript": "5.8.3"
2121
}
2222
}

examples/react/auto-refetching/tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"forceConsistentCasingInFileNames": true,
88
"noEmit": true,
99
"esModuleInterop": true,
10-
"module": "esnext",
10+
"module": "ESNext",
1111
"moduleResolution": "Bundler",
1212
"resolveJsonModule": true,
1313
"isolatedModules": true,
1414
"jsx": "preserve",
15-
"incremental": true
15+
"incremental": true,
16+
"target": "ES2017"
1617
},
1718
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
1819
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)