Skip to content

Commit 5898ec0

Browse files
authored
feat: v5 release (#6163)
BREAKING CHANGE
2 parents 3a6ffb3 + eb462ac commit 5898ec0

File tree

742 files changed

+49133
-30271
lines changed

Some content is hidden

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

742 files changed

+49133
-30271
lines changed

.browserslistrc

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

.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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// @ts-check
2+
3+
/** @type {import('eslint').Linter.Config} */
14
const config = {
25
root: true,
36
parser: '@typescript-eslint/parser',
@@ -15,7 +18,7 @@ const config = {
1518
},
1619
parserOptions: {
1720
tsconfigRootDir: __dirname,
18-
project: './tsconfig.base.json',
21+
project: './tsconfig.json',
1922
sourceType: 'module',
2023
ecmaVersion: 2020,
2124
},
@@ -31,6 +34,7 @@ const config = {
3134
},
3235
},
3336
rules: {
37+
'@typescript-eslint/array-type': ['error', { default: 'generic', readonly: 'generic' }],
3438
'@typescript-eslint/ban-types': 'off',
3539
'@typescript-eslint/ban-ts-comment': 'off',
3640
'@typescript-eslint/consistent-type-imports': [
@@ -42,6 +46,7 @@ const config = {
4246
'@typescript-eslint/no-explicit-any': 'off',
4347
'@typescript-eslint/no-non-null-assertion': 'off',
4448
'@typescript-eslint/no-unnecessary-condition': 'error',
49+
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
4550
'@typescript-eslint/no-unused-vars': 'off',
4651
'@typescript-eslint/no-inferrable-types': [
4752
'error',

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
- name: Run Tests
4545
uses: nick-fields/[email protected]
4646
with:
47-
command: pnpm run test:ci --base=${{ github.event.before }}
47+
command: pnpm run test:ci
4848
timeout_minutes: 10
4949
max_attempts: 3
5050
- name: Publish

.github/workflows/pr.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Get appropriate base and head commits for `nx affected` commands
3636
uses: nrwl/nx-set-shas@v3
3737
with:
38-
main-branch-name: 'main'
38+
main-branch-name: 'rc'
3939
- run: |
4040
echo "BASE: ${{ env.NX_BASE }}"
4141
echo "HEAD: ${{ env.NX_HEAD }}"
@@ -46,7 +46,7 @@ jobs:
4646
with:
4747
timeout_minutes: 5
4848
max_attempts: 3
49-
command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build
49+
command: npx nx affected --targets=test:eslint,test:lib,test:types,test:build,test:bundle
5050
- name: Stop Agents
5151
run: npx nx-cloud stop-all-agents
5252
- name: Upload coverage to Codecov
@@ -97,33 +97,3 @@ jobs:
9797
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
9898
- name: Run prettier
9999
run: pnpm run test:format
100-
test-react-17:
101-
name: 'Test React 17'
102-
runs-on: ubuntu-latest
103-
steps:
104-
- uses: actions/checkout@v3
105-
with:
106-
fetch-depth: 0
107-
ref: ${{ github.head_ref }}
108-
repository: ${{github.event.pull_request.head.repo.full_name}}
109-
- uses: pnpm/[email protected]
110-
with:
111-
version: 8
112-
- uses: actions/setup-node@v3
113-
with:
114-
node-version-file: .nvmrc
115-
cache: pnpm
116-
cache-dependency-path: pnpm-lock.yaml
117-
- name: Install dependencies
118-
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
119-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
120-
uses: nrwl/nx-set-shas@v2
121-
- name: Run Tests
122-
uses: nick-fields/[email protected]
123-
with:
124-
timeout_minutes: 5
125-
max_attempts: 3
126-
command: npx nx affected --targets=test:lib --base=${{ github.event.pull_request.base.sha }}
127-
env:
128-
NX_CLOUD_DISTRIBUTED_EXECUTION: false
129-
REACTJS_VERSION: 17

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.19.0
1+
v18.16.0

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<img src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />
22

3-
![TanStack Query Header](https://github.com/TanStack/query/raw/beta/media/repo-header.png)
3+
![TanStack Query Header](https://github.com/TanStack/query/raw/rc/media/repo-header.png)
44

55
Hooks for fetching, caching and updating asynchronous data in React, Solid, Svelte and Vue
66

@@ -12,8 +12,8 @@ Hooks for fetching, caching and updating asynchronous data in React, Solid, Svel
1212
<img src="https://github.com/TanStack/query/workflows/react-query%20tests/badge.svg" />
1313
</a><a href="https://www.npmjs.com/package/@tanstack/query-core" target="\_parent">
1414
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/query-core.svg" />
15-
</a><a href="https://bundlephobia.com/package/@tanstack/react-query@latest" target="\_parent">
16-
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-query" />
15+
</a><a href="https://bundlejs.com/?q=%40tanstack%2Freact-query%40rc&config=%7B%22esbuild%22%3A%7B%22external%22%3A%5B%22react%22%2C%22react-dom%22%5D%7D%7D&badge=" target="\_parent">
16+
<img alt="" src="https://deno.bundlejs.com/?q=@tanstack/react-query@rc&config={%22esbuild%22:{%22external%22:[%22react%22,%22react-dom%22]}}&badge=detailed" />
1717
</a><a href="#badge">
1818
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
1919
</a><a href="https://github.com/TanStack/query/discussions">

babel.config.js

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

docs/config.json

Lines changed: 76 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@
112112
"label": "Placeholder Query Data",
113113
"to": "react/guides/placeholder-query-data"
114114
},
115-
{
116-
"label": "Prefetching",
117-
"to": "react/guides/prefetching"
118-
},
119115
{
120116
"label": "Mutations",
121117
"to": "react/guides/mutations"
@@ -149,9 +145,21 @@
149145
"to": "react/guides/filters"
150146
},
151147
{
152-
"label": "SSR & Next.js",
148+
"label": "Performance & Request Waterfalls",
149+
"to": "react/guides/request-waterfalls"
150+
},
151+
{
152+
"label": "Prefetching & Router Integration",
153+
"to": "react/guides/prefetching"
154+
},
155+
{
156+
"label": "Server Rendering & Hydration",
153157
"to": "react/guides/ssr"
154158
},
159+
{
160+
"label": "Advanced Server Rendering",
161+
"to": "react/guides/advanced-ssr"
162+
},
155163
{
156164
"label": "Caching",
157165
"to": "react/guides/caching"
@@ -164,10 +172,6 @@
164172
"label": "Suspense",
165173
"to": "react/guides/suspense"
166174
},
167-
{
168-
"label": "Custom Logger",
169-
"to": "react/guides/custom-logger"
170-
},
171175
{
172176
"label": "Testing",
173177
"to": "react/guides/testing"
@@ -177,12 +181,16 @@
177181
"to": "react/guides/does-this-replace-client-state"
178182
},
179183
{
180-
"label": "Migrating to React Query 3",
184+
"label": "Migrating to v3",
181185
"to": "react/guides/migrating-to-react-query-3"
182186
},
183187
{
184-
"label": "Migrating to React Query 4",
188+
"label": "Migrating to v4",
185189
"to": "react/guides/migrating-to-react-query-4"
190+
},
191+
{
192+
"label": "Migrating to v5",
193+
"to": "react/guides/migrating-to-v5"
186194
}
187195
]
188196
},
@@ -235,8 +243,12 @@
235243
"to": "react/examples/react/auto-refetching"
236244
},
237245
{
238-
"label": "Optimistic Updates in TypeScript",
239-
"to": "react/examples/react/optimistic-updates-typescript"
246+
"label": "Optimistic Updates (UI)",
247+
"to": "react/examples/react/optimistic-updates-ui"
248+
},
249+
{
250+
"label": "Optimistic Updates (Cache)",
251+
"to": "react/examples/react/optimistic-updates-cache"
240252
},
241253
{
242254
"label": "Pagination",
@@ -246,6 +258,10 @@
246258
"label": "Load-More & Infinite Scroll",
247259
"to": "react/examples/react/load-more-infinite-scroll"
248260
},
261+
{
262+
"label": "Infinite query with Max pages",
263+
"to": "react/examples/react/infinite-query-with-max-pages"
264+
},
249265
{
250266
"label": "Suspense",
251267
"to": "react/examples/react/suspense"
@@ -274,6 +290,10 @@
274290
"label": "Next.js",
275291
"to": "react/examples/react/nextjs"
276292
},
293+
{
294+
"label": "Next.js app with streaming",
295+
"to": "react/examples/react/nextjs-suspense-streaming"
296+
},
277297
{
278298
"label": "React Native",
279299
"to": "react/examples/react/react-native"
@@ -303,10 +323,6 @@
303323
"label": "Exhaustive Deps",
304324
"to": "react/eslint/exhaustive-deps"
305325
},
306-
{
307-
"label": "Prefer object syntax",
308-
"to": "react/eslint/prefer-query-object-syntax"
309-
},
310326
{
311327
"label": "Stable Query Client",
312328
"to": "react/eslint/stable-query-client"
@@ -331,6 +347,10 @@
331347
{
332348
"label": "broadcastQueryClient (Experimental)",
333349
"to": "react/plugins/broadcastQueryClient"
350+
},
351+
{
352+
"label": "createPersister (Experimental)",
353+
"to": "react/plugins/createPersister"
334354
}
335355
]
336356
},
@@ -361,6 +381,10 @@
361381
"label": "useIsMutating",
362382
"to": "react/reference/useIsMutating"
363383
},
384+
{
385+
"label": "useMutationState",
386+
"to": "react/reference/useMutationState"
387+
},
364388
{
365389
"label": "QueryClient",
366390
"to": "react/reference/QueryClient"
@@ -426,6 +450,35 @@
426450
{
427451
"label": "Overview",
428452
"to": "solid/overview"
453+
},
454+
{
455+
"label": "Devtools",
456+
"to": "solid/devtools"
457+
}
458+
]
459+
},
460+
{
461+
"label": "Examples",
462+
"children": [
463+
{
464+
"label": "Simple",
465+
"to": "solid/examples/solid/simple"
466+
},
467+
{
468+
"label": "Basic",
469+
"to": "solid/examples/solid/basic-typescript"
470+
},
471+
{
472+
"label": "Basic w/ GraphQL-Request",
473+
"to": "solid/examples/solid/basic-graphql-request"
474+
},
475+
{
476+
"label": "Default Query Function",
477+
"to": "solid/examples/solid/default-query-function"
478+
},
479+
{
480+
"label": "Solid Start",
481+
"to": "solid/examples/solid/solid-start-streaming"
429482
}
430483
]
431484
}
@@ -579,8 +632,8 @@
579632
"to": "vue/guides/suspense"
580633
},
581634
{
582-
"label": "Custom Logger",
583-
"to": "vue/guides/custom-logger"
635+
"label": "Testing",
636+
"to": "vue/guides/testing"
584637
},
585638
{
586639
"label": "Custom Client",
@@ -589,6 +642,10 @@
589642
{
590643
"label": "Does this replace [Vuex, Pinia]?",
591644
"to": "vue/guides/does-this-replace-client-state"
645+
},
646+
{
647+
"label": "Migrating to v5",
648+
"to": "vue/guides/migrating-to-v5"
592649
}
593650
]
594651
},

docs/react/adapters/react-query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function Example() {
1616

1717
return (
1818
<div>
19-
{query.isLoading
19+
{query.isPending
2020
? 'Loading...'
2121
: query.isError
2222
? 'Error!'

0 commit comments

Comments
 (0)