Skip to content

Commit 9323f98

Browse files
authored
Merge branch 'main' into fix/issue-7842
2 parents cbc0246 + d6a7bf3 commit 9323f98

220 files changed

Lines changed: 3391 additions & 1727 deletions

File tree

Some content is hidden

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

.changeset/stupid-seals-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tanstack/query-core': patch
3+
---
4+
5+
fix: preserve infinite query behavior during SSR hydration (#8825)

docs/eslint/no-unstable-deps.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Examples of **incorrect** code for this rule:
2222

2323
```tsx
2424
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
25-
import { useCallback } from 'React'
25+
import { useCallback } from 'react'
2626
import { useMutation } from '@tanstack/react-query'
2727

2828
function Component() {
@@ -38,7 +38,7 @@ Examples of **correct** code for this rule:
3838

3939
```tsx
4040
/* eslint "@tanstack/query/no-unstable-deps": "warn" */
41-
import { useCallback } from 'React'
41+
import { useCallback } from 'react'
4242
import { useMutation } from '@tanstack/react-query'
4343

4444
function Component() {

docs/framework/react/reference/useQuery.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ const {
8686
- If set to a `number`, e.g. `3`, failed queries will retry until the failed query count meets that number.
8787
- If set to a function, it will be called with `failureCount` (starting at `0` for the first retry) and `error` to determine if a retry should be attempted.
8888
- defaults to `3` on the client and `0` on the server
89-
- `retryOnMount: boolean`
90-
- If set to `false`, the query will not be retried on mount if it contains an error. Defaults to `true`.
89+
- `retryOnMount: boolean | (query: Query) => boolean`
90+
- If set to `false`, the query will not be retried on mount if it contains an error and has no data. Defaults to `true`.
91+
- If set to a function, the function will be executed with the query to compute the value.
9192
- `retryDelay: number | (retryAttempt: number, error: TError) => number`
9293
- This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
9394
- A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff.

docs/framework/solid/reference/useQuery.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ function App() {
277277
- If `true`, failed queries will retry infinitely.
278278
- If set to a `number`, e.g. `3`, failed queries will retry until the failed query count meets that number.
279279
- defaults to `3` on the client and `0` on the server
280-
- ##### `retryOnMount: boolean`
281-
- If set to `false`, the query will not be retried on mount if it contains an error. Defaults to `true`.
280+
- ##### `retryOnMount: boolean | (query: Query) => boolean`
281+
- If set to `false`, the query will not be retried on mount if it contains an error and has no data. Defaults to `true`.
282+
- If set to a function, the function will be executed with the query to compute the value.
282283
- ##### `retryDelay: number | (retryAttempt: number, error: TError) => number`
283284
- This function receives a `retryAttempt` integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
284285
- A function like `attempt => Math.min(attempt > 1 ? 2 ** attempt * 1000 : 1000, 30 * 1000)` applies exponential backoff.

docs/reference/QueryClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ This distinction is more a "convenience" for ts devs that know which structure w
250250

251251
## `queryClient.setQueryData`
252252

253-
`setQueryData` is a synchronous function that can be used to immediately update a query's cached data. If the query does not exist, it will be created. **If the query is not utilized by a query hook in the default `gcTime` of 5 minutes, the query will be garbage collected**. To update multiple queries at once and match query keys partially, you need to use [`queryClient.setQueriesData`](#queryclientsetqueriesdata) instead.
253+
`setQueryData` is a synchronous function that can be used to immediately update a query's cached data. If the query does not exist, it will be created. **If the query is not utilized by a query hook within the default `gcTime`, the query will be garbage collected. If the default `gcTime` has not been configured, it defaults to 5 minutes.** To update multiple queries at once and match query keys partially, you need to use [`queryClient.setQueriesData`](#queryclientsetqueriesdata) instead.
254254

255255
> The difference between using `setQueryData` and `fetchQuery` is that `setQueryData` is sync and assumes that you already synchronously have the data available. If you need to fetch the data asynchronously, it's suggested that you either refetch the query key or use `fetchQuery` to handle the asynchronous fetch.
256256

eslint.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ export default [
5252
plugins: { vitest },
5353
rules: {
5454
...vitest.configs.recommended.rules,
55+
'vitest/consistent-test-it': [
56+
'error',
57+
{ fn: 'it', withinDescribe: 'it' },
58+
],
5559
'vitest/no-standalone-expect': [
5660
'error',
5761
{
58-
additionalTestBlockFunctions: ['testIf'],
62+
additionalTestBlockFunctions: ['itIf'],
5963
},
6064
],
6165
},

examples/angular/auto-refetching/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@angular/compiler": "^20.0.0",
1414
"@angular/core": "^20.0.0",
1515
"@angular/platform-browser": "^20.0.0",
16-
"@tanstack/angular-query-experimental": "^5.99.0",
16+
"@tanstack/angular-query-experimental": "^5.100.1",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/basic-persister/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"@angular/compiler": "^20.0.0",
1414
"@angular/core": "^20.0.0",
1515
"@angular/platform-browser": "^20.0.0",
16-
"@tanstack/angular-query-experimental": "^5.99.0",
17-
"@tanstack/angular-query-persist-client": "^5.99.0",
18-
"@tanstack/query-async-storage-persister": "^5.99.0",
16+
"@tanstack/angular-query-experimental": "^5.100.1",
17+
"@tanstack/angular-query-persist-client": "^5.100.1",
18+
"@tanstack/query-async-storage-persister": "^5.100.1",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"

examples/angular/basic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@angular/compiler": "^20.0.0",
1414
"@angular/core": "^20.0.0",
1515
"@angular/platform-browser": "^20.0.0",
16-
"@tanstack/angular-query-experimental": "^5.99.0",
16+
"@tanstack/angular-query-experimental": "^5.100.1",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/devtools-panel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@angular/core": "^20.0.0",
1515
"@angular/platform-browser": "^20.0.0",
1616
"@angular/router": "^20.0.0",
17-
"@tanstack/angular-query-experimental": "^5.99.0",
17+
"@tanstack/angular-query-experimental": "^5.100.1",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"

0 commit comments

Comments
 (0)