Skip to content

Docs: fix streaming SSR and fragment caching review feedback#2801

Merged
justin808 merged 2 commits intomainfrom
jg/2800-streaming-docs-fixes
Mar 22, 2026
Merged

Docs: fix streaming SSR and fragment caching review feedback#2801
justin808 merged 2 commits intomainfrom
jg/2800-streaming-docs-fixes

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Mar 22, 2026

Summary

Addresses remaining review feedback from #2789 as tracked in #2800:

  • React version consistency: Changed "React 18/19's renderToPipeableStream" to "React 19's" in intro to match prerequisites; updated "React 18's Selective Hydration" → "React's Selective Hydration"
  • Async component clarification: Added note that async () => {} function components require RSC infrastructure, with pointer to RSC tutorial for non-RSC streaming alternatives
  • Fragment caching deploy note: Rewrote to explicitly distinguish prerender: true (auto-invalidated via bundle digest) from client-only calls (manual cache key versioning required)
  • Style nits: Fixed "full page reload" → "full-page reload" hyphenation; simplified controller example to note ActionController::Live is already included by ReactOnRailsPro::Stream

Fixes #2800

Test plan

  • Verify docs render correctly on the docs site
  • Confirm no broken links in the added RSC tutorial reference

🤖 Generated with Claude Code


Note

Low Risk
Low risk documentation-only updates; main risk is minor confusion if guidance is incorrect, but no runtime code is changed.

Overview
Updates docs/pro/streaming-ssr.md to clarify that async function components are a React Server Components pattern and points non-RSC streaming users to Suspense-friendly data fetching (and the RSC tutorial).

Simplifies the Rails controller example by removing the requirement to explicitly include ActionController::Live (noting it’s mixed in via ReactOnRailsPro::Stream), and applies small wording/consistency edits around Selective Hydration and “full-page reload” phrasing.

Written by Cursor Bugbot for commit 1ecdaa3. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Documentation
    • Enhanced streaming server-side rendering documentation with comprehensive guidance on implementing React Server Components and alternative patterns using data-fetching libraries with Suspense
    • Simplified Rails setup requirements, clarifying controller configuration needed for streaming functionality
    • Minor wording refinements for consistency and clarity

- Use "React 19" consistently (was "React 18/19" in intro)
- Note that async function components require RSC infrastructure
- Clarify fragment cache key behavior for prerender vs client-only
- Fix "full page reload" → "full-page reload" hyphenation
- Note that ActionController::Live is included by ReactOnRailsPro::Stream

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4947db82-5e49-441b-9f0e-438188ca06b2

📥 Commits

Reviewing files that changed from the base of the PR and between ada346d and 1ecdaa3.

📒 Files selected for processing (1)
  • docs/pro/streaming-ssr.md
✅ Files skipped from review due to trivial changes (1)
  • docs/pro/streaming-ssr.md

Walkthrough

Documentation clarifications for React Server Components in streaming SSR patterns, Rails controller setup simplification, and minor wording adjustments for consistency. No functional code changes.

Changes

Cohort / File(s) Summary
Documentation Clarifications
docs/pro/streaming-ssr.md
Clarified that async component pattern requires React Server Components (RSC); added guidance for non-RSC streaming with data-fetching libraries and Suspense. Simplified Rails controller documentation by noting ActionController::Live is already mixed in by ReactOnRailsPro::Stream. Updated "full page reload" to "full-page reload" and removed React 18-specific references for consistency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop, skip and edit so fine,
Docs clarified, every line in line,
React Server magic, now plain to see,
Rails setup simpler, as it should be!
Our streaming flows dance with delight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes in the PR: addressing review feedback on streaming SSR and fragment caching documentation.
Linked Issues check ✅ Passed The PR addresses all key objectives from issue #2800: React version consistency clarifications, async component RSC requirements, fragment caching distinction, and style nits like hyphenation and controller example simplification.
Out of Scope Changes check ✅ Passed All changes in the PR are within scope: they address the four specific items outlined in issue #2800 with no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jg/2800-streaming-docs-fixes

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.

Comment thread docs/pro/streaming-ssr.md Outdated
Comment thread docs/pro/streaming-ssr.md Outdated
Comment thread docs/pro/streaming-ssr.md
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 22, 2026

Review

Overall these are good, targeted clarifications. Three things worth addressing before merge:

1. React version inconsistency (streaming-ssr.md line 3)
Changing to "React 19's renderToPipeableStream" conflicts with at least 5 other doc files that still say "React 18's" or "React 18/19's". More importantly, renderToPipeableStream shipped in React 18 — attributing it to React 19 is factually off. Either update all the other files to match, or revert this line to "React 18/19's" for accuracy and consistency. (Inline comment on line 3.)

2. RSC tutorial link is the wrong destination for non-RSC users (streaming-ssr.md line 78)
The note correctly flags that async function components require RSC — but then sends non-RSC streaming users to the RSC tutorial, which is about setting up a different, more complex feature. This is likely to confuse people looking for a simpler path. The link should either go to data-fetching documentation (React Query / SWR + Suspense patterns) or be reworded to make clear the RSC tutorial is for users who want RSC, not an alternative. (Inline comment on line 78.)

3. ActionController::Live inclusion claim needs verification (streaming-ssr.md lines 110–111)
The new comment states ActionController::Live is "already mixed in by ReactOnRailsPro::Stream". If users remove their explicit include ActionController::Live based on this documentation and it turns out to be an unstable internal detail, they'll see broken streaming in production. Please confirm this is a deliberate, tested public guarantee of the ReactOnRailsPro::Stream module — not just a current implementation detail. (Inline comment on lines 110–111.)

Fragment caching change (fragment-caching.md) looks good — the rewrite is clearer and the explicit distinction between prerender: true and client-only calls is helpful.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 22, 2026

Greptile Summary

This PR is a focused documentation polish pass on streaming-ssr.md and fragment-caching.md, addressing review feedback from #2800. All changes are docs-only with no code impact.

Key changes:

  • React version consistency — "React 18/19's renderToPipeableStream" narrowed to "React 19's" to match the React 19 prerequisite; "React 18's Selective Hydration" generalized to "React's Selective Hydration" (two occurrences)
  • Async component clarification — Added a callout noting that async () => {} Server Components require RSC infrastructure, pointing users toward React Query/SWR + <Suspense> for non-RSC streaming
  • Fragment caching deploy note — Rewritten paragraph now explicitly contrasts prerender: true (bundle digest auto-included in key → auto-invalidated on deploy) vs. client-only calls (no digest → manual versioning required)
  • Controller example simplified — Removed the explicit include ActionController::Live line (confirmed it is already mixed in by ReactOnRailsPro::Stream via its included block) and replaced it with an explanatory comment
  • Style nits — "full page reload" → "full-page reload" hyphenation corrected

Confidence Score: 5/5

  • Documentation-only PR with accurate, verified content — safe to merge.
  • All factual claims were verified against source code: ActionController::Live is indeed auto-included by ReactOnRailsPro::Stream's included block, the RSC tutorial link resolves to an existing file, and the cache key behavior for prerender: true vs. client-only calls matches the implementation. The one P2 style note (RSC tutorial link context) is non-blocking and would simply improve clarity for the reader.
  • No files require special attention.

Important Files Changed

Filename Overview
docs/pro/streaming-ssr.md Documentation fixes: React version wording aligned to prerequisites, async component note added with valid RSC tutorial link, ActionController::Live comment added (confirmed accurate via source), hyphenation and Selective Hydration attribution corrected.
docs/pro/fragment-caching.md Cache Warming paragraph rewritten to clearly distinguish prerender:true (auto-invalidated via bundle digest) from client-only calls (manual versioning required). Accurate and clearer than the previous version.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Controller includes ReactOnRailsPro::Stream] --> B[ActionController::Live auto-mixed in]
    A --> C[stream_view_containing_react_components called]
    C --> D[render_to_string builds template]
    D --> E{Component type?}
    E -->|Async Server Component / RSC| F[Requires RSC infrastructure\nsee RSC tutorial]
    E -->|Client Component with Suspense| G[Use React Query / SWR\n+ Suspense boundary]
    C --> H[React renderToPipeableStream\nstreams HTML chunks]
    H --> I[Browser renders updates\nwithout full-page reload]
    I --> J[React Selective Hydration\nhydrates chunks as they arrive]
Loading

Reviews (1): Last reviewed commit: "Docs: fix streaming SSR and fragment cac..." | Re-trigger Greptile

Comment thread docs/pro/streaming-ssr.md Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ada346d1e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/pro/streaming-ssr.md Outdated
Comment thread docs/pro/streaming-ssr.md Outdated
- Revert "React 19's" to "React 18/19's" for renderToPipeableStream
  (the API was introduced in React 18, not 19)
- Clarify RSC tutorial link is for RSC users, not non-RSC streaming
- Revert Cache Warming paragraph to previous clearer wording

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 22, 2026

Review Summary

The second commit addresses the key concerns from the previous review round well. Here's my assessment of the final state:

What was addressed:

  • ✅ React version: Correctly reverted back to "React 18/19's renderToPipeableStream" (the API shipped in React 18, not 19)
  • ✅ RSC tutorial link: Now clearly scoped to RSC users ("For RSC-based streaming (which does support async components), see the RSC tutorial") — non-RSC users are directed to React Query/SWR + Suspense instead
  • ✅ RSC tutorial link resolves to an existing file (docs/pro/react-server-components/tutorial.md)

Remaining changes look good:

  • ActionController::Live comment (lines 110–111): The comment stating it's "already mixed in by ReactOnRailsPro::Stream" has been independently verified against the source code by greptile. Accurate.
  • "React's Selective Hydration" (lines 258, 342): Making this version-agnostic is the right call — Selective Hydration is not exclusive to React 18.
  • "full-page reload" hyphenation: Correct.

Minor observation: The code example in Step 2 (SlowDataComponent as an async function) demonstrates an RSC-only pattern, which is now called out clearly in the added note. However, it's slightly awkward that the non-RSC streaming tutorial shows code that won't work without RSC. A future improvement would be to either replace the example with a Suspense + data-fetching pattern for non-RSC users, or split the tutorial into RSC and non-RSC tracks. Not a blocker for this PR.

Overall, the documentation is more accurate and clearer after these changes. Ready to merge.

@justin808 justin808 merged commit 8915573 into main Mar 22, 2026
20 checks passed
@justin808 justin808 deleted the jg/2800-streaming-docs-fixes branch March 22, 2026 22:51
justin808 added a commit that referenced this pull request Mar 25, 2026
## Summary

- Stamp `### [16.5.0.rc.0]` version header with today's date
- Add 10 new changelog entries for PRs merged since v16.4.0
- Fix incomplete PR 2818 entry (missing author link)

### New entries added

**Added:**
- `create-react-on-rails-app --pro` support (PR 2818)
- Global prerender env override `REACT_ON_RAILS_PRERENDER_OVERRIDE` (PR
2816)
- `react_on_rails:sync_versions` rake task (PR 2797)
- Pro/RSC setup checks in `react_on_rails:doctor` (PR 2674)

**Changed:**
- [Pro] Canonical env var for worker count is now
`RENDERER_WORKERS_COUNT` (PR 2611)

**Improved:**
- Smoother `create-react-on-rails-app` and install generator flows (PR
2650)
- Pro upgrade hint after install (PR 2642)

**Fixed:**
- Preserve runtime env vars across `Bundler.with_unbundled_env` (PR
2836)
- Fix doctor prerender check and ExecJS display for Pro/RSC apps (PR
2773)
- Fix doctor false positives for custom layouts (PR 2612)

### Skipped PRs (not user-visible)

Docs-only: #2845, #2842, #2826, #2830, #2820, #2809, #2803, #2785,
#2801, #2791, #2789, #2788, #2772, #2778, #2780, #2784, #2671, #2676,
#2662, #2657, #2669
CI/internal tooling: #2825, #2817, #2819, #2812, #2815, #2810, #2808,
#2807, #2634, #2798, #2761, #2760, #2658, #2639, #2667, #2656

## Test plan

- [x] Verified version header and diff links are correct
- [x] Verified all entries follow changelog formatting conventions
- [x] Verified file ends with newline
- [ ] After merge, run `rake release` to publish 16.5.0.rc.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only change updating `CHANGELOG.md` with a new
`16.5.0.rc.0` section and compare links; no runtime code is modified.
> 
> **Overview**
> Adds a new `16.5.0.rc.0` (2026-03-25) section to `CHANGELOG.md`,
consolidating recent PR entries under **Added/Changed/Improved/Fixed**
and correcting the previously incomplete `--pro` CLI entry author
attribution.
> 
> Updates the bottom compare links so `[unreleased]` now compares from
`v16.5.0.rc.0` and adds a link definition for `[16.5.0.rc.0]`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
481a71c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes - v16.5.0.rc.0

* **New Features**
  * Added sync_versions task for streamlined version management
  * Expanded doctor checks for Pro and RSC support

* **Improvements**
  * Enhanced generator workflow and Pro upgrade guidance
  * Improved environment variable handling and preservation

* **Bug Fixes**
* Fixed detection issues with doctor tools and ExecJS/prerender
functionality

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
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.

Docs: address remaining streaming SSR and fragment caching review feedback

1 participant