Repository navigation
ref: switch to use() - #11237
ref: switch to use()#11237
Conversation
|
View your CI Pipeline Execution ↗ for commit c05305c
☁️ Nx Cloud last updated this comment at |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Suspense promise handling and query hook flow packages/react-query/src/suspense.ts, packages/react-query/src/useBaseQuery.ts, packages/react-query/src/useQueries.ts |
Added React-compatible thenable handling and per-query promise caching. Query hooks now consume suspense promises with use(), and useQueries starts all suspense fetches before suspension. |
Suspense test renderer and query suites packages/react-query/src/__tests__/utils.tsx, packages/react-query/src/__tests__/suspense.test.tsx, packages/react-query/src/__tests__/useSuspenseQuery.test.tsx, packages/react-query/src/__tests__/useSuspenseQueries.test.tsx, packages/react-query/src/__tests__/useSuspenseInfiniteQuery.test.tsx |
Renamed and expanded the suspense renderer. Tests now use configurable fallbacks, await suspense rendering, and wrap asynchronous interactions in act. |
Prefetch and error-boundary test updates packages/react-query/src/__tests__/QueryResetErrorBoundary.test.tsx, packages/react-query/src/__tests__/usePrefetchQuery.test.tsx, packages/react-query/src/__tests__/usePrefetchInfiniteQuery.test.tsx |
Updated suspense rendering helpers and asynchronous retry interactions while preserving existing assertions. |
Release metadata .changeset/tasty-ears-study.md |
Added a patch Changeset for the suspense implementation change. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Sequence Diagram(s)
sequenceDiagram
participant QueryHook
participant SuspenseUtilities
participant React
QueryHook->>SuspenseUtilities: request suspense promise
SuspenseUtilities-->>QueryHook: return cached or new promise
QueryHook->>React: call use with thenable
React-->>QueryHook: suspend until settlement
React-->>QueryHook: render data or throw error
Merge Risk: 
Minimal · up to 8a855
-
This change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.
🚥 Pre-merge checks | ✅ 3 | ❌ 2
-
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution Description check ⚠️ WarningThe pull request has no description, so it does not provide the required changes, checklist, or release impact information. Add the required Changes, Checklist, and Release Impact sections, and complete the applicable checklist items. Docstring Coverage ⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 32 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (3 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly summarizes the main change: switching React suspense handling to use(). Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create PR with unit tests
- Commit unit tests in branch
tkdodo/ref/use-over-throw
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 63ebf11a-07a8-46a6-96db-5027f0ba6fe5
📒 Files selected for processing (1)
-
packages/react-query/src/__tests__/transition.test.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
63ebf11a-07a8-46a6-96db-5027f0ba6fe5
📒 Files selected for processing (1)
-
packages/react-query/src/__tests__/transition.test.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
🚀 Changeset Version Preview2 package(s) bumped directly, 24 bumped as dependents. 🟥 Major bumps
🟩 Patch bumps
|
size-limit report 📦
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Yeah this has nothing todo with use(). We shipped a new version yesterday with |
🦋 Changeset detectedLatest commit: c05305c The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 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 |
Summary by CodeRabbit
Bug Fixes
Tests