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: suspense for useQueries #4498

Merged
merged 3 commits into from Nov 12, 2022
Merged

feat: suspense for useQueries #4498

merged 3 commits into from Nov 12, 2022

Conversation

TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Nov 11, 2022

fixes #1523

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e133b0d:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2022

Codecov Report

Base: 96.36% // Head: 92.40% // Decreases project coverage by -3.95% ⚠️

Coverage data is based on head (e133b0d) compared to base (eab6e2c).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4498      +/-   ##
==========================================
- Coverage   96.36%   92.40%   -3.96%     
==========================================
  Files          45       89      +44     
  Lines        2281     3675    +1394     
  Branches      640      959     +319     
==========================================
+ Hits         2198     3396    +1198     
- Misses         80      263     +183     
- Partials        3       16      +13     
Impacted Files Coverage Δ
src/react/tests/utils.tsx
src/devtools/Logo.tsx
src/react/useIsFetching.ts
src/core/queriesObserver.ts
src/core/mutationObserver.ts
src/core/queryObserver.ts
src/core/logger.ts
...rc/createWebStoragePersistor-experimental/index.ts
src/react/setBatchUpdatesFn.ts
src/devtools/Explorer.tsx
... and 124 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TkDodo TkDodo marked this pull request as ready for review November 12, 2022 06:38
@TkDodo TkDodo merged commit 9d9aea5 into main Nov 12, 2022
@TkDodo TkDodo deleted the feature/suspense-use-queries branch November 12, 2022 06:59
@dante01yoon
Copy link
Contributor

wow, so now useQueries support suspense? cool!

@TkDodo
Copy link
Collaborator Author

TkDodo commented Nov 12, 2022

@dante01yoon yep, shipped that yesterday with 4.15.0. Please try it out and give feedback. I've written two tests and they work and that's about it 😅

@TkDodo
Copy link
Collaborator Author

TkDodo commented Nov 12, 2022

Oh and btw, it fires all requests in parallel, and you can even combine suspense true and false within the same useQueries call. No fetch waterfalls 🙌

@dante01yoon
Copy link
Contributor

Seems work as intended! I think it might be better add some more test codes. May be I can do help with that

@TkDodo
Copy link
Collaborator Author

TkDodo commented Nov 12, 2022

Yes thanks. I'll happily accept PRs that add more tests 🙌

@dante01yoon
Copy link
Contributor

I just added two tests based on your previous tests; whether it works on global configuration, check component only amounts after all queries fetched.
#4502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suspense is not working for useQueries
3 participants