fix(preact-query/usePrefetchQuery): replace deprecated 'queryClient.fetchQuery' with 'queryClient.query' - #11274
Conversation
…etchQuery' with 'queryClient.query'
|
View your CI Pipeline Execution ↗ for commit ab98b72
☁️ Nx Cloud last updated this comment at |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthrough
ChangesPreact query prefetch migration
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to This is a localized replacement of a deprecated prefetch API with its intended successor, plus release metadata; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
🚀 Changeset Version Preview1 package(s) bumped directly, 24 bumped as dependents. 🟩 Patch bumps
|
size-limit report 📦
|
| const client = useQueryClient(queryClient) | ||
|
|
||
| if (!client.getQueryState(options.queryKey)) { | ||
| void client.fetchQuery(options).catch(noop) |
There was a problem hiding this comment.
Whoops. That should have been query when I filed #10669
🎯 Changes
usePrefetchQueryin@tanstack/preact-querystill calledqueryClient.fetchQuery, which is@deprecatedin favor ofqueryClient.query.react-query'susePrefetchQueryalready usesclient.query, and preact-query's ownusePrefetchInfiniteQueryalready usesclient.infiniteQuery— this closes the last remaining spot using the deprecated method.Swaps the call from
client.fetchQuery(options)toclient.query(options). No behavior change:query()performs the same staleness check, retry default, and cache build asfetchQuery(); its only addition is runningselecton the returned promise, which prefetch discards.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Documentation