Skip to content

Commit fc866bd

Browse files
Merge branch 'alpha' into feat/vue-shallow-ref
2 parents 2b60086 + 6687a32 commit fc866bd

File tree

281 files changed

+5221
-4409
lines changed

Some content is hidden

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

281 files changed

+5221
-4409
lines changed

.codesandbox/ci.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"installCommand": "install:csb",
3+
"buildCommand": "build:all",
34
"sandboxes": [
45
"/examples/react/basic-typescript",
56
"/examples/solid/basic-typescript",

.eslintrc.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
const config = {
55
root: true,
66
parser: '@typescript-eslint/parser',
7-
plugins: ['@typescript-eslint', 'import'],
7+
plugins: ['@typescript-eslint', 'compat', 'import'],
88
extends: [
99
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
11+
'plugin:compat/recommended',
1112
'plugin:import/recommended',
1213
'plugin:import/typescript',
1314
'prettier',
1415
],
1516
env: {
1617
browser: true,
18+
es2020: true,
1719
},
1820
parserOptions: {
1921
tsconfigRootDir: __dirname,
20-
project: './tsconfig.base.json',
22+
project: './tsconfig.json',
2123
sourceType: 'module',
2224
ecmaVersion: 2020,
2325
},
@@ -45,6 +47,7 @@ const config = {
4547
'@typescript-eslint/no-non-null-assertion': 'off',
4648
'@typescript-eslint/no-unnecessary-condition': 'error',
4749
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
50+
'@typescript-eslint/no-unused-vars': 'off',
4851
'@typescript-eslint/no-inferrable-types': [
4952
'error',
5053
{ ignoreParameters: true },

.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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
**/build
44
**/coverage
55
**/dist
6-
/packages/codemods/**/__testfixtures__
6+
**/codemods/**/__testfixtures__

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/community/suspensive-react-query.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ id: suspensive-react-query
33
title: Suspensive React Query
44
---
55

6-
Typesafe useQuery, useInfiniteQuery with default suspense option.
6+
Typesafe useQuery, useQueries, useInfiniteQuery with default suspense option.
77

8-
Use @suspensive/react-query, delegate loading and error handling to the outside of the component with useSuspenseQuery and useSuspenseInfiniteQuery, and focus on success inside the component.
8+
Use @suspensive/react-query, delegate loading and error handling to the outside of the component with [useSuspenseQuery](https://suspensive.org/docs/react-query/src/useSuspenseQuery.i18n), [useSuspenseQueries](https://suspensive.org/docs/react-query/src/useSuspenseQueries.i18n) and [useSuspenseInfiniteQuery](https://suspensive.org/docs/react-query/src/useSuspenseInfiniteQuery.i18n), and focus on success inside the component.
99

1010
You don't even need to use the isSuccess flag.
1111

1212
## Installation
13+
1314
You can install @suspensive/react-query via [NPM](https://www.npmjs.com/package/@suspensive/react-query).
1415

1516
```bash
16-
$ npm i @suspensive/react @suspensive/react-query
17+
$ npm i @suspensive/react-query
1718
# or
18-
$ pnpm add @suspensive/react @suspensive/react-query
19+
$ pnpm add @suspensive/react-query
1920
# or
20-
$ yarn add @suspensive/react @suspensive/react-query
21+
$ yarn add @suspensive/react-query
2122
```
2223

2324
### Motivation
@@ -28,7 +29,9 @@ If you turn suspense mode on in @tanstack/react-query, You can use useQuery with
2829
import { useQuery } from '@tanstack/react-query'
2930

3031
const Example = () => {
31-
const query = useQuery(queryKey, queryFn, {
32+
const query = useQuery({
33+
queryKey,
34+
queryFn,
3235
suspense: true,
3336
})
3437

@@ -55,7 +58,10 @@ In addition, this hook's options have default suspense: true. and you can provid
5558
import { useSuspenseQuery } from '@suspensive/react-query'
5659

5760
const Example = () => {
58-
const query = useSuspenseQuery(queryKey, queryFn, options) // suspense:true is default.
61+
const query = useSuspenseQuery({
62+
queryKey,
63+
queryFn,
64+
}) // suspense:true is default.
5965

6066
// No need to do type narrowing by isSuccess
6167
query.data // TData
@@ -66,4 +72,6 @@ const Example = () => {
6672

6773
Now, we can concentrate component as any fetching will be always success in component.
6874

69-
Check the complete documentation on [GitHub](https://github.com/suspensive/react).
75+
### More Information
76+
77+
Check the complete documentation on [Suspensive Official Docs Site](https://suspensive.org/) and also welcome Pull Request on [Suspensive GitHub](https://github.com/suspensive/react)

0 commit comments

Comments
 (0)