Skip to content

fix(examples/integrations): replace deprecated 'isServer' with 'environmentManager.isServer()' in the Next.js examples#10858

Merged
sukvvon merged 2 commits into
mainfrom
fix/examples-integrations-environment-manager-isserver
Jun 2, 2026
Merged

fix(examples/integrations): replace deprecated 'isServer' with 'environmentManager.isServer()' in the Next.js examples#10858
sukvvon merged 2 commits into
mainfrom
fix/examples-integrations-environment-manager-isserver

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented Jun 2, 2026

🎯 Changes

Migrate the remaining isServer usages in the Next.js examples and integrations to environmentManager.isServer(), matching the migration already done for react-query/preact-query (#10199), vue-query (#10826), and react-query-next-experimental (#10857).

Updated files:

  • integrations/react-next-15/app/providers.tsx
  • integrations/react-next-16/app/providers.tsx
  • examples/react/nextjs-suspense-streaming/src/app/page.tsx

Without these updates, users copy-pasting the Next.js provider snippet from the integration examples would import the deprecated isServer export and see the @deprecated warning in their IDE.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with `pnpm run test:pr`.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Refactor
    • Updated internal server-vs-browser detection across example apps and React/Next.js providers to a more current implementation.
    • No user-facing behavior or public APIs changed; existing functionality and rendering remain intact.

…onmentManager.isServer()' in the Next.js examples
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a1b5e661-3948-4737-b717-ec28c0dd6889

📥 Commits

Reviewing files that changed from the base of the PR and between 9a43bcf and 5fe2829.

📒 Files selected for processing (1)
  • examples/react/nextjs-suspense-streaming/src/app/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/react/nextjs-suspense-streaming/src/app/page.tsx

📝 Walkthrough

Walkthrough

Migrate server detection from deprecated isServer to environmentManager.isServer() in two Next.js provider files and one example page; runtime behavior remains unchanged.

Changes

Server Detection Refactoring

Layer / File(s) Summary
Next.js Provider Integration Updates
integrations/react-next-15/app/providers.tsx, integrations/react-next-16/app/providers.tsx
Both provider files replace the isServer import with environmentManager, and update getQueryClient() to call environmentManager.isServer() instead of checking the imported boolean. Server-side client creation and browser-side client reuse logic remain unchanged.
Suspense Streaming Example Page Update
examples/react/nextjs-suspense-streaming/src/app/page.tsx
The example page's getBaseURL() utility is updated to branch on environmentManager.isServer() instead of the prior isServer import, following the same refactoring pattern as the provider modules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Possibly related PRs

  • TanStack/query#10826: Performs the same migration from isServer to environmentManager.isServer() in related integration code.

Suggested reviewers

  • TkDodo

Poem

🐰 Hopped along the code, ears in tune,
Swapped an old check beneath the moon.
environmentManager now leads the way,
Three small files, one tidy day.
A carrot, a smile—deploy away! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing deprecated 'isServer' with 'environmentManager.isServer()' in Next.js examples, which is the primary focus of the changeset.
Description check ✅ Passed The description includes all required sections from the template: comprehensive explanation of changes, completed checklist items, and explicit release impact assessment indicating no changeset is needed.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/examples-integrations-environment-manager-isserver

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Jun 2, 2026

View your CI Pipeline Execution ↗ for commit 5fe2829

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 1m 38s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-02 02:29:30 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🚀 Changeset Version Preview

3 package(s) bumped directly, 22 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/lit-query 0.2.6 → 0.2.7 Changeset
@tanstack/query-devtools 5.100.14 → 5.100.15 Changeset
@tanstack/vue-query 5.100.14 → 5.100.15 Changeset
@tanstack/angular-query-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/angular-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/eslint-plugin-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/preact-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/query-async-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/query-broadcast-client-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/query-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-persist-client-core 5.100.14 → 5.100.15 Dependent
@tanstack/query-sync-storage-persister 5.100.14 → 5.100.15 Dependent
@tanstack/react-query 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-next-experimental 5.100.14 → 5.100.15 Dependent
@tanstack/react-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-devtools 5.100.14 → 5.100.15 Dependent
@tanstack/solid-query-persist-client 5.100.14 → 5.100.15 Dependent
@tanstack/svelte-query 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-devtools 6.1.33 → 6.1.34 Dependent
@tanstack/svelte-query-persist-client 6.1.33 → 6.1.34 Dependent
@tanstack/vue-query-devtools 6.1.33 → 6.1.34 Dependent

@sukvvon sukvvon self-assigned this Jun 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 2, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10858

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10858

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10858

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10858

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10858

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10858

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10858

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10858

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10858

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10858

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10858

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10858

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10858

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10858

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10858

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10858

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10858

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10858

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10858

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10858

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10858

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10858

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10858

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10858

commit: 5fe2829

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

size-limit report 📦

Path Size
react full 12.11 KB (0%)
react minimal 9.08 KB (0%)

@sukvvon sukvvon merged commit 0bc0a88 into main Jun 2, 2026
9 checks passed
@sukvvon sukvvon deleted the fix/examples-integrations-environment-manager-isserver branch June 2, 2026 07:17
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.

1 participant