Skip to content

Commit

Permalink
fix(react-query): deprecate QueryErrorBoundary
Browse files Browse the repository at this point in the history
related #1325
  • Loading branch information
manudeli committed Nov 14, 2024
1 parent d2fdc90 commit 105f0db
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 146 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Key features: Suspense, ErrorBoundary, ErrorBoundaryGroup, Delay, and more.

### [@suspensive/react-query](https://suspensive.org/docs/react-query/motivation) [![npm version](https://img.shields.io/npm/v/@suspensive/react-query?color=000&labelColor=000&logo=npm&label=)](https://www.npmjs.com/package/@suspensive/react-query) [![npm](https://img.shields.io/npm/dm/@suspensive/react-query?color=000&labelColor=000)](https://www.npmjs.com/package/@suspensive/react-query) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@suspensive/react-query?color=000&labelColor=000)](https://www.npmjs.com/package/@suspensive/react-query)

> This package enhances React Query with Suspense support, allowing for simpler and more declarative data fetching. It provides hooks like useSuspenseQuery and useSuspenseInfiniteQuery, which integrate seamlessly with React Suspense. Additionally, it includes QueryErrorBoundary for handling errors during data fetching.
> This package enhances React Query with Suspense support, allowing for simpler and more declarative data fetching. It provides hooks like useSuspenseQuery and useSuspenseInfiniteQuery, which integrate seamlessly with React Suspense.
Key features: useSuspenseQuery, useSuspenseQueries, useSuspenseInfiniteQuery, queryOptions, QueryErrorBoundary, Mutation, and more.
Key features: useSuspenseQuery, useSuspenseQueries, useSuspenseInfiniteQuery, queryOptions, Mutation, and more.

### [@suspensive/jotai](https://suspensive.org/docs/jotai/motivation) [![npm version](https://img.shields.io/npm/v/@suspensive/jotai?color=000&labelColor=000&logo=npm&label=)](https://www.npmjs.com/package/@suspensive/jotai) [![npm](https://img.shields.io/npm/dm/@suspensive/jotai?color=000&labelColor=000)](https://www.npmjs.com/package/@suspensive/jotai) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/@suspensive/jotai?color=000&labelColor=000)](https://www.npmjs.com/package/@suspensive/jotai)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ export default {
PrefetchQuery: { title: '<PrefetchQuery/>' },
PrefetchInfiniteQuery: { title: '<PrefetchInfiniteQuery/>' },
QueryClientConsumer: { title: '<QueryClientConsumer/>' },
QueryErrorBoundary: { title: '<QueryErrorBoundary/>' },
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ Suspensive Libraries are optimized for modern browsers. It is compatible with th

[![npm version](https://img.shields.io/npm/v/@suspensive/react-query?color=000&labelColor=000&logo=npm&label=)](https://www.npmjs.com/package/@suspensive/react-query)

@suspensive/react-query is available on npm.
@suspensive/react-query is available on npm.
From version 2.2.0 onwards, it supports both v4 and v5 of @tanstack/react-query. Depending on the version of @tanstack/react-query specified in your package.json dependencies, the appropriate version of @suspensive/react-query will be used automatically.

To use the latest stable version, run the following command.

```shell npm2yarn
npm install @suspensive/react-query @tanstack/react-query
npm install @suspensive/react-query @suspensive/react @tanstack/react-query
```

To use @tanstack/react-query v4, run the following command.
To use @tanstack/react-query v4, run the following command.
@tanstack/react-query v4 supports [lower version browsers](/docs/react-query/motivation#solution-for-the-issue-of-tanstackreact-query-v5-not-being-able-to-support-lower-version-browsers-due-to-es-private-field) compared to v5.

```shell npm2yarn
npm install @suspensive/react-query @tanstack/react-query@4
npm install @suspensive/react-query @suspensive/react @tanstack/react-query@4
```

<Callout type='info'>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ export default {
PrefetchQuery: { title: '<PrefetchQuery/>' },
PrefetchInfiniteQuery: { title: '<PrefetchInfiniteQuery/>' },
QueryClientConsumer: { title: '<QueryClientConsumer/>' },
QueryErrorBoundary: { title: '<QueryErrorBoundary/>' },
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ Suspensive 라이브러리는 모던 브라우저를 위해 최적화되었습

[![npm version](https://img.shields.io/npm/v/@suspensive/react-query?color=000&labelColor=000&logo=npm&label=)](https://www.npmjs.com/package/@suspensive/react-query)

@suspensive/react-query는 npm에 있습니다.
@suspensive/react-query는 npm에 있습니다.
2.2.0 버전 이후로는 @tanstack/react-query의 v4와 v5을 모두 지원합니다. package.json의 dependencies에 @tanstack/react-query의 버전에 따라 자동으로 알맞는 @suspensive/react-query 버전을 사용하게 됩니다.

최신 안정버전을 사용하고자 하면 아래 커맨드를 실행하세요.

```shell npm2yarn
npm install @suspensive/react-query @tanstack/react-query
npm install @suspensive/react-query @suspensive/react @tanstack/react-query
```

@tanstack/react-query v4를 사용하고자 하면 아래 커맨드를 실행하세요.
@tanstack/react-query v4를 사용하고자 하면 아래 커맨드를 실행하세요.
@tanstack/react-query v4는 @tanstack/react-query v5 보다 [더 낮은 버전의 브라우저를 지원](/ko/docs/react-query/motivation#tanstackreact-query-v5의-es-private-field로-인해-저버전의-브라우저를-지원하지-못하는-문제를-해결합니다)합니다.

```shell npm2yarn
npm install @suspensive/react-query @tanstack/react-query@4
npm install @suspensive/react-query @suspensive/react @tanstack/react-query@4
```

<Callout type='info'>
Expand Down
3 changes: 2 additions & 1 deletion packages/react-query-4/src/QueryErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 're

/**
* This component wrapping QueryErrorResetBoundary of `@tanstack/react-query` with `@suspensive/react`'s ErrorBoundary. So you must install `@suspensive/react` first, then use it. with this component, You don't have to make unnecessary repetitive implementation to combine ErrorBoundary with QueryErrorResetBoundary
* @see {@link https://suspensive.org/en/docs/react-query/QueryErrorBoundary Suspensive Docs}
* @deprecated this interface will be removed in the next major version. Please make this component yourself by combining ErrorBoundary of `@suspensive/react` and useQueryErrorResetBoundary of `@tanstack/react-query`
* @example
* ```tsx
* <QueryErrorBoundary
Expand All @@ -31,5 +31,6 @@ export const QueryErrorBoundary = forwardRef<
)
})
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line @typescript-eslint/no-deprecated
QueryErrorBoundary.displayName = 'QueryErrorBoundary'
}
3 changes: 2 additions & 1 deletion packages/react-query-5/src/QueryErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 're

/**
* This component wrapping QueryErrorResetBoundary of `@tanstack/react-query` with `@suspensive/react`'s ErrorBoundary. So you must install `@suspensive/react` first, then use it. with this component, You don't have to make unnecessary repetitive implementation to combine ErrorBoundary with QueryErrorResetBoundary
* @see {@link https://suspensive.org/en/docs/react-query/QueryErrorBoundary Suspensive Docs}
* @deprecated this interface will be removed in the next major version. Please make this component yourself by combining ErrorBoundary of `@suspensive/react` and useQueryErrorResetBoundary of `@tanstack/react-query`
* @example
* ```tsx
* <QueryErrorBoundary
Expand All @@ -31,5 +31,6 @@ export const QueryErrorBoundary = forwardRef<
)
})
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line @typescript-eslint/no-deprecated
QueryErrorBoundary.displayName = 'QueryErrorBoundary'
}

0 comments on commit 105f0db

Please sign in to comment.