Skip to content

Conversation

@ofek-frame
Copy link
Contributor

@ofek-frame ofek-frame commented Dec 17, 2025

🎯 Changes

Currently, using both PersistQueryClientProvider and query streaming in NextJS can cause exceptions during dehydration with the current example in the docs.

This PR documents the conflict and the prop you may use to solve it.

✅ 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

  • Documentation
    • Added guidance and configuration examples for using the Persist Adapter with Server Components and streaming, showing how to persist only settled queries to avoid serializing pending promises.
    • Guidance appears in two locations to improve discoverability (duplicate content).

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

⚠️ No Changeset found

Latest commit: 075cd33

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Added documentation sections to the React advanced SSR guide explaining how to configure the Persist adapter to persist only settled queries during Server Component streaming, with example code using PersistQueryClientProvider and dehydrateOptions.shouldDehydrateQuery. The additions are duplicated in two locations of the same file.

Changes

Cohort / File(s) Change Summary
Documentation: Persist Adapter Streaming Guide
docs/framework/react/guides/advanced-ssr.md
Added two duplicated sections titled "Using the Persist Adapter with Streaming" with guidance and code examples showing how to configure PersistQueryClientProvider and dehydrateOptions.shouldDehydrateQuery to persist only settled queries during streaming.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Ayo1984
  • shaked-frame

Poem

🐰 A soft tap of paws on the glowing key,
I whisper: persist what’s calm — let promises be.
Server Components stream, tidy and light,
Settled queries saved, everything just right. 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: documenting a conflict between PersistQueryClientProvider and SSR streaming, which matches the raw summary and PR objectives.
Description check ✅ Passed The description follows the required template structure with all main sections completed: Changes section explains the conflict and solution, Checklist items are properly addressed, and Release Impact correctly identifies this as docs-only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7b108e and 075cd33.

📒 Files selected for processing (1)
  • docs/framework/react/guides/advanced-ssr.md

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.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/framework/react/guides/advanced-ssr.md (1)

535-552: Add import statement to the code example for completeness.

The example uses defaultShouldDehydrateQuery without showing its import. While earlier examples in the guide demonstrate this import from @tanstack/react-query, it would be clearer to include it in this standalone section for readers who may jump directly to this part.

// Add the import at the top of the example:
import {
  PersistQueryClientProvider,
  defaultShouldDehydrateQuery,
} from '@tanstack/react-query'

Otherwise, the documentation accurately addresses the conflict between pending query dehydration and persistence storage, and the solution is correct.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f15b7fc and c7b108e.

📒 Files selected for processing (1)
  • docs/framework/react/guides/advanced-ssr.md (1 hunks)
🔇 Additional comments (1)
docs/framework/react/guides/advanced-ssr.md (1)

535-552: Verify whether this section is duplicated elsewhere in the PR.

The AI-generated summary mentions "The changes duplicate the section in two locations," but only one instance of "Using the Persist Adapter with Streaming" is visible in the provided code. Please confirm whether this section appears in multiple places or if the summary is inaccurate.

Copy link

@Ayo1984 Ayo1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

light work

@TkDodo TkDodo merged commit 8471715 into TanStack:main Dec 26, 2025
1 check passed
@ofek-frame ofek-frame deleted the docs/advanced-ssr branch December 26, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants