Skip to content

Commit d26dc74

Browse files
authored
Merge branch 'alpha' into feature/use-client
2 parents 48ffbe2 + 97e1a83 commit d26dc74

File tree

290 files changed

+3057
-3714
lines changed

Some content is hidden

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

290 files changed

+3057
-3714
lines changed

.codesandbox/ci.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"installCommand": "install:csb",
3-
"sandboxes": ["/examples/react/basic-typescript", "/examples/solid/basic-typescript", "/examples/svelte/basic", "/examples/vue/basic"],
3+
"buildCommand": "build:all",
4+
"sandboxes": [
5+
"/examples/react/basic-typescript",
6+
"/examples/solid/basic-typescript",
7+
"/examples/svelte/basic",
8+
"/examples/vue/basic"
9+
],
410
"packages": ["packages/**"],
511
"node": "16"
612
}

.eslintrc

Lines changed: 0 additions & 65 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// @ts-check
2+
3+
/** @type {import('eslint').Linter.Config} */
4+
const config = {
5+
root: true,
6+
parser: '@typescript-eslint/parser',
7+
plugins: ['@typescript-eslint', 'compat', 'import'],
8+
extends: [
9+
'plugin:@typescript-eslint/eslint-recommended',
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:compat/recommended',
12+
'plugin:import/recommended',
13+
'plugin:import/typescript',
14+
'prettier',
15+
],
16+
env: {
17+
browser: true,
18+
es2020: true,
19+
},
20+
parserOptions: {
21+
tsconfigRootDir: __dirname,
22+
project: './tsconfig.json',
23+
sourceType: 'module',
24+
ecmaVersion: 2020,
25+
},
26+
settings: {
27+
'import/parsers': {
28+
'@typescript-eslint/parser': ['.ts', '.tsx'],
29+
},
30+
'import/resolver': {
31+
typescript: true,
32+
},
33+
react: {
34+
version: 'detect',
35+
},
36+
},
37+
rules: {
38+
'@typescript-eslint/ban-types': 'off',
39+
'@typescript-eslint/ban-ts-comment': 'off',
40+
'@typescript-eslint/consistent-type-imports': [
41+
'error',
42+
{ prefer: 'type-imports' },
43+
],
44+
'@typescript-eslint/explicit-module-boundary-types': 'off',
45+
'@typescript-eslint/no-empty-interface': 'off',
46+
'@typescript-eslint/no-explicit-any': 'off',
47+
'@typescript-eslint/no-non-null-assertion': 'off',
48+
'@typescript-eslint/no-unnecessary-condition': 'error',
49+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
50+
'@typescript-eslint/no-unused-vars': 'off',
51+
'@typescript-eslint/no-inferrable-types': [
52+
'error',
53+
{ ignoreParameters: true },
54+
],
55+
'import/default': 'off',
56+
'import/export': 'off',
57+
'import/newline-after-import': 'error',
58+
'import/no-cycle': 'error',
59+
'import/no-duplicates': 'off',
60+
'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
61+
'import/no-unused-modules': ['off', { unusedExports: true }],
62+
'no-redeclare': 'off',
63+
'no-shadow': 'error',
64+
},
65+
overrides: [
66+
{
67+
files: ['**/*.test.{ts,tsx}'],
68+
rules: {
69+
'@typescript-eslint/no-unnecessary-condition': 'off',
70+
},
71+
},
72+
],
73+
}
74+
75+
module.exports = config

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: ci
2-
concurrency:
3-
group: publish-${{ github.github.base_ref }}
4-
cancel-in-progress: true
2+
53
on:
64
workflow_dispatch:
75
inputs:
@@ -13,9 +11,15 @@ on:
1311
- 'main'
1412
- 'alpha'
1513
- 'beta'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
17+
cancel-in-progress: true
18+
1619
env:
17-
NX_DAEMON: false
1820
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
21+
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
22+
1923
jobs:
2024
test-and-publish:
2125
if: github.repository == 'TanStack/query' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta')
@@ -38,7 +42,7 @@ jobs:
3842
- name: Run Tests
3943
uses: nick-fields/[email protected]
4044
with:
41-
command: pnpm run test:ci --base=${{ github.event.before || 'origin/main' }}
45+
command: pnpm run test:ci
4246
timeout_minutes: 10
4347
max_attempts: 3
4448
- name: Publish

.github/workflows/pr.yml

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,96 @@
11
name: pr
2+
23
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
7+
cancel-in-progress: true
8+
39
env:
4-
NX_DAEMON: false
10+
NX_CLOUD_DISTRIBUTED_EXECUTION: true
11+
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3
512
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
13+
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
14+
615
jobs:
7-
agent:
8-
name: 'Nx Cloud Agents'
16+
main:
17+
name: Nx Cloud - Main Job
918
runs-on: ubuntu-latest
10-
timeout-minutes: 20
11-
strategy:
12-
matrix:
13-
agent: [1, 2, 3, 4]
1419
steps:
1520
- uses: actions/checkout@v3
1621
with:
1722
fetch-depth: 0
18-
ref: ${{ github.head_ref }}
19-
repository: ${{github.event.pull_request.head.repo.full_name}}
20-
- uses: pnpm/[email protected]
23+
- name: Setup pnpm
24+
uses: pnpm/[email protected]
2125
with:
2226
version: 8
23-
- uses: actions/setup-node@v3
27+
- name: Setup Node
28+
uses: actions/setup-node@v3
2429
with:
2530
node-version: 18.16.0
2631
cache: 'pnpm'
2732
- name: Install dependencies
2833
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
29-
- name: Start Nx Agent ${{ matrix.agent }}
30-
run: npx nx-cloud start-agent
31-
orchestrator:
32-
name: 'Nx Cloud Orchestrator'
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v3
36-
with:
37-
fetch-depth: 0
38-
ref: ${{ github.head_ref }}
39-
repository: ${{github.event.pull_request.head.repo.full_name}}
40-
- uses: pnpm/[email protected]
41-
with:
42-
version: 8
43-
- uses: actions/setup-node@v3
34+
- name: Get appropriate base and head commits for `nx affected` commands
35+
uses: nrwl/nx-set-shas@v3
4436
with:
45-
node-version: 18.16.0
46-
cache: 'pnpm'
47-
- name: Install dependencies
48-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
49-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
50-
uses: nrwl/nx-set-shas@v2
37+
main-branch-name: 'alpha'
5138
- run: |
5239
echo "BASE: ${{ env.NX_BASE }}"
5340
echo "HEAD: ${{ env.NX_HEAD }}"
5441
- name: Start CI Orchestrator
5542
run: npx nx-cloud start-ci-run
56-
- name: Run All Checks
43+
- name: Run Tests
5744
uses: nick-fields/[email protected]
58-
env:
59-
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
6045
with:
6146
timeout_minutes: 5
6247
max_attempts: 3
63-
command: npx nx affected --targets=test:eslint,test:types,test:build,test:lib --base=${{ github.event.pull_request.base.sha }}
48+
command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build
6449
- name: Stop Agents
6550
run: npx nx-cloud stop-all-agents
6651
- name: Upload coverage to Codecov
6752
uses: codecov/codecov-action@v3
53+
agents:
54+
name: Nx Cloud - Agents
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
strategy:
58+
matrix:
59+
agent: [1, 2, 3]
60+
steps:
61+
- uses: actions/checkout@v3
62+
with:
63+
fetch-depth: 0
64+
- name: Setup pnpm
65+
uses: pnpm/[email protected]
66+
with:
67+
version: 8
68+
- name: Setup Node
69+
uses: actions/setup-node@v3
70+
with:
71+
node-version: 18.16.0
72+
cache: 'pnpm'
73+
- name: Install dependencies
74+
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
75+
- name: Start Nx Agent ${{ matrix.agent }}
76+
run: npx nx-cloud start-agent
6877
format:
69-
name: 'Format'
78+
name: Format
7079
runs-on: ubuntu-latest
7180
steps:
7281
- uses: actions/checkout@v3
7382
with:
7483
fetch-depth: 0
75-
ref: ${{ github.head_ref }}
76-
repository: ${{github.event.pull_request.head.repo.full_name}}
77-
- uses: pnpm/[email protected]
84+
- name: Setup pnpm
85+
uses: pnpm/[email protected]
7886
with:
7987
version: 8
80-
- uses: actions/setup-node@v3
88+
- name: Setup Node
89+
uses: actions/setup-node@v3
8190
with:
8291
node-version: 18.16.0
8392
cache: 'pnpm'
8493
- name: Install dependencies
8594
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
86-
- run: pnpm run test:format --base=${{ github.event.pull_request.base.sha }}
95+
- name: Run prettier
96+
run: pnpm run test:format

.prettierignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
/packages/svelte-query/.svelte-kit
2-
/packages/react-query/build
1+
**/.next
2+
**/.svelte-kit
3+
**/build
4+
**/coverage
5+
**/dist
36
/packages/codemods/**/__testfixtures__

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ If you have been assigned to fix an issue or develop a new feature, please follo
2727
- Submit PR for review.
2828

2929
### Running examples
30+
3031
- Make sure you've installed the dependencies by running `$ pnpm install` in the repo's root directory.
3132
- If you want to run the example against your local changes, run `pnpm run watch` in the repo's root directory. Otherwise, it will be run against the latest TanStack Query release.
3233
- Run `pnpm run dev` in the selected examples' directory.
3334

3435
#### Note on `examples/react-native`
36+
3537
React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
3638

3739
#### Note on standalone execution
40+
3841
If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Query release.
3942

4043
## Online one-click setup

babel.config.js renamed to babel.config.cjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,15 @@ module.exports = {
3434
].filter(Boolean),
3535
overrides: [
3636
{
37-
exclude: [
38-
'./packages/solid-query/**',
39-
'./packages/query-devtools/**',
40-
'./packages/svelte-query/**',
41-
'./packages/vue-query/**',
37+
include: [
38+
'./packages/react-query/**',
39+
'./packages/react-query-devtools/**',
40+
'./packages/react-query-persist-client/**',
4241
],
4342
presets: ['@babel/react'],
4443
},
4544
{
46-
include: ['./packages/solid-query/**', './packages/query-devtools/**'],
45+
include: ['./packages/query-devtools/**', './packages/solid-query/**'],
4746
presets: ['babel-preset-solid'],
4847
},
4948
],

docs/react/guides/migrating-to-v5.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ Custom loggers were already deprecated in 4 and have been removed in this versio
177177

178178
We have updated our browserslist to produce a more modern, performant and smaller bundle. You can read about the requirements [here](../installation#requirements).
179179

180+
### Supported Bundlers
181+
182+
We have removed the legacy `.esm.js` output, which was used by bundlers which didn't recognise the modern `.mjs` extension such as Webpack v4. If you are still using Webpack v4, you can continue to use TanStack Query v4, or upgrade to Webpack v5 or another bundler.
183+
180184
### Private class fields and methods
181185

182186
TanStack Query has always had private fields and methods on classes, but they weren't really private - they were just private in `TypeScript`. We now use [ECMAScript Private class features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields), which means those fields are now truly private and can't be accessed from the outside at runtime.

0 commit comments

Comments
 (0)