Skip to content

Commit a69fb76

Browse files
Merge branch 'main' into svelte-5-adapter
2 parents c1e67ed + 0f5f643 commit a69fb76

File tree

84 files changed

+5642
-5103
lines changed

Some content is hidden

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

84 files changed

+5642
-5103
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Release
33
on:
44
push:
55
branches: [main, alpha, beta, rc, v4]
6+
repository_dispatch:
7+
types: [release]
68

79
concurrency:
810
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
@@ -14,6 +16,7 @@ env:
1416
permissions:
1517
contents: write
1618
id-token: write
19+
pull-requests: write
1720

1821
jobs:
1922
release:
@@ -34,27 +37,37 @@ jobs:
3437
- name: Stop Nx Agents
3538
if: ${{ always() }}
3639
run: npx nx-cloud stop-all-agents
37-
- name: Version Packages
38-
run: pnpm run changeset:version
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
- name: Commit version files
40+
- name: Check for Changesets marked as major
41+
id: major
4242
run: |
43-
if [[ -n "$(git status --porcelain)" ]]; then
44-
git config --global user.name 'Tanner Linsley'
45-
git config --global user.email '[email protected]'
46-
git add -A
47-
git commit -m "ci: Version Packages"
48-
git push
49-
fi
43+
echo "found=false" >> $GITHUB_OUTPUT
44+
regex="(major)"
45+
shopt -s nullglob
46+
for file in .changeset/*.md; do
47+
if [[ $(cat $file) =~ $regex ]]; then
48+
echo "found=true" >> $GITHUB_OUTPUT
49+
fi
50+
done
51+
- name: Run Changesets (version or publish)
52+
id: changesets
53+
uses: changesets/[email protected]
54+
with:
55+
version: pnpm run changeset:version
56+
publish: pnpm run changeset:publish
57+
commit: 'ci: Version Packages'
58+
title: 'ci: Version Packages'
5059
env:
5160
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
- name: Publish Packages
61+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
- name: Auto-merge Changesets PR
63+
if: steps.changesets.outputs.hasChangesets == 'true' && steps.major.outputs.found == 'false'
5364
run: |
54-
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
55-
pnpm run changeset:publish
65+
gh pr merge --squash "$PR_NUMBER"
66+
gh api --method POST /repos/$REPO/dispatches -f 'event_type=release'
5667
env:
57-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
REPO: ${{ github.repository }}
70+
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
5871
- name: Upload coverage to Codecov
5972
uses: codecov/[email protected]
6073
with:

docs/eslint/eslint-plugin-query.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,4 @@ Alternatively, add `@tanstack/query` to the plugins section, and configure the r
9999
- [@tanstack/query/no-unstable-deps](../no-unstable-deps.md)
100100
- [@tanstack/query/infinite-query-property-order](../infinite-query-property-order.md)
101101
- [@tanstack/query/no-void-query-fn](../no-void-query-fn.md)
102+
- [@tanstack/query/mutation-property-order](../mutation-property-order.md)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
id: mutation-property-order
3+
title: Ensure correct order of inference-sensitive properties in useMutation()
4+
---
5+
6+
For the following functions, the property order of the passed in object matters due to type inference:
7+
8+
- `useMutation()`
9+
10+
The correct property order is as follows:
11+
12+
- `onMutate`
13+
- `onError`
14+
- `onSettled`
15+
16+
All other properties are insensitive to the order as they do not depend on type inference.
17+
18+
## Rule Details
19+
20+
Examples of **incorrect** code for this rule:
21+
22+
```tsx
23+
/* eslint "@tanstack/query/mutation-property-order": "warn" */
24+
import { useMutation } from '@tanstack/react-query'
25+
26+
const mutation = useMutation({
27+
mutationFn: () => Promise.resolve('success'),
28+
onSettled: () => {
29+
results.push('onSettled-promise')
30+
return Promise.resolve('also-ignored') // Promise<string> (should be ignored)
31+
},
32+
onMutate: async () => {
33+
results.push('onMutate-async')
34+
await sleep(1)
35+
return { backup: 'async-data' }
36+
},
37+
onError: async () => {
38+
results.push('onError-async-start')
39+
await sleep(1)
40+
results.push('onError-async-end')
41+
},
42+
})
43+
```
44+
45+
Examples of **correct** code for this rule:
46+
47+
```tsx
48+
/* eslint "@tanstack/query/mutation-property-order": "warn" */
49+
import { useMutation } from '@tanstack/react-query'
50+
51+
const mutation = useMutation({
52+
mutationFn: () => Promise.resolve('success'),
53+
onMutate: async () => {
54+
results.push('onMutate-async')
55+
await sleep(1)
56+
return { backup: 'async-data' }
57+
},
58+
onError: async () => {
59+
results.push('onError-async-start')
60+
await sleep(1)
61+
results.push('onError-async-end')
62+
},
63+
onSettled: () => {
64+
results.push('onSettled-promise')
65+
return Promise.resolve('also-ignored') // Promise<string> (should be ignored)
66+
},
67+
})
68+
```
69+
70+
## Attributes
71+
72+
- [x] ✅ Recommended
73+
- [x] 🔧 Fixable

examples/angular/auto-refetching/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
},
1010
"private": true,
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
1616
"@tanstack/angular-query-experimental": "^5.90.2",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
19-
"zone.js": "0.15.0"
19+
"zone.js": "0.15.1"
2020
},
2121
"devDependencies": {
22-
"@angular/build": "^20.0.0",
23-
"@angular/cli": "^20.0.0",
24-
"@angular/compiler-cli": "^20.0.0",
22+
"@angular/build": "^20.3.3",
23+
"@angular/cli": "^20.3.3",
24+
"@angular/compiler-cli": "^20.3.2",
2525
"typescript": "5.8.3"
2626
}
2727
}

examples/angular/basic-persister/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
},
1010
"private": true,
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
1616
"@tanstack/angular-query-experimental": "^5.90.2",
1717
"@tanstack/angular-query-persist-client": "^5.62.7",
1818
"@tanstack/query-async-storage-persister": "^5.90.2",
1919
"rxjs": "^7.8.2",
2020
"tslib": "^2.8.1",
21-
"zone.js": "0.15.0"
21+
"zone.js": "0.15.1"
2222
},
2323
"devDependencies": {
24-
"@angular/build": "^20.0.0",
25-
"@angular/cli": "^20.0.0",
26-
"@angular/compiler-cli": "^20.0.0",
24+
"@angular/build": "^20.3.3",
25+
"@angular/cli": "^20.3.3",
26+
"@angular/compiler-cli": "^20.3.2",
2727
"typescript": "5.8.3"
2828
}
2929
}

examples/angular/basic/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
},
1010
"private": true,
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
1616
"@tanstack/angular-query-experimental": "^5.90.2",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
19-
"zone.js": "0.15.0"
19+
"zone.js": "0.15.1"
2020
},
2121
"devDependencies": {
22-
"@angular/build": "^20.0.0",
23-
"@angular/cli": "^20.0.0",
24-
"@angular/compiler-cli": "^20.0.0",
22+
"@angular/build": "^20.3.3",
23+
"@angular/cli": "^20.3.3",
24+
"@angular/compiler-cli": "^20.3.2",
2525
"typescript": "5.8.3"
2626
}
2727
}

examples/angular/devtools-panel/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
},
1010
"private": true,
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
16-
"@angular/router": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
16+
"@angular/router": "^20.3.2",
1717
"@tanstack/angular-query-experimental": "^5.90.2",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
20-
"zone.js": "0.15.0"
20+
"zone.js": "0.15.1"
2121
},
2222
"devDependencies": {
23-
"@angular/build": "^20.0.0",
24-
"@angular/cli": "^20.0.0",
25-
"@angular/compiler-cli": "^20.0.0",
23+
"@angular/build": "^20.3.3",
24+
"@angular/cli": "^20.3.3",
25+
"@angular/compiler-cli": "^20.3.2",
2626
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/infinite-query-with-max-pages/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
"watch": "ng build --watch --configuration development"
1010
},
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
1616
"@tanstack/angular-query-experimental": "^5.90.2",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
19-
"zone.js": "0.15.0"
19+
"zone.js": "0.15.1"
2020
},
2121
"devDependencies": {
22-
"@angular/build": "^20.0.0",
23-
"@angular/cli": "^20.0.0",
24-
"@angular/compiler-cli": "^20.0.0",
22+
"@angular/build": "^20.3.3",
23+
"@angular/cli": "^20.3.3",
24+
"@angular/compiler-cli": "^20.3.2",
2525
"typescript": "5.8.3"
2626
}
2727
}

examples/angular/optimistic-updates/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
},
1010
"private": true,
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/forms": "^20.0.0",
16-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/forms": "^20.3.2",
16+
"@angular/platform-browser": "^20.3.2",
1717
"@tanstack/angular-query-experimental": "^5.90.2",
1818
"rxjs": "^7.8.2",
1919
"tslib": "^2.8.1",
20-
"zone.js": "0.15.0"
20+
"zone.js": "0.15.1"
2121
},
2222
"devDependencies": {
23-
"@angular/build": "^20.0.0",
24-
"@angular/cli": "^20.0.0",
25-
"@angular/compiler-cli": "^20.0.0",
23+
"@angular/build": "^20.3.3",
24+
"@angular/cli": "^20.3.3",
25+
"@angular/compiler-cli": "^20.3.2",
2626
"typescript": "5.8.3"
2727
}
2828
}

examples/angular/pagination/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
"watch": "ng build --watch --configuration development"
1010
},
1111
"dependencies": {
12-
"@angular/common": "^20.0.0",
13-
"@angular/compiler": "^20.0.0",
14-
"@angular/core": "^20.0.0",
15-
"@angular/platform-browser": "^20.0.0",
12+
"@angular/common": "^20.3.2",
13+
"@angular/compiler": "^20.3.2",
14+
"@angular/core": "^20.3.2",
15+
"@angular/platform-browser": "^20.3.2",
1616
"@tanstack/angular-query-experimental": "^5.90.2",
1717
"rxjs": "^7.8.2",
1818
"tslib": "^2.8.1",
19-
"zone.js": "0.15.0"
19+
"zone.js": "0.15.1"
2020
},
2121
"devDependencies": {
22-
"@angular/build": "^20.0.0",
23-
"@angular/cli": "^20.0.0",
24-
"@angular/compiler-cli": "^20.0.0",
22+
"@angular/build": "^20.3.3",
23+
"@angular/cli": "^20.3.3",
24+
"@angular/compiler-cli": "^20.3.2",
2525
"typescript": "5.8.3"
2626
}
2727
}

0 commit comments

Comments
 (0)