Skip to content

Commit 97cd385

Browse files
Merge branch 'main' into changesets
2 parents ab7eb13 + cd4ef5c commit 97cd385

File tree

386 files changed

+10492
-4987
lines changed

Some content is hidden

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

386 files changed

+10492
-4987
lines changed

.github/workflows/autofix.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4.2.2
21+
uses: actions/checkout@v5.0.0
22+
with:
23+
fetch-depth: 0
2224
- name: Setup Tools
2325
uses: tanstack/config/.github/setup@main
2426
- name: Fix formatting

.github/workflows/pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v4.2.2
25+
uses: actions/checkout@v5.0.0
2626
with:
2727
fetch-depth: 0
2828
- name: Start Nx Agents
2929
run: npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"
3030
- name: Setup Tools
3131
uses: tanstack/config/.github/setup@main
3232
- name: Get base and head commits for `nx affected`
33-
uses: nrwl/nx-set-shas@v4.3.0
33+
uses: nrwl/nx-set-shas@v4.3.3
3434
with:
3535
main-branch-name: main
3636
- name: Run Checks
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
steps:
5353
- name: Checkout
54-
uses: actions/checkout@v4.2.2
54+
uses: actions/checkout@v5.0.0
5555
with:
5656
fetch-depth: 0
5757
- name: Setup Tools
@@ -65,12 +65,12 @@ jobs:
6565
run: |
6666
echo "COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_ENV
6767
- name: Preview Bundle Size
68-
uses: marocchino/sticky-pull-request-comment@28d58c4b5a5eae3bbe45348c3990dcbc2ffcdc69
68+
uses: marocchino/sticky-pull-request-comment@fd19551a2a7c0d29677c63257f86d8ef8bb24b48
6969
with:
7070
message: |
7171
Sizes for commit ${{ env.COMMIT_SHA }}:
7272
| Branch | Bundle Size |
7373
|--------|--------|
74-
| 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) |
75-
| 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) |
74+
| 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.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?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.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) |
75+
| 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.1/jsx-runtime?target=es2022%22,%22react@^19.1.1?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.1/jsx-runtime?target=es2022%22,%22react@%5E19.1.1?target=es2022%22%5D%7D%7D) |
7676
continue-on-error: true

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v4.2.2
26+
uses: actions/checkout@v5.0.0
2727
with:
2828
fetch-depth: 0
2929
- name: Start Nx Agents

.npmrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
link-workspace-packages=true
2-
prefer-workspace-packages=true
31
provenance=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.4.1
1+
24.8.0

README.md

Lines changed: 89 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,105 @@
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+
<br />
8+
9+
<div align="center">
10+
<a href="https://www.npmjs.com/package/@tanstack/query-core" target="\_parent">
11+
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/query-core.svg" alt="npm downloads" />
12+
</a>
13+
<a href="https://github.com/TanStack/query/" target="\_parent">
14+
<img alt="" src="https://img.shields.io/github/stars/TanStack/query.svg?style=social&label=Star" alt="GitHub stars" />
15+
</a>
16+
<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">
17+
<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" />
2518
</a>
19+
</div>
20+
21+
<div align="center">
22+
<a href="#badge">
23+
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release">
24+
</a>
25+
<a href="https://bestofjs.org/projects/tanstack-query"><img src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%2Fquery%26since=daily" alt="Best of JS" /></a>
26+
<a href="https://twitter.com/tan_stack"><img src="https://img.shields.io/twitter/follow/tan_stack.svg?style=social" alt="Follow @TanStack"/></a>
27+
</div>
28+
29+
<div align="center">
30+
31+
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
32+
33+
</div>
2634

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)
35+
# TanStack Query
2836

29-
## Visit [tanstack.com/query](https://tanstack.com/query) for docs, guides, API and more!
37+
An async state management library built to simplify fetching, caching, synchronizing, and updating server state.
3038

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/.
39+
- Protocol‑agnostic fetching (REST, GraphQL, promises, etc.)
40+
- Caching, refetching, pagination & infinite scroll
41+
- Mutations, dependent queries & background updates
42+
- Prefetching, cancellation & React Suspense support
3443

35-
## Quick Features
44+
### <a href="https://tanstack.com/query">Read the docs →</b></a>
3645

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
46+
## Get Involved
47+
48+
- We welcome issues and pull requests!
49+
- Participate in [GitHub discussions](https://github.com/TanStack/query/discussions)
50+
- Chat with the community on [Discord](https://discord.com/invite/WrRKjPJ)
51+
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup instructions
4752

4853
## Partners
4954

50-
<a href="https://www.speakeasy.com/product/react-query?utm_source=tanstack&utm_campaign=tanstack">
51-
<picture>
52-
<source
53-
srcset="https://tanstack.com/assets/speakeasy-dark-BjP-Hd9M.svg"
54-
media="(prefers-color-scheme: dark)"
55-
/>
56-
<source
57-
srcset="https://tanstack.com/assets/speakeasy-light-UpY7QmwQ.svg"
58-
media="(prefers-color-scheme: light)"
59-
/>
60-
<!-- fallback -->
61-
<img
62-
src="https://tanstack.com/assets/speakeasy-light-UpY7QmwQ.svg"
63-
alt="Speakeasy Logo"
64-
/>
65-
</picture>
66-
</a>
55+
<table align="center">
56+
<tr>
57+
<td>
58+
<a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
59+
<picture>
60+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
61+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
62+
<img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
63+
</picture>
64+
</a>
65+
</td>
66+
<td>
67+
<a href="https://www.cloudflare.com?utm_source=tanstack">
68+
<picture>
69+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
70+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
71+
<img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
72+
</picture>
73+
</a>
74+
</td>
75+
</tr>
76+
</table>
6777

68-
## Contributing
78+
<div align="center">
79+
<img src="./media/partner_logo.svg" alt="Query & you?" height="65">
80+
<p>
81+
We're looking for TanStack Query Partners to join our mission! Partner with us to push the boundaries of TanStack Query and build amazing things together.
82+
</p>
83+
<a href="mailto:partners@tanstack.com?subject=TanStack Query Partnership"><b>LET'S CHAT</b></a>
84+
</div>
6985

70-
View the contributing guidelines [here](/CONTRIBUTING.md)
86+
</div>
7187

72-
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
88+
## Explore the TanStack Ecosystem
89+
90+
- <a href="https://github.com/tanstack/config"><b>TanStack Config</b></a> – Tooling for JS/TS packages
91+
- <a href="https://github.com/tanstack/db"><b>TanStack DB</b></a> – Reactive sync client store
92+
- <a href="https://github.com/tanstack/devtools"><b>TanStack DevTools</b></a> – Unified devtools panel
93+
- <a href="https://github.com/tanstack/form"><b>TanStack Form</b></a> – Type‑safe form state
94+
- <a href="https://github.com/tanstack/pacer"><b>TanStack Pacer</b></a> – Debouncing, throttling, batching <br/>
95+
- <a href="https://github.com/tanstack/query"><b>TanStack Query</b></a> – Async state & caching
96+
- <a href="https://github.com/tanstack/ranger"><b>TanStack Ranger</b></a> – Range & slider primitives
97+
- <a href="https://github.com/tanstack/router"><b>TanStack Router</b></a> – Type‑safe routing, caching & URL state
98+
- <a href="https://github.com/tanstack/router"><b>TanStack Start</b></a> – Full‑stack SSR & streaming
99+
- <a href="https://github.com/tanstack/store"><b>TanStack Store</b></a> – Reactive data store
100+
- <a href="https://github.com/tanstack/table"><b>TanStack Table</b></a> – Headless datagrids
101+
- <a href="https://github.com/tanstack/virtual"><b>TanStack Virtual</b></a> – Virtualized rendering
102+
103+
… and more at <a href="https://tanstack.com"><b>TanStack.com »</b></a>
73104

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

codecov.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ comment:
1919

2020
component_management:
2121
individual_components:
22-
- component_id: angular-query-devtools-experimental
23-
name: '@tanstack/angular-query-devtools-experimental'
24-
paths:
25-
- packages/angular-query-devtools-experimental/**
2622
- component_id: angular-query-experimental
2723
name: '@tanstack/angular-query-experimental'
2824
paths:

docs/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,10 @@
707707
"label": "Default Query Fn",
708708
"to": "framework/angular/guides/default-query-function"
709709
},
710+
{
711+
"label": "Testing",
712+
"to": "framework/angular/guides/testing"
713+
},
710714
{
711715
"label": "Does this replace state managers?",
712716
"to": "framework/angular/guides/does-this-replace-client-state"
@@ -757,6 +761,10 @@
757761
{
758762
"label": "notifyManager",
759763
"to": "reference/notifyManager"
764+
},
765+
{
766+
"label": "timeoutManager",
767+
"to": "reference/timeoutManager"
760768
}
761769
],
762770
"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`

0 commit comments

Comments
 (0)