Skip to content

Commit d6d621e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/angular-query-devtools-sub-path-imports
# Conflicts: # examples/angular/devtools-panel/package.json # packages/angular-query-devtools-experimental/package.json # packages/angular-query-devtools-experimental/tsconfig.json
2 parents 727d5df + e3b40d4 commit d6d621e

File tree

153 files changed

+985
-521
lines changed

Some content is hidden

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

153 files changed

+985
-521
lines changed

README.md

Lines changed: 61 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,59 @@
11
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />
22

3-
![TanStack Query Header](https://github.com/TanStack/query/raw/main/media/repo-header.png)
4-
5-
Hooks for fetching, caching and updating asynchronous data in React, Solid, Svelte and Vue
6-
7-
<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
8-
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
9-
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
10-
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
11-
</a><a href="https://www.npmjs.com/package/@tanstack/query-core" target="\_parent">
12-
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/query-core.svg" />
13-
</a><a href="https://bundlejs.com/?q=%40tanstack%2Freact-query&config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22react%22%2C%22react-dom%22%5D%7D%7D&badge=" target="\_parent">
14-
<img alt="" src="https://deno.bundlejs.com/?q=@tanstack/react-query&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}}&badge=detailed" />
15-
</a><a href="#badge">
16-
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
17-
</a><a href="https://github.com/TanStack/query/discussions">
18-
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
19-
</a><a href="https://bestofjs.org/projects/tanstack-query"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%2Fquery%26since=daily" /></a><a href="https://github.com/TanStack/query/" target="\_parent">
20-
<img alt="" src="https://img.shields.io/github/stars/TanStack/query.svg?style=social&label=Star" />
21-
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
22-
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" />
23-
</a> <a href="https://gitpod.io/from-referrer/">
24-
<img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/>
3+
<div align="center">
4+
<img src="./media/header_query.png" alt="TanStack Query" />
5+
</div>
6+
7+
An async state management library built to simplify fetching, caching, synchronizing, and updating server state.
8+
9+
- Protocol‑agnostic fetching (REST, GraphQL, promises, etc.)
10+
- Caching, refetching, pagination & infinite scroll
11+
- Mutations, dependent queries & background updates
12+
- Prefetching, cancellation & React Suspense support
13+
14+
<a href="https://tanstack.com/query" style="font-weight: bold">Read the Query Docs →</a>
15+
<br />
16+
17+
<div align="center" style="display: flex; gap: 10px; flex-direction: column; justify-content: center;">
18+
19+
<div align="center">
20+
<a href="https://www.npmjs.com/package/@tanstack/query-core" target="\_parent">
21+
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/query-core.svg" alt="npm downloads" />
2522
</a>
23+
<a href="https://github.com/TanStack/query/" target="\_parent">
24+
<img alt="" src="https://img.shields.io/github/stars/TanStack/query.svg?style=social&label=Star" alt="GitHub stars" />
25+
</a>
26+
<a href="https://bundlejs.com/?q=%40tanstack%2Freact-query&config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22react%22%2C%22react-dom%22%5D%7D%7D&badge=" target="\_parent">
27+
<img alt="" src="https://deno.bundlejs.com/?q=@tanstack/react-query&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}}&badge=detailed" alt="Bundle size" />
28+
</a>
29+
</div>
30+
31+
<div align="center">
32+
<a href="#badge">
33+
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
34+
</a>
35+
<a href="https://bestofjs.org/projects/tanstack-query"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%2Fquery%26since=daily" /></a>
36+
<a href="https://twitter.com/tan_stack"><img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/></a>
37+
</div>
38+
39+
<div align="center" style="font-size: 2rem; font-weight: bolder;">
2640

27-
Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger)
41+
[Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
2842

29-
## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more!
43+
</div>
3044

31-
Still on **React Query v2**? No problem! Check out the v2 docs here: https://github.com/TanStack/query/tree/2.x/docs/src/pages/docs.<br />
32-
Still on **React Query v3**? No problem! Check out the v3 docs here: https://tanstack.com/query/v3/docs/.<br />
33-
Still on **React Query v4**? No problem! Check out the v4 docs here: https://tanstack.com/query/v4/docs/.
45+
</div>
3446

35-
## Quick Features
47+
## Get Involved
3648

37-
- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
38-
- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)
39-
- Parallel + Dependent Queries
40-
- Mutations + Reactive Query Refetching
41-
- Multi-layer Cache + Automatic Garbage Collection
42-
- Paginated + Cursor-based Queries
43-
- Load-More + Infinite Scroll Queries w/ Scroll Recovery
44-
- Request Cancellation
45-
- [React Suspense](https://react.dev/reference/react/Suspense) + Fetch-As-You-Render Query Prefetching
46-
- Dedicated Devtools
49+
- We welcome issues and pull requests!
50+
- Participate in [GitHub discussions](https://github.com/TanStack/query/discussions)
51+
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
52+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
4753

4854
## Partners
4955

56+
<div style="display: flex; flex-wrap: wrap; gap: 50px; justify-content: center; align-items: center;">
5057
<a href="https://www.speakeasy.com/product/react-query?utm_source=tanstack&utm_campaign=tanstack">
5158
<picture>
5259
<source
@@ -64,11 +71,23 @@ Still on **React Query v4**? No problem! Check out the v4 docs here: https://tan
6471
/>
6572
</picture>
6673
</a>
74+
</div>
6775

68-
## Contributing
69-
70-
View the contributing guidelines [here](/CONTRIBUTING.md)
76+
## Explore the TanStack Ecosystem
7177

72-
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
78+
<div align="center">
79+
<a href="https://github.com/tanstack/config" style="font-weight: bold;">TanStack Config</a> – Tooling for JS/TS packages <br/>
80+
<a href="https://github.com/tanstack/db" style="font-weight: bold;">TanStack DB</a> – Reactive sync client store <br/>
81+
<a href="https://github.com/tanstack/devtools" style="font-weight: bold;">TanStack DevTools</a> – Unified devtools panel <br/>
82+
<a href="https://github.com/tanstack/form" style="font-weight: bold;">TanStack Form</a> – Type‑safe form state <br/>
83+
<a href="https://github.com/tanstack/pacer" style="font-weight: bold;">TanStack Pacer</a> – Debouncing, throttling, batching <br/>
84+
<a href="https://github.com/tanstack/ranger" style="font-weight: bold;">TanStack Ranger</a> – Range & slider primitives <br/>
85+
<a href="https://github.com/tanstack/router" style="font-weight: bold;">TanStack Router</a> – Type‑safe routing, caching & URL state<br/>
86+
<a href="https://github.com/tanstack/router" style="font-weight: bold;">TanStack Start</a> – Full‑stack SSR & streaming<br/>
87+
<a href="https://github.com/tanstack/store" style="font-weight: bold;">TanStack Store</a> – Reactive data store <br/>
88+
<a href="https://github.com/tanstack/table" style="font-weight: bold;">TanStack Table</a> – Headless datagrids <br/>
89+
<a href="https://github.com/tanstack/virtual" style="font-weight: bold;">TanStack Virtual</a> – Virtualized rendering <br/>
90+
… and more at <a href="https://tanstack.com" style="font-weight: bold;">TanStack.com »</a>
91+
</div>
7392

7493
<!-- Use the force, Luke -->

docs/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,10 @@
757757
{
758758
"label": "notifyManager",
759759
"to": "reference/notifyManager"
760+
},
761+
{
762+
"label": "timeoutManager",
763+
"to": "reference/timeoutManager"
760764
}
761765
],
762766
"frameworks": [

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/guides/mutations.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export class TodosComponent {
4747

4848
```angular-ts
4949
@Component({
50-
standalone: true,
5150
selector: 'todo-item',
5251
imports: [ReactiveFormsModule],
5352
template: `

docs/framework/angular/guides/placeholder-query-data.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ class TodosComponent {
3636

3737
```ts
3838
export class BlogPostComponent {
39-
// Until Angular supports signal-based inputs, we have to set a signal
40-
@Input({ required: true, alias: 'postId' })
41-
set _postId(value: number) {
42-
this.postId.set(value)
43-
}
44-
postId = signal(0)
39+
postId = input.required<number>()
4540
queryClient = inject(QueryClient)
4641

4742
result = injectQuery(() => ({
@@ -50,7 +45,7 @@ export class BlogPostComponent {
5045
placeholderData: () => {
5146
// Use the smaller/preview version of the blogPost from the 'blogPosts'
5247
// query as the placeholder data for this blogPost query
53-
return queryClient
48+
return this.queryClient
5449
.getQueryData(['blogPosts'])
5550
?.find((d) => d.id === this.postId())
5651
},

docs/framework/angular/guides/queries.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ result = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList }))
3737
```angular-ts
3838
@Component({
3939
selector: 'todos',
40-
standalone: true,
4140
template: `
4241
@if (todos.isPending()) {
4342
<span>Loading...</span>
@@ -70,7 +69,6 @@ If booleans aren't your thing, you can always use the `status` state as well:
7069
```angular-ts
7170
@Component({
7271
selector: 'todos',
73-
standalone: true,
7472
template: `
7573
@switch (todos.status()) {
7674
@case ('pending') {

docs/framework/angular/guides/query-cancellation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ You might want to cancel a query manually. For example, if the request takes a l
8383

8484
```angular-ts
8585
@Component({
86-
standalone: true,
8786
template: `<button (click)="onCancel()">Cancel</button>`,
8887
})
8988
export class TodosComponent {

docs/framework/angular/overview.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ import { lastValueFrom } from 'rxjs'
7070
@Component({
7171
changeDetection: ChangeDetectionStrategy.OnPush,
7272
selector: 'simple-example',
73-
standalone: true,
7473
template: `
7574
@if (query.isPending()) {
7675
Loading...

docs/framework/angular/quick-start.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import {
5555
} from '@tanstack/angular-query-experimental'
5656
5757
@Component({
58-
standalone: true,
5958
template: `
6059
<div>
6160
<button (click)="onAddTodo()">Add Todo</button>

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.

0 commit comments

Comments
 (0)