-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react-query): add <SuspenseQuery/>
, <SuspenseInfiniteQuery/>
#775
feat(react-query): add <SuspenseQuery/>
, <SuspenseInfiniteQuery/>
#775
Conversation
🦋 Changeset detectedLatest commit: 6a245ba The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for beta-suspensive-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
<SuspenseQuery/>
, <SuspenseInfiniteQuery/>
✅ Deploy Preview for beta-suspensive-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## beta #775 +/- ##
==========================================
- Coverage 85.07% 84.27% -0.80%
==========================================
Files 28 30 +2
Lines 422 426 +4
Branches 97 98 +1
==========================================
Hits 359 359
- Misses 55 59 +4
Partials 8 8
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments to share my intention
// arg1: queryKey, arg2: queryFn, arg3: options | ||
export function useSuspenseInfiniteQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
queryKey: TQueryKey, | ||
queryFn: QueryFunction<TQueryFnData, TQueryKey>, | ||
options?: Omit<UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn'> | ||
): UseSuspenseInfiniteQueryResult<TData, TError> | ||
// arg1: queryKey, arg2: options | ||
export function useSuspenseInfiniteQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
queryKey: TQueryKey, | ||
options: Omit<UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'> | ||
): UseSuspenseInfiniteQueryResult<TData, TError> | ||
// arg1: options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From @suspensive/react-query v2, there is only one parameter to pass infiniteQueryOptions
>( | ||
queryKey: TQueryKey, | ||
queryFn: QueryFunction<TQueryFnData, TQueryKey>, | ||
options?: Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn'> | ||
): UseSuspenseQueryResult<TData, TError> | ||
// arg1: queryKey, arg2: options | ||
export function useSuspenseQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
queryKey: TQueryKey, | ||
options?: Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'> | ||
): UseSuspenseQueryResult<TData, TError> | ||
// arg1: options | ||
export function useSuspenseQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>(options: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): UseSuspenseQueryResult<TData, TError> | ||
export function useSuspenseQuery< | ||
TQueryFnData = unknown, | ||
TError = unknown, | ||
TData = TQueryFnData, | ||
TQueryKey extends QueryKey = QueryKey, | ||
>( | ||
arg1: TQueryKey | UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
arg2?: | ||
| QueryFunction<TQueryFnData, TQueryKey> | ||
| Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>, | ||
arg3?: Omit<UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn'> | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From @suspensive/react-query v2, there is only one parameter to pass queryOptions
return useQuery<TQueryFnData, TError, TData, TQueryKey>({ | ||
...parseQueryArgs(arg1, arg2, arg3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to use parseQueryArgs for aggregate arg1, arg2, arg3 from now
): UseSuspenseInfiniteQueryResult<TData, TError> { | ||
return useInfiniteQuery({ | ||
...parseQueryArgs(arg1, arg2, arg3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no need to use parseQueryArgs for aggregate arg1, arg2, arg3 from now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Lets Go!!
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to beta, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `beta` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `beta`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @suspensive/react-query@2.0.0-beta.8 ### Minor Changes - [#775](#775) [`785a51a`](785a51a) Thanks [@manudeli](https://github.com/manudeli)! - feat(react-query): add SuspenseQuery, SuspenseInfiniteQuery ### Patch Changes - Updated dependencies \[]: - @suspensive/react@2.0.0-beta.8 ## @suspensive/react@2.0.0-beta.8 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
shoutout with-function crew 🔥 |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to beta, this PR will be updated. # Releases ## @suspensive/react@2.0.0 ### Major Changes - [#632](#632) [`ea1c4ed`](ea1c4ed) Thanks [@manudeli](https://github.com/manudeli)! - feat(react): rename Suspensive defaultOptions -> defaultProps - [#629](#629) [`78f5bd4`](78f5bd4) Thanks [@manudeli](https://github.com/manudeli)! - feat(react, react-query): remove deprecated apis - [#629](#629) [`6a3f6f4`](6a3f6f4) Thanks [@manudeli](https://github.com/manudeli)! - feat(react): remove ErrorBoundaryGroup.Reset - [#629](#629) [`36d7416`](36d7416) Thanks [@manudeli](https://github.com/manudeli)! - chore(\*): versioning last beta - [#629](#629) [`73c0cc7`](73c0cc7) Thanks [@manudeli](https://github.com/manudeli)! - fix(react): add getServerSnapShot in syncDevMode - [#631](#631) [`837ed18`](837ed18) Thanks [@manudeli](https://github.com/manudeli)! - feat(\*): remove target react v16, v17 ### Patch Changes - [#755](#755) [`3f6171b`](3f6171b) Thanks [@manudeli](https://github.com/manudeli)! - feat(\*): remove all experimental interface ## @suspensive/react-query@2.0.0 ### Major Changes - [#629](#629) [`78f5bd4`](78f5bd4) Thanks [@manudeli](https://github.com/manudeli)! - feat(react, react-query): remove deprecated apis - [#401](#401) [`d06e883`](d06e883) Thanks [@manudeli](https://github.com/manudeli)! - fix(react-query): @suspensive/react-query v2's all naming convention correctly like @tanstack/react-query v5 - [#629](#629) [`36d7416`](36d7416) Thanks [@manudeli](https://github.com/manudeli)! - chore(\*): versioning last beta - [#631](#631) [`837ed18`](837ed18) Thanks [@manudeli](https://github.com/manudeli)! - feat(\*): remove target react v16, v17 ### Minor Changes - [#828](#828) [`7f19c76`](7f19c76) Thanks [@manudeli](https://github.com/manudeli)! - feat(react-query): add queryOptions - [#775](#775) [`785a51a`](785a51a) Thanks [@manudeli](https://github.com/manudeli)! - feat(react-query): add SuspenseQuery, SuspenseInfiniteQuery ### Patch Changes - Updated dependencies \[[`ea1c4ed`](ea1c4ed), [`78f5bd4`](78f5bd4), [`6a3f6f4`](6a3f6f4), [`36d7416`](36d7416), [`3f6171b`](3f6171b), [`73c0cc7`](73c0cc7), [`837ed18`](837ed18)]: - @suspensive/react@2.0.0 ## @suspensive/react-await@0.0.18 ### Patch Changes - [#631](#631) [`837ed18`](837ed18) Thanks [@manudeli](https://github.com/manudeli)! - feat(\*): remove target react v16, v17 ## @suspensive/react-image@0.0.12 ### Patch Changes - [#631](#631) [`837ed18`](837ed18) Thanks [@manudeli](https://github.com/manudeli)! - feat(\*): remove target react v16, v17 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
close #771
Thanks for your discussing this interfaces
@minsoo-web @sonsurim @2-NOW @minchodang @tooooo1 @chaaerim
PR Checklist