fix(examples): replace deprecated 'isServer' with 'environmentManager.isServer()' in remaining Next.js examples#10860
Conversation
….isServer()' in remaining Next.js examples
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo Next.js example files update environment detection by replacing the deprecated ChangesEnvironment Detection Migration to environmentManager
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🎯 Changes
Continues the
isServer→environmentManager.isServer()migration kicked off by #10199 and continued through:vue-queryreact-query-next-experimentalTwo example files were missed by #10858 and still import the deprecated
isServerexport. This PR migrates them:examples/react/nextjs-app-prefetching/app/get-query-client.tsexamples/react/nextjs-suspense-streaming/src/app/providers.tsxWithout these updates, users copy-pasting the Next.js example snippets into their own projects pull in the deprecated
isServerexport and see the@deprecatedwarning in their IDE.No behavior change —
environmentManager.isServer()performs the same check by default while allowing host environments to override it.✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
Release Notes
@tanstack/react-query. Both the app prefetching and suspense streaming examples now utilize the recommended approach for distinguishing between server and browser runtime contexts. This change improves code consistency, ensures more reliable behavior across deployment scenarios, and aligns with current React Query best practices.