Uh oh!
There was an error while loading. Please reload this page.
refactor(react-query/useQueries): remove unreachable 'willFetch' branch in suspense promise collection - #10082
Conversation
…ch in suspense promise collection
🦋 Changeset detectedLatest commit: 2b494ce The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 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 |
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRemoved the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... | ❌ Failed | 4m 4s | View ↗ |
nx run-many --target=build --exclude=examples/*... | ✅ Succeeded | <1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-02-11 08:46:56 UTC
Refactor the useQueries function to improve code clarity by removing an unreachable 'willFetch' branch in the suspense promise collection.
Uh oh!
There was an error while loading. Please reload this page.
🎉 This PR has been released! Thank you for your contribution! |

🎯 Changes
Remove the unreachable
willFetchbranch inuseQueriessuspense promise collection.In v4,
useQueriesallowed individual queries to setsuspense: true/false, so a mix of suspense and non-suspense queries was possible. ThewillFetchbranch handled prefetching for non-suspense queries within a suspense batch.In v5,
suspensewas omitted fromUseQueryOptionsanduseSuspenseQueriesappliessuspense: trueto all queries uniformly. This makes the mixed suspense/non-suspense scenario unreachable through the public API, leaving thewillFetchbranch as dead code.This PR removes:
willFetchbranch (else if (willFetch(result, isRestoring)))willFetchimport from./suspense✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit