Skip to content

Commit 416a3fe

Browse files
authored
Merge branch 'main' into feat/mutationfn-context
2 parents 4d34ab6 + 2283633 commit 416a3fe

File tree

85 files changed

+239
-259
lines changed

Some content is hidden

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

85 files changed

+239
-259
lines changed

docs/framework/angular/angular-httpclient-and-other-data-fetching-clients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Because TanStack Query's fetching mechanisms are agnostically built on Promises,
1111

1212
- Mock responses in unit tests using [provideHttpClientTesting](https://angular.dev/guide/http/testing).
1313
- [Interceptors](https://angular.dev/guide/http/interceptors) can be used for a wide range of functionality including adding authentication headers, performing logging, etc. While some data fetching libraries have their own interceptor system, `HttpClient` interceptors are integrated with Angular's dependency injection system.
14-
- `HttpClient` automatically informs [`PendingTasks`](https://angular.dev/api/core/PendingTasks#), which enables Angular to be aware of pending requests. Unit tests and SSR can use the resulting application _stableness_ information to wait for pending requests to finish. This makes unit testing much easier for [Zoneless](https://angular.dev/guide/experimental/zoneless) applications.
14+
- `HttpClient` automatically informs [`PendingTasks`](https://angular.dev/api/core/PendingTasks#), which enables Angular to be aware of pending requests. Unit tests and SSR can use the resulting application _stableness_ information to wait for pending requests to finish. This makes unit testing much easier for [Zoneless](https://angular.dev/guide/zoneless) applications.
1515
- When using SSR, `HttpClient` will [cache requests](https://angular.dev/guide/ssr#caching-data-when-using-HttpClient) performed on the server. This will prevent unneeded requests on the client. `HttpClient` SSR caching works out of the box. TanStack Query has its own hydration functionality which may be more powerful but requires some setup. Which one fits your needs best depends on your use case.
1616

1717
### Using observables in `queryFn`

docs/framework/angular/zoneless.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ title: Zoneless Angular
55

66
Because the Angular adapter for TanStack Query is built on signals, it fully supports Zoneless!
77

8-
Among Zoneless benefits are improved performance and debugging experience. For details see the [Angular documentation](https://angular.dev/guide/experimental/zoneless).
8+
Among Zoneless benefits are improved performance and debugging experience. For details see the [Angular documentation](https://angular.dev/guide/zoneless).
99

10-
> Keep in mind that the API for Angular Zoneless is currently experimental and can change in Angular patch versions.
1110
> Besides Zoneless, ZoneJS change detection is also fully supported.

docs/reference/streamedQuery.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { experimental_streamedQuery as streamedQuery } from '@tanstack/react-que
1313
const query = queryOptions({
1414
queryKey: ['data'],
1515
queryFn: streamedQuery({
16-
queryFn: fetchDataInChunks,
16+
streamFn: fetchDataInChunks,
1717
}),
1818
})
1919
```
@@ -22,20 +22,24 @@ const query = queryOptions({
2222
2323
**Options**
2424

25-
- `queryFn: (context: QueryFunctionContext) => Promise<AsyncIterable<TData>>`
25+
- `streamFn: (context: QueryFunctionContext) => Promise<AsyncIterable<TData>>`
2626
- **Required**
27-
- The function that returns a Promise of an AsyncIterable of data to stream in.
27+
- The function that returns a Promise of an AsyncIterable with data to stream in.
2828
- Receives a [QueryFunctionContext](../../framework/react/guides/query-functions.md#queryfunctioncontext)
29-
- `refetchMode?: 'append' | 'reset' | 'replace`
29+
- `refetchMode?: 'append' | 'reset' | 'replace'`
3030
- Optional
3131
- Defines how refetches are handled.
3232
- Defaults to `'reset'`
3333
- When set to `'reset'`, the query will erase all data and go back into `pending` state.
3434
- When set to `'append'`, data will be appended to existing data.
3535
- When set to `'replace'`, all data will be written to the cache once the stream ends.
36-
- `maxChunks?: number`
36+
- `reducer?: (accumulator: TData, chunk: TQueryFnData) => TData`
3737
- Optional
38-
- The maximum number of chunks to keep in the cache.
39-
- Defaults to `undefined`, meaning all chunks will be kept.
40-
- If `undefined` or `0`, the number of chunks is unlimited.
41-
- If the number of chunks exceeds this number, the oldest chunk will be removed.
38+
- Reduces streamed chunks (`TQueryFnData`) into the final data shape (`TData`).
39+
- Default: appends each chunk to the end of the accumulator when `TData` is an array.
40+
- If `TData` is not an array, you must provide a custom `reducer`.
41+
- `initialValue?: TData = TQueryFnData`
42+
- Optional
43+
- Defines the initial data to be used while the first chunk is being fetched.
44+
- It is mandatory when custom `reducer` is provided.
45+
- Defaults to an empty array.

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.85.9",
16+
"@tanstack/angular-query-experimental": "^5.86.0",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/basic-persister/package.json

Lines changed: 2 additions & 2 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.85.9",
16+
"@tanstack/angular-query-experimental": "^5.86.0",
1717
"@tanstack/angular-query-persist-client": "^5.62.7",
18-
"@tanstack/query-async-storage-persister": "^5.85.9",
18+
"@tanstack/query-async-storage-persister": "^5.86.0",
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.85.9",
16+
"@tanstack/angular-query-experimental": "^5.86.0",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/devtools-panel/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"@angular/core": "^20.0.0",
1515
"@angular/platform-browser": "^20.0.0",
1616
"@angular/router": "^20.0.0",
17-
"@tanstack/angular-query-devtools-experimental": "^5.85.9",
18-
"@tanstack/angular-query-experimental": "^5.85.9",
17+
"@tanstack/angular-query-devtools-experimental": "^5.86.0",
18+
"@tanstack/angular-query-experimental": "^5.86.0",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
2121
"zone.js": "0.15.0"

examples/angular/infinite-query-with-max-pages/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.85.9",
16+
"@tanstack/angular-query-experimental": "^5.86.0",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/optimistic-updates/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/forms": "^20.0.0",
1616
"@angular/platform-browser": "^20.0.0",
17-
"@tanstack/angular-query-experimental": "^5.85.9",
17+
"@tanstack/angular-query-experimental": "^5.86.0",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"

examples/angular/pagination/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.85.9",
16+
"@tanstack/angular-query-experimental": "^5.86.0",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

0 commit comments

Comments
 (0)