Skip to content

Commit 32a9c45

Browse files
authored
Merge branch 'main' into fix/nodenext-ts2883-experimental-dts
2 parents 68bd0df + 86bb8a6 commit 32a9c45

140 files changed

Lines changed: 1744 additions & 1345 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.

docs/eslint/exhaustive-deps.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ id: exhaustive-deps
33
title: Exhaustive dependencies for query keys
44
---
55

6-
Query keys should be seen like a dependency array to your query function: Every variable that is used inside the queryFn should be added to the query key.
7-
This makes sure that queries are cached independently and that queries are refetched automatically when the variables changes.
6+
Query keys should contain the serializable values that identify the data returned by your queryFn.
7+
This makes sure that queries are cached independently and that queries are refetched automatically when those values change.
8+
9+
Function call targets are not query key dependencies. For example, `fetchTodoById(todoId)` needs `todoId` in the query key, but not `fetchTodoById`. Values referenced inside nested callbacks are still dependencies, so `promise.then(() => todoId)` also needs `todoId` in the query key.
810

911
## Rule Details
1012

@@ -29,7 +31,7 @@ Examples of **correct** code for this rule:
2931
const Component = ({ todoId }) => {
3032
const todos = useTodos()
3133
useQuery({
32-
queryKey: ['todo', todos, todoId],
34+
queryKey: ['todo', todoId],
3335
queryFn: () => todos.getTodo(todoId),
3436
})
3537
}
@@ -46,24 +48,12 @@ const todoQueries = {
4648
```
4749

4850
```tsx
49-
// with { allowlist: { variables: ["todos"] }}
50-
const Component = ({ todoId }) => {
51-
const todos = useTodos()
52-
useQuery({
53-
queryKey: ['todo', todoId],
54-
queryFn: () => todos.getTodo(todoId),
55-
})
56-
}
57-
```
58-
59-
```tsx
60-
// with { allowlist: { types: ["TodosClient"] }}
61-
class TodosClient { ... }
62-
const Component = ({ todoId }) => {
63-
const todos: TodosClient = new TodosClient()
51+
// with { allowlist: { types: ["Config"] }}
52+
class Config { ... }
53+
const Component = ({ todoId, config }: { todoId: string, config: Config }) => {
6454
useQuery({
6555
queryKey: ['todo', todoId],
66-
queryFn: () => todos.getTodo(todoId),
56+
queryFn: () => fetchTodo(todoId, config.baseUrl),
6757
})
6858
}
6959
```

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.101.2",
16+
"@tanstack/angular-query-experimental": "^5.101.4",
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.101.2",
17-
"@tanstack/angular-query-persist-client": "^5.101.2",
18-
"@tanstack/query-async-storage-persister": "^5.101.2",
16+
"@tanstack/angular-query-experimental": "^5.101.4",
17+
"@tanstack/angular-query-persist-client": "^5.101.4",
18+
"@tanstack/query-async-storage-persister": "^5.101.4",
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.101.2",
16+
"@tanstack/angular-query-experimental": "^5.101.4",
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.101.2",
17+
"@tanstack/angular-query-experimental": "^5.101.4",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"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.101.2",
16+
"@tanstack/angular-query-experimental": "^5.101.4",
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.101.2",
17+
"@tanstack/angular-query-experimental": "^5.101.4",
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.101.2",
16+
"@tanstack/angular-query-experimental": "^5.101.4",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
1919
"zone.js": "0.15.0"

examples/angular/query-options-from-a-service/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.101.2",
17+
"@tanstack/angular-query-experimental": "^5.101.4",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"

examples/angular/router/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.101.2",
17+
"@tanstack/angular-query-experimental": "^5.101.4",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
2020
"zone.js": "0.15.0"

0 commit comments

Comments
 (0)