Skip to content

Commit af7e087

Browse files
committed
Merge branch 'main' into v5
# Conflicts: # .github/workflows/pr.yml # packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.test.ts # packages/eslint-plugin-query/src/rules/prefer-query-object-syntax/prefer-query-object-syntax.ts # packages/query-core/src/mutation.ts # packages/query-core/src/mutationCache.ts # packages/query-core/src/queryCache.ts # packages/query-core/src/queryClient.ts
2 parents b66f92a + 21439e6 commit af7e087

File tree

21 files changed

+45
-47
lines changed

21 files changed

+45
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v3
2121
with:
2222
fetch-depth: '0'
23-
- uses: pnpm/[email protected].2
23+
- uses: pnpm/[email protected].4
2424
with:
2525
version: 7
2626
- uses: actions/setup-node@v3
@@ -45,4 +45,4 @@ jobs:
4545
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4646
TAG: ${{ inputs.tag }}
4747
- name: Upload coverage to Codecov
48-
uses: codecov/codecov-action@v2
48+
uses: codecov/codecov-action@v3

.github/workflows/pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v3
9-
- uses: pnpm/[email protected].2
9+
- uses: pnpm/[email protected].4
1010
with:
1111
version: 7
1212
- uses: actions/setup-node@v3
@@ -17,13 +17,13 @@ jobs:
1717
run: pnpm --filter "./packages/**" --filter query --prefer-offline install
1818
- run: pnpm run test:lib
1919
- name: Upload coverage to Codecov
20-
uses: codecov/codecov-action@v2
20+
uses: codecov/codecov-action@v3
2121
lint:
2222
name: 'Lint'
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v3
26-
- uses: pnpm/[email protected].2
26+
- uses: pnpm/[email protected].4
2727
with:
2828
version: 7
2929
- uses: actions/setup-node@v3
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
steps:
4040
- uses: actions/checkout@v3
41-
- uses: pnpm/[email protected].2
41+
- uses: pnpm/[email protected].4
4242
with:
4343
version: 7
4444
- uses: actions/setup-node@v3
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v3
56-
- uses: pnpm/[email protected].2
56+
- uses: pnpm/[email protected].4
5757
with:
5858
version: 7
5959
- uses: actions/setup-node@v3
@@ -68,7 +68,7 @@ jobs:
6868
runs-on: ubuntu-latest
6969
steps:
7070
- uses: actions/checkout@v3
71-
- uses: pnpm/[email protected].2
71+
- uses: pnpm/[email protected].4
7272
with:
7373
version: 7
7474
- uses: actions/setup-node@v3

docs/react/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ id: overview
33
title: Overview
44
---
55

6-
React Query is often described as the missing data-fetching library for React, but in more technical terms, it makes **fetching, caching, synchronizing and updating server state** in your React applications a breeze.
6+
TanStack Query (FKA React Query) is often described as the missing data-fetching library for web applications, but in more technical terms, it makes **fetching, caching, synchronizing and updating server state** in your web applications a breeze.
77

88
## Motivation
99

10-
Out of the box, React applications **do not** come with an opinionated way of fetching or updating data from your components so developers end up building their own ways of fetching data. This usually means cobbling together component-based state and effect using React hooks, or using more general purpose state management libraries to store and provide asynchronous data throughout their apps.
10+
Most core web frameworks **do not** come with an opinionated way of fetching or updating data in a wholistic way. Because of this developers end up building either meta-frameworks which encapsulate strict opinions about data-fetching, or they invent their own ways of doing fetching data. This usually means cobbling together component-based state and side-effects, or using more general purpose state management libraries to store and provide asynchronous data throughout their apps.
1111

1212
While most traditional state management libraries are great for working with client state, they are **not so great at working with async or server state**. This is because **server state is totally different**. For starters, server state:
1313

docs/react/reference/useQuery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const {
2121
isPlaceholderData,
2222
isRefetchError,
2323
isRefetching,
24+
isInitialLoading,
2425
isStale,
2526
isSuccess,
2627
refetch,

packages/eslint-plugin-query/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/eslint-plugin-query",
3-
"version": "4.24.0",
3+
"version": "4.24.7",
44
"description": "ESLint plugin for TanStack Query",
55
"author": "Eliya Cohen",
66
"license": "MIT",

packages/query-async-storage-persister/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/query-async-storage-persister",
3-
"version": "4.24.3",
3+
"version": "4.24.6",
44
"description": "A persister for asynchronous storages, to be used with TanStack/Query",
55
"author": "tannerlinsley",
66
"license": "MIT",

packages/query-broadcast-client-experimental/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/query-broadcast-client-experimental",
3-
"version": "4.24.3",
3+
"version": "4.24.6",
44
"description": "An experimental plugin to for broadcasting the state of your queryClient between browser tabs/windows",
55
"author": "tannerlinsley",
66
"license": "MIT",

packages/query-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/query-core",
3-
"version": "4.24.3",
3+
"version": "4.24.6",
44
"description": "The framework agnostic core that powers TanStack Query",
55
"author": "tannerlinsley",
66
"license": "MIT",

packages/query-core/src/mutation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,8 @@ export class Mutation<
144144
}
145145
}
146146

147-
continue(): Promise<TData> {
148-
if (this.#retryer) {
149-
this.#retryer.continue()
150-
return this.#retryer.promise
151-
}
152-
return this.execute()
147+
continue(): Promise<unknown> {
148+
return this.#retryer?.continue() ?? this.execute()
153149
}
154150

155151
async execute(): Promise<TData> {

packages/query-core/src/mutationCache.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type MutationCacheListener = (event: MutationCacheNotifyEvent) => void
7777
export class MutationCache extends Subscribable<MutationCacheListener> {
7878
#mutations: Mutation<any, any, any, any>[]
7979
#mutationId: number
80-
#resuming: Promise<void> | undefined
80+
#resuming: Promise<unknown> | undefined
8181

8282
constructor(public config: MutationCacheConfig = {}) {
8383
super()
@@ -151,21 +151,21 @@ export class MutationCache extends Subscribable<MutationCacheListener> {
151151
})
152152
}
153153

154-
resumePausedMutations(): Promise<void> {
155-
if (!this.#resuming) {
156-
const pausedMutations = this.#mutations.filter((x) => x.state.isPaused)
157-
this.#resuming = notifyManager
158-
.batch(() =>
154+
resumePausedMutations(): Promise<unknown> {
155+
this.#resuming = (this.#resuming ?? Promise.resolve())
156+
.then(() => {
157+
const pausedMutations = this.#mutations.filter((x) => x.state.isPaused)
158+
return notifyManager.batch(() =>
159159
pausedMutations.reduce(
160160
(promise, mutation) =>
161161
promise.then(() => mutation.continue().catch(noop)),
162-
Promise.resolve(),
162+
Promise.resolve() as Promise<unknown>,
163163
),
164164
)
165-
.then(() => {
166-
this.#resuming = undefined
167-
})
168-
}
165+
})
166+
.then(() => {
167+
this.#resuming = undefined
168+
})
169169

170170
return this.#resuming
171171
}

0 commit comments

Comments
 (0)