Skip to content

Conversation

@ofek-frame
Copy link

@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 on configuring the Persist Adapter with Server Components and streaming, including configuration examples and best practices for handling queries during data serialization.

✏️ 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: c7b108e

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

Walkthrough

Documentation sections were added to the React advanced SSR guide explaining how to configure the persist adapter for streaming scenarios. The guidance instructs on limiting query persistence to settled queries to avoid serializing pending promises during Server Component streaming. Code examples demonstrate usage of PersistQueryClientProvider with appropriate dehydrateOptions configuration.

Changes

Cohort / File(s) Change Summary
Documentation: Persist Adapter Streaming Guide
docs/framework/react/guides/advanced-ssr.md
Added two sections titled "Using the Persist Adapter with Streaming" with configuration guidance and code examples for persisting only settled queries during streaming with Server Components

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus areas: Verify code examples are accurate and executable; confirm guidance aligns with actual API behavior
  • Duplication note: The content appears in two locations within the document—consider whether both instances are necessary or if one should reference the other

Poem

🐰 A whisker of wisdom, now streaming so clear,
Persist only what's settled, no promises here!
With Server Components dancing and code samples bright,
Our guide makes persistence flow smooth in the night.

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.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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.

2 participants