Skip to content
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

Merged
merged 3 commits into from
Mar 2, 2024

Conversation

manudeli
Copy link
Member

@manudeli manudeli commented Mar 1, 2024

close #771

Thanks for your discussing this interfaces
@minsoo-web @sonsurim @2-NOW @minchodang @tooooo1 @chaaerim

PR Checklist

  • I did below actions if need
  1. I read the Contributing Guide
  2. I added documents and tests.

@manudeli manudeli self-assigned this Mar 1, 2024
Copy link

changeset-bot bot commented Mar 1, 2024

🦋 Changeset detected

Latest commit: 6a245ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@suspensive/react-query Minor
@suspensive/react Minor

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

Copy link

vercel bot commented Mar 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
beta 🛑 Canceled (Inspect) Mar 1, 2024 9:43am
main ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2024 9:43am
visualization 🛑 Canceled (Inspect) Mar 1, 2024 9:43am

Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for beta-suspensive-org ready!

Name Link
🔨 Latest commit 24169d8
🔍 Latest deploy log https://app.netlify.com/sites/beta-suspensive-org/deploys/65e1a1d2277a0e0008e63970
😎 Deploy Preview https://deploy-preview-775--beta-suspensive-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@manudeli manudeli changed the title feat(react-query): add SuspenseQuery, SuspenseInfiniteQuery feat(react-query): add <SuspenseQuery/>, <SuspenseInfiniteQuery/> Mar 1, 2024
Copy link

netlify bot commented Mar 1, 2024

Deploy Preview for beta-suspensive-org ready!

Name Link
🔨 Latest commit 6a245ba
🔍 Latest deploy log https://app.netlify.com/sites/beta-suspensive-org/deploys/65e1a20f26353600088d24e2
😎 Deploy Preview https://deploy-preview-775--beta-suspensive-org.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Merging #775 (6a245ba) into beta (db0dfe1) will decrease coverage by 0.80%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            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              
Components Coverage Δ
@suspensive/react 96.98% <ø> (ø)
@suspensive/react-query 0.00% <0.00%> (ø)
@suspensive/react-await 100.00% <ø> (ø)
@suspensive/react-image 23.52% <ø> (ø)

Copy link
Member Author

@manudeli manudeli left a 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

Comment on lines -34 to -55
// 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
Copy link
Member Author

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

Comment on lines -36 to -69
>(
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'>
) {
Copy link
Member Author

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),
Copy link
Member Author

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),
Copy link
Member Author

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

Copy link
Member

@minsoo-web minsoo-web left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Lets Go!!

@manudeli manudeli merged commit 785a51a into beta Mar 2, 2024
18 checks passed
@manudeli manudeli deleted the feat/react-query/components-to-call-hooks-inlinely branch March 2, 2024 09:03
manudeli pushed a commit that referenced this pull request Mar 2, 2024
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>
@tooooo1
Copy link
Contributor

tooooo1 commented Mar 3, 2024

shoutout with-function crew 🔥

@github-actions github-actions bot mentioned this pull request May 14, 2024
manudeli pushed a commit that referenced this pull request May 14, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants