Skip to content

Commit cd4be34

Browse files
committed
Merge remote-tracking branch 'upstream/main' into enhancement/angular-consistent-injector-options
2 parents 35647f7 + 7236237 commit cd4be34

File tree

360 files changed

+10102
-8825
lines changed

Some content is hidden

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

360 files changed

+10102
-8825
lines changed

.github/workflows/pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ jobs:
7171
|--------|--------|
7272
| 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) |
7373
| 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) |
74+
continue-on-error: true

CONTRIBUTING.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pnpm i
100100
pnpm dev
101101
```
102102

103-
4. Now you can visit http://localhost:3000/query/latest/docs/overview in the browser and see the changes you make in `tanstack/query/docs` there.
103+
4. Now you can visit http://localhost:3000/query/latest/docs/framework/react/overview in the browser and see the changes you make in `tanstack/query/docs` there.
104104

105105
> [!WARNING]
106106
> You will need to update the `docs/config.json` file (in `TanStack/query`) if you add a new documentation page!
@@ -236,3 +236,36 @@ Use an appropriate commit type. Be especially careful with breaking changes.
236236
## Releases
237237

238238
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.
239+
240+
## 🧪 Test
241+
242+
TanStack Query uses [Nx](https://nx.dev/) as its monorepo tool.
243+
To run tests in a local environment, you should use `nx` commands from the root directory.
244+
245+
### ✅ Run all tests
246+
247+
To run tests for **all packages**, run:
248+
249+
```bash
250+
npm run test
251+
```
252+
253+
### ✅ Run tests for a specific package
254+
255+
To run tests for a specific package, use the following command:
256+
257+
```bash
258+
npx nx run @tanstack/{package-name}:test:lib
259+
```
260+
261+
For example:
262+
263+
```bash
264+
npx nx run @tanstack/react-query:test:lib
265+
```
266+
267+
### ⚠️ Caution
268+
269+
Do not run `pnpm run test:lib` inside individual package folders.
270+
This can cause test failures due to dependencies between packages.
271+
Always run tests from the **root folder** using `nx` commands.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ View the contributing guidelines [here](/CONTRIBUTING.md)
5151

5252
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
5353

54-
<!-- Use the force, Luke! -->
54+
<!-- Use the force, Luke -->

docs/config.json

+209-2
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,143 @@
326326
}
327327
]
328328
},
329+
{
330+
"label": "solid",
331+
"children": [
332+
{
333+
"label": "Important Defaults",
334+
"to": "framework/solid/guides/important-defaults"
335+
},
336+
{
337+
"label": "Queries",
338+
"to": "framework/solid/guides/queries"
339+
},
340+
{
341+
"label": "Query Keys",
342+
"to": "framework/solid/guides/query-keys"
343+
},
344+
{
345+
"label": "Query Functions",
346+
"to": "framework/solid/guides/query-functions"
347+
},
348+
{
349+
"label": "Query Options",
350+
"to": "framework/solid/guides/query-options"
351+
},
352+
{
353+
"label": "Network Mode",
354+
"to": "framework/solid/guides/network-mode"
355+
},
356+
{
357+
"label": "Parallel Queries",
358+
"to": "framework/solid/guides/parallel-queries"
359+
},
360+
{
361+
"label": "Dependent Queries",
362+
"to": "framework/solid/guides/dependent-queries"
363+
},
364+
{
365+
"label": "Background Fetching Indicators",
366+
"to": "framework/solid/guides/background-fetching-indicators"
367+
},
368+
{
369+
"label": "Window Focus Refetching",
370+
"to": "framework/solid/guides/window-focus-refetching"
371+
},
372+
{
373+
"label": "Disabling/Pausing Queries",
374+
"to": "framework/solid/guides/disabling-queries"
375+
},
376+
{
377+
"label": "Query Retries",
378+
"to": "framework/solid/guides/query-retries"
379+
},
380+
{
381+
"label": "Paginated Queries",
382+
"to": "framework/solid/guides/paginated-queries"
383+
},
384+
{
385+
"label": "Infinite Queries",
386+
"to": "framework/solid/guides/infinite-queries"
387+
},
388+
{
389+
"label": "Initial Query Data",
390+
"to": "framework/solid/guides/initial-query-data"
391+
},
392+
{
393+
"label": "Placeholder Query Data",
394+
"to": "framework/solid/guides/placeholder-query-data"
395+
},
396+
{
397+
"label": "Mutations",
398+
"to": "framework/solid/guides/mutations"
399+
},
400+
{
401+
"label": "Query Invalidation",
402+
"to": "framework/solid/guides/query-invalidation"
403+
},
404+
{
405+
"label": "Invalidation from Mutations",
406+
"to": "framework/solid/guides/invalidations-from-mutations"
407+
},
408+
{
409+
"label": "Updates from Mutation Responses",
410+
"to": "framework/solid/guides/updates-from-mutation-responses"
411+
},
412+
{
413+
"label": "Optimistic Updates",
414+
"to": "framework/solid/guides/optimistic-updates"
415+
},
416+
{
417+
"label": "Query Cancellation",
418+
"to": "framework/solid/guides/query-cancellation"
419+
},
420+
{
421+
"label": "Scroll Restoration",
422+
"to": "framework/solid/guides/scroll-restoration"
423+
},
424+
{
425+
"label": "Filters",
426+
"to": "framework/solid/guides/filters"
427+
},
428+
{
429+
"label": "Request Waterfalls",
430+
"to": "framework/solid/guides/request-waterfalls"
431+
},
432+
{
433+
"label": "Prefetching",
434+
"to": "framework/solid/guides/prefetching"
435+
},
436+
{
437+
"label": "SSR",
438+
"to": "framework/solid/guides/ssr"
439+
},
440+
{
441+
"label": "Advanced SSR",
442+
"to": "framework/solid/guides/advanced-ssr"
443+
},
444+
{
445+
"label": "Caching",
446+
"to": "framework/solid/guides/caching"
447+
},
448+
{
449+
"label": "Default Query Fn",
450+
"to": "framework/solid/guides/default-query-function"
451+
},
452+
{
453+
"label": "Suspense",
454+
"to": "framework/solid/guides/suspense"
455+
},
456+
{
457+
"label": "Testing",
458+
"to": "framework/solid/guides/testing"
459+
},
460+
{
461+
"label": "Does this replace state managers?",
462+
"to": "framework/angular/guides/does-this-replace-client-state"
463+
}
464+
]
465+
},
329466
{
330467
"label": "vue",
331468
"children": [
@@ -605,6 +742,10 @@
605742
"label": "QueriesObserver",
606743
"to": "reference/QueriesObserver"
607744
},
745+
{
746+
"label": "streamedQuery",
747+
"to": "reference/streamedQuery"
748+
},
608749
{
609750
"label": "focusManager",
610751
"to": "reference/focusManager"
@@ -753,8 +894,44 @@
753894
"label": "solid",
754895
"children": [
755896
{
756-
"label": "createQuery",
757-
"to": "framework/solid/reference/createQuery"
897+
"label": "useQuery",
898+
"to": "framework/solid/reference/useQuery"
899+
},
900+
{
901+
"label": "useQueries",
902+
"to": "framework/solid/reference/useQueries"
903+
},
904+
{
905+
"label": "useInfiniteQuery",
906+
"to": "framework/solid/reference/useInfiniteQuery"
907+
},
908+
{
909+
"label": "useMutation",
910+
"to": "framework/solid/reference/useMutation"
911+
},
912+
{
913+
"label": "useIsFetching",
914+
"to": "framework/solid/reference/useIsFetching"
915+
},
916+
{
917+
"label": "useIsMutating",
918+
"to": "framework/solid/reference/useIsMutating"
919+
},
920+
{
921+
"label": "useMutationState",
922+
"to": "framework/solid/reference/useMutationState"
923+
},
924+
{
925+
"label": "queryOptions",
926+
"to": "framework/solid/reference/queryOptions"
927+
},
928+
{
929+
"label": "infiniteQueryOptions",
930+
"to": "framework/solid/reference/infiniteQueryOptions"
931+
},
932+
{
933+
"label": "hydration",
934+
"to": "framework/solid/reference/hydration"
758935
}
759936
]
760937
},
@@ -840,6 +1017,19 @@
8401017
}
8411018
]
8421019
},
1020+
{
1021+
"label": "solid",
1022+
"children": [
1023+
{
1024+
"label": "TkDodo's Blog",
1025+
"to": "framework/solid/community/tkdodos-blog"
1026+
},
1027+
{
1028+
"label": "Community Projects",
1029+
"to": "framework/solid/community/community-projects"
1030+
}
1031+
]
1032+
},
8431033
{
8441034
"label": "vue",
8451035
"children": [
@@ -957,6 +1147,10 @@
9571147
{
9581148
"label": "Devtools Embedded Panel",
9591149
"to": "framework/react/examples/devtools-panel"
1150+
},
1151+
{
1152+
"label": "Chat example (streaming)",
1153+
"to": "framework/react/examples/chat"
9601154
}
9611155
]
9621156
},
@@ -1123,6 +1317,19 @@
11231317
}
11241318
]
11251319
},
1320+
{
1321+
"label": "solid",
1322+
"children": [
1323+
{
1324+
"label": "broadcastQueryClient (Experimental)",
1325+
"to": "framework/solid/plugins/broadcastQueryClient"
1326+
},
1327+
{
1328+
"label": "createPersister (Experimental)",
1329+
"to": "framework/solid/plugins/createPersister"
1330+
}
1331+
]
1332+
},
11261333
{
11271334
"label": "vue",
11281335
"children": [

docs/eslint/eslint-plugin-query.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ Alternatively, add `@tanstack/query` to the plugins section, and configure the r
9393

9494
## Rules
9595

96-
- [@tanstack/query/exhaustive-deps](./exhaustive-deps)
97-
- [@tanstack/query/no-rest-destructuring](./no-rest-destructuring)
98-
- [@tanstack/query/stable-query-client](./stable-query-client)
99-
- [@tanstack/query/no-unstable-deps](./no-unstable-deps)
100-
- [@tanstack/query/infinite-query-property-order](./infinite-query-property-order)
96+
- [@tanstack/query/exhaustive-deps](./exhaustive-deps.md)
97+
- [@tanstack/query/no-rest-destructuring](./no-rest-destructuring.md)
98+
- [@tanstack/query/stable-query-client](./stable-query-client.md)
99+
- [@tanstack/query/no-unstable-deps](./no-unstable-deps.md)
100+
- [@tanstack/query/infinite-query-property-order](./infinite-query-property-order.md)
101+
- [@tanstack/query/no-void-query-fn](./no-void-query-fn.md)

docs/eslint/no-void-query-fn.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: no-void-query-fn
3+
title: Disallow returning void from query functions
4+
---
5+
6+
Query functions must return a value that will be cached by TanStack Query. Functions that don't return a value (void functions) can lead to unexpected behavior and might indicate a mistake in the implementation.
7+
8+
## Rule Details
9+
10+
Example of **incorrect** code for this rule:
11+
12+
```tsx
13+
/* eslint "@tanstack/query/no-void-query-fn": "error" */
14+
15+
useQuery({
16+
queryKey: ['todos'],
17+
queryFn: async () => {
18+
await api.todos.fetch() // Function doesn't return the fetched data
19+
},
20+
})
21+
```
22+
23+
Example of **correct** code for this rule:
24+
25+
```tsx
26+
/* eslint "@tanstack/query/no-void-query-fn": "error" */
27+
useQuery({
28+
queryKey: ['todos'],
29+
queryFn: async () => {
30+
const todos = await api.todos.fetch()
31+
return todos
32+
},
33+
})
34+
```
35+
36+
## Attributes
37+
38+
- [x] ✅ Recommended
39+
- [ ] 🔧 Fixable

docs/framework/react/community/community-projects.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ The Missing Fullstack Toolkit for Next.js
2525

2626
Link: https://blitzjs.com/
2727

28+
## Connect
29+
30+
A family of libraries for building building browser and gRPC-compatible HTTP APIs.
31+
32+
Link: https://connectrpc.com/docs
33+
2834
## GraphQL Code Generator
2935

3036
Generate React Query hooks from your GraphQL schema
@@ -33,7 +39,7 @@ Link: https://the-guild.dev/graphql/codegen
3339

3440
## Http-wizard
3541

36-
End-to-end type-safe Fastify API with typecript magic ✨
42+
End-to-end type-safe Fastify API with typeScript magic ✨
3743

3844
Link: https://http-wizard.com
3945

docs/framework/react/community/tkdodos-blog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: tkdodos-blog
33
title: TkDodo's Blog
44
---
55

6-
TanStack Query maintainer [TkDodo](https://twitter.com/tkdodo) has a series of blog posts about using and working with the library. Some articles show general best practices, but most have an _opinionated_ point of view.
6+
TanStack Query maintainer [TkDodo](https://bsky.app/profile/tkdodo.eu) has a series of blog posts about using and working with the library. Some articles show general best practices, but most have an _opinionated_ point of view.
77

88
## [#1: Practical React Query](https://tkdodo.eu/blog/practical-react-query)
99

0 commit comments

Comments
 (0)