Docs: expand Pro docs and add Pro badges to OSS docs#2789
Conversation
Add dedicated Pro feature overview pages: - docs/pro/node-renderer.md — Node Renderer benefits, setup, performance - docs/pro/streaming-ssr.md — Streaming SSR overview and quick example - docs/pro/fragment-caching.md — Fragment caching overview and usage Add Docusaurus admonition callouts (:::tip) to OSS docs: - core-concepts/react-server-rendering.md — Pro Node renderer callout - building-features/streaming-server-rendering.md — Convert blockquote to :::tip - building-features/caching.md — Convert blockquote to :::tip - deployment/server-rendering-tips.md — Pro performance features callout - configuration/README.md — Link to Pro config options - getting-started/quick-start.md — Pro upgrade callout in Go Pro section Update docs/pro/home-pro.md to link to new dedicated feature pages. Closes #2783 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds three new Pro documentation pages (Node Renderer, Streaming SSR, Fragment Caching), converts plain OSS Pro notes to Docusaurus Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR expands the React on Rails Pro documentation by adding three new dedicated feature overview pages ( Key changes and findings:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[OSS Docs] -->|:::tip admonition| B[Pro Upgrade CTA]
subgraph OSS ["OSS Docs (6 files updated)"]
O1[core-concepts/react-server-rendering.md]
O2[building-features/streaming-server-rendering.md]
O3[building-features/caching.md]
O4[configuration/README.md]
O5[deployment/server-rendering-tips.md]
O6[getting-started/quick-start.md]
end
subgraph Pro ["Pro Docs"]
P0[home-pro.md]
P1[node-renderer.md NEW]
P2[streaming-ssr.md NEW]
P3[fragment-caching.md NEW]
P4[upgrading-to-pro.md]
end
O1 -->|links to| P1
O1 -->|links to| P2
O1 -->|links to| P4
O2 -->|links to| P2
O2 -->|links to| P4
O3 -->|links to| P3
O5 -->|links to| P1
O5 -->|links to| P2
O5 -->|links to| P3
O6 -->|links to| P1
O6 -->|links to| P2
O6 -->|links to| P3
P0 -->|links to| P1
P0 -->|links to| P2
P0 -->|links to| P3
Last reviewed commit: "Docs: expand Pro doc..." |
Review: Docs — Pro badges and new Pro overview pagesOverall this is a clean, well-structured docs PR. Cross-links were verified and all target files exist. A few issues to address before merging: Bug — duplicate The old legacy Security antipattern in Using React version inconsistency in The opening paragraph says "React 18/19's renderToPipeableStream" but the Prerequisites block (line 86) lists React 19 as the minimum requirement. These are contradictory. If React 19 is genuinely required, the intro should say so unambiguously. Stale React 18 reference in The intro paragraph (line 3) still says "Now supports React 18" while the new Streaming SSR feature entry says "React 19's renderToPipeableStream". The intro should be updated to reflect the React 19 baseline. The new :::tip admonitions in OSS docs are a nice touch — they are correctly scoped to the Pro upgrade path and do not clutter the main content. The three new overview pages (node-renderer, streaming-ssr, fragment-caching) are accurate, well-linked, and fill a real gap in the Pro docs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44bcb99211
ℹ️ 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".
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Duplicate feature sections left in restructured doc
- Removed the duplicated legacy
# Featuresand duplicate references blocks so the page now has a single consistent features section and heading hierarchy.
- Removed the duplicated legacy
Or push these changes by commenting:
@cursor push 70bd7b5f81
Preview (70bd7b5f81)
diff --git a/docs/pro/home-pro.md b/docs/pro/home-pro.md
--- a/docs/pro/home-pro.md
+++ b/docs/pro/home-pro.md
@@ -68,71 +68,6 @@
- [Rails Configuration](../oss/configuration/configuration-pro.md)
- [Node Renderer technical docs](../oss/building-features/node-renderer/basics.md)
-# Features
-
-## Code Splitting
-
-From [The Cost of JavaScript in 2018](https://medium.com/@addyosmani/the-cost-of-javascript-in-2018-7d8950fbb5d4):
-
-> To stay fast, only load JavaScript needed for the current page. Prioritize what a user will need and lazy-load the rest with code-splitting. This gives you the best chance at loading and getting interactive fast. Stacks with route-based code-splitting by default are game-changers.
-
-## Caching
-
-### Server Rendering
-
-Server rendering of JavaScript evaluation is cached if `prerender_caching` is turned on in your Rails config. This applies to all JavaScript evaluation methods, including ExecJS and the Node VM Renderer.
-
-### Pro: Fragment Caching
-
-Fragment caching is a [React on Rails Pro](https://pro.reactonrails.com/) feature. Fragment caching is a **HUGE** performance booster for your apps. Use the `cached_react_component` and `cached_react_component_hash`. The API is the same as `react_component` and `react_component_hash`, but for 2 differences:
-
-1. The `cache_key` takes the same parameters as any Rails `cache` view helper.
-1. The **props** are passed via a block so that evaluation of the props is not done unless the cache is broken. Suppose you put your props calculation into some method called `some_slow_method_that_returns_props`:
-
-```ruby
-<%= cached_react_component("App", cache_key: [@user, @post], prerender: true) do
- some_slow_method_that_returns_props
-end %>
-```
-
-Such fragment caching saves CPU work for your web server and greatly reduces the request time. It completely skips the evaluation costs of:
-
-1. Database calls to compute the props.
-2. Serialization the props values hash into a JSON string for evaluating JavaScript to server render.
-3. Costs associated with evaluating JavaScript from your Ruby code.
-4. Creating the HTML string containing the props and the server-rendered JavaScript code.
-
-Note, even without server rendering (without step 3 above), fragment caching is still effective.
-See [Caching](../oss/building-features/caching.md) for more additional details.
-
-## React On Rails Pro Node React Render
-
-The "React on Rails Pro Node React Renderer" provides more efficient React Server Side Rendering on a standalone Node JS server.
-
-### Overall Management Memory and CPU on both the Rendering and Ruby Servers
-
-A separate Node rendering server is easier to manage in terms of monitoring memory and CPU performance, allocating dynos, etc. This also makes it easier to manage the ruby servers, as you no longer have to consider the impact of starting an embedded V8. Thus, you can never hang your Ruby servers due to JavaScript memory leaks.
-
-### Proper Node Tooling
-
-A disadvantage of Ruby embedded JavaScript (ExecJS) is that it precludes the use of standard Node tooling for doing things like profiling and tracking down memory leaks. With the renderer on a separate Node.js server, we were able to use node-memwatch (https://github.com/marcominetti/node-memwatch) to find few memory leaks in the Egghead React code.
-
-### Caching of React Rendering
-
-To limit the load on the renderer server or embedded ExecJS, caching of React rendering requests can be enabled by a config setting. Because current React rendering requests are idempotent (same value regardless of calls), caching should be feasible for all server rendering calls. The current renderer does not allow any asynchronous calls to fetch data. The rendering request includes all data for rendering.
-
-### Rolling Restart of Node Workers
-
-Due to poor performance and crashes due to memory leaks, the rolling restart of node workers was thus added as an option to the core rendering product. This option is cheap insurance against the renderer getting too slow from a memory leak due to a bug in some newly deployed JavaScript code.
-
-### Docs
-
-See the [Node React Render Docs](../oss/building-features/node-renderer/basics.md).
-
-## Other Utility Methods
-
-See the [Ruby API](../oss/api-reference/ruby-api-pro.md).
-
# Testimonials
"Do you want your app to randomly crash sometimes in hard to predict ways? Then ExecJS is perfect for you"
@@ -164,7 +99,3 @@
For more info, email [justin@shakacode.com](mailto:justin@shakacode.com).
-# References
-
-- [Caching](../oss/building-features/caching.md)
-- [Rails Configuration](../oss/configuration/configuration-pro.md)There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
docs/pro/streaming-ssr.md (1)
66-70: Drop redundantActionController::Liveinclude in controller snippet.
ReactOnRailsPro::Streamalready mixes inActionController::Live, so keeping both in the example adds noise.Suggested cleanup
class ProductsController < ApplicationController - include ActionController::Live include ReactOnRails::Controller include ReactOnRailsPro::Stream🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/pro/streaming-ssr.md` around lines 66 - 70, Remove the redundant include of ActionController::Live from the ProductsController example: since ReactOnRailsPro::Stream already mixes in ActionController::Live, delete the line including ActionController::Live and keep include ReactOnRails::Controller and include ReactOnRailsPro::Stream so the snippet remains accurate and concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/oss/building-features/streaming-server-rendering.md`:
- Around line 3-5: Update the Pro tip copy that currently claims "SSR works in
the OSS version via mini_racer" to avoid naming a specific runtime; change the
wording to state OSS SSR uses ExecJS (with the actual JS runtime chosen by the
environment) while Pro adds streaming SSR with renderToPipeableStream and
Suspense for progressive rendering. Edit the text referencing "mini_racer" in
the snippet so it mentions "ExecJS (runtime depends on environment)" and keep
the existing references to renderToPipeableStream and the upgrade link intact.
In `@docs/pro/streaming-ssr.md`:
- Around line 79-81: The example shows stream_react_component with an explicit
prerender: true option which is not configurable for streaming calls; remove the
prerender: true from the example invocation (update the snippet using
stream_react_component('ProductPage', props: { id: `@product.id` }) so the docs no
longer imply prerender is a supported/adjustable option for streaming).
---
Nitpick comments:
In `@docs/pro/streaming-ssr.md`:
- Around line 66-70: Remove the redundant include of ActionController::Live from
the ProductsController example: since ReactOnRailsPro::Stream already mixes in
ActionController::Live, delete the line including ActionController::Live and
keep include ReactOnRails::Controller and include ReactOnRailsPro::Stream so the
snippet remains accurate and concise.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bfd82c1b-7611-45b4-83ee-dce68a9acf7b
📒 Files selected for processing (10)
docs/oss/building-features/caching.mddocs/oss/building-features/streaming-server-rendering.mddocs/oss/configuration/README.mddocs/oss/core-concepts/react-server-rendering.mddocs/oss/deployment/server-rendering-tips.mddocs/oss/getting-started/quick-start.mddocs/pro/fragment-caching.mddocs/pro/home-pro.mddocs/pro/node-renderer.mddocs/pro/streaming-ssr.md
- Remove duplicate legacy `# Features` section (lines 71-171) from home-pro.md that conflicted with the new `## Features` section - Fix "mini_racer" → "ExecJS" in streaming-server-rendering.md tip - Fix "React 19's" → "React 18/19's" for renderToPipeableStream in react-server-rendering.md (API was introduced in React 18) - Remove misleading `prerender: true` from stream_react_component example in streaming-ssr.md (forced internally, not user-configurable) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Overall this is a solid docs improvement — the new dedicated Pro feature pages are well-structured and the Docusaurus 1. React version inconsistency (streaming-ssr.md) 2. Async component example is RSC-specific, not standard streaming SSR 3. Security anti-pattern in configuration example (node-renderer.md) Minor nit: docs/oss/configuration/README.md removes the emoji from the 'Good News!' callout — this appears to be an unintentional side-effect of the surrounding edit rather than a deliberate change. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 169a8b8baa
ℹ️ 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".
The tip callout should be a generic Pro CTA, not single out one feature. Moved the Fragment Caching overview link to the Level 2 section intro where it's contextually relevant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Review: Docs — Expand Pro Docs and Add Pro Badges to OSS DocsOverall this is a well-structured documentation PR. The new pages are clear, well-organized, and the migration from inline blockquotes to Docusaurus A few issues worth addressing before merge: React 18 vs React 19 inconsistency (Medium)
Recommend either changing the intro to consistently say 'React 19' (since that's what's required), or using a React 18-compatible async data-fetching pattern in the example and calling out RSC as a separate React 19 feature. Stale intro in The opening paragraph of Removed editorial content (Low / Intentional?) The PR removes the Testimonials, FAQ (including the 'why upgrade from ExecJS' section), and the GitHub Sponsors call-to-action from Pre-existing:
All file-level cross-links were verified and resolve correctly. No application code was changed so there is no regression risk. |
The OSS building-features file now serves as a concise overview (what, why, quick example, link to full guide) while the Pro file absorbs all detailed implementation content: step-by-step setup, compression middleware compatibility, metadata handling, script loading strategies, immediate hydration, and best practices. Updated anchor links in troubleshooting.md, server-rendering-tips.md, server-side-rendering.md, and release-notes/4.0.md to point to the new location of detailed content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| const SlowDataComponent = async () => { | ||
| const data = await fetchData(); | ||
| return <div>{data}</div>; | ||
| }; |
There was a problem hiding this comment.
Async function component is an RSC pattern, not standard streaming SSR
SlowDataComponent is written as an async arrow function:
const SlowDataComponent = async () => {
const data = await fetchData();
return <div>{data}</div>;
};Async function components are a React Server Components feature. In standard streaming SSR with renderToPipeableStream (without RSC infrastructure), React will throw when it encounters an async component. The Suspense boundary won't catch it — it will surface as an unhandled promise rejection on the server.
For standard streaming SSR the data-fetching pattern is either:
- The
use()hook with a pre-created promise (React 19):
const SlowDataComponent = () => {
const data = use(fetchData());
return <div>{data}</div>;
};- A data-fetching library (SWR, React Query) that integrates with Suspense.
If this example requires RSC, that should be stated explicitly with a note that RSC setup is distinct from streaming SSR alone.
| class ExampleController < ApplicationController | ||
| include ActionController::Live | ||
| include ReactOnRails::Controller | ||
| include ReactOnRailsPro::Stream |
There was a problem hiding this comment.
Redundant ActionController::Live include
ReactOnRailsPro::Stream already mixes in ActionController::Live, so including it explicitly adds noise and may mislead readers into thinking it's a separate required step.
| class ExampleController < ApplicationController | |
| include ActionController::Live | |
| include ReactOnRails::Controller | |
| include ReactOnRailsPro::Stream | |
| class ExampleController < ApplicationController | |
| include ReactOnRails::Controller | |
| include ReactOnRailsPro::Stream | |
| def show | |
| stream_view_containing_react_components(template: 'example/show') | |
| end | |
| end |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/pro/streaming-ssr.md`:
- Line 131: Replace instances of the phrase "full page reload" with the
hyphenated compound adjective "full-page reload" in the streaming-ssr doc;
update both occurrences (the sentence currently reading "The browser renders
these updates without a full page reload" and the other occurrence later in the
file) to use "full-page" for consistent, readable compound-adjective usage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9d41a1fa-2f35-4d4f-b1e8-1bcd51adbce4
📒 Files selected for processing (6)
docs/oss/building-features/streaming-server-rendering.mddocs/oss/deployment/server-rendering-tips.mddocs/pro/react-server-components/server-side-rendering.mddocs/pro/release-notes/4.0.mddocs/pro/streaming-ssr.mddocs/pro/troubleshooting.md
✅ Files skipped from review due to trivial changes (3)
- docs/pro/react-server-components/server-side-rendering.md
- docs/pro/troubleshooting.md
- docs/pro/release-notes/4.0.md
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/oss/deployment/server-rendering-tips.md
|
Overall this is a well-structured documentation improvement. The new dedicated Pro feature pages are clearly written and the Compression middleware guidance now gated behind Pro docs The old OSS The OSS page does link to the Pro guide for this section, but users who assume the Pro guide does not apply to them may overlook it. Consider either keeping the Compression Middleware section in the OSS doc, or adding a note on the pointer that the fix applies regardless of whether you use Pro. Other notes:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Insecure hardcoded fallback password in documentation example
- I replaced the hardcoded
"changeme"fallback withENV.fetch("RENDERER_PASSWORD")so the example requires an explicit secret instead of using a known default.
- I replaced the hardcoded
Or push these changes by commenting:
@cursor push 9ecf6622c3
Preview (9ecf6622c3)
diff --git a/docs/pro/node-renderer.md b/docs/pro/node-renderer.md
--- a/docs/pro/node-renderer.md
+++ b/docs/pro/node-renderer.md
@@ -65,7 +65,7 @@
ReactOnRailsPro.configure do |config|
config.server_renderer = "NodeRenderer"
config.renderer_url = ENV["REACT_RENDERER_URL"] || "http://localhost:3800"
- config.renderer_password = ENV["RENDERER_PASSWORD"] || "changeme"
+ config.renderer_password = ENV.fetch("RENDERER_PASSWORD")
end
</details>
<!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END -->
- node-renderer.md: Change `|| "changeme"` to `ENV.fetch` with "devPassword" default, matching the Pro generator template - streaming-ssr.md: Remove outdated "v4.0.0.rc.5" minimum version (Pro is now at 16.x) - fragment-caching.md: Qualify deploy cache invalidation — bundle digest is only included when prerender: true Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLAUDE.mdTool-specific guidance for Claude Code in this repository. Source of Truth
If this file conflicts with Behavioral Defaults
Git Safety
Claude-Specific WorkflowUse these docs for Claude-oriented operational guidance:
For Pro-package specifics, also read |
|
Deleting wrong comment - please ignore |
PR Review: Docs — Expand Pro docs and add Pro badges to OSS docsGood overall restructuring. The new dedicated Pro pages (Node Renderer, Streaming SSR, Fragment Caching) are well-written, and the move from raw blockquotes to Docusaurus tip admonitions is a clear improvement. A few issues worth addressing: Security concern — hardcoded fallback password docs/pro/node-renderer.md line 68 still uses a default password value. Cursor flagged the earlier changeme in a prior commit and it was updated to devPassword — but the problem remains: users who follow this snippet verbatim will deploy with a known default. ENV.fetch without a second argument raises a KeyError at boot, which forces the developer to explicitly configure the secret before the app starts. See inline comment. Redundant ActionController::Live include Both docs/pro/streaming-ssr.md and docs/oss/building-features/streaming-server-rendering.md include both ActionController::Live and ReactOnRailsPro::Stream in the controller example. CodeRabbit noted that ReactOnRailsPro::Stream already mixes in ActionController::Live, making the explicit include redundant and potentially confusing for users who wonder whether they need both. See inline comments. OSS streaming page framing docs/oss/building-features/streaming-server-rendering.md opens with the tip box, then immediately continues with React on Rails Pro supports streaming server rendering. A user arriving on the OSS page via search will see an intro that describes a Pro-only feature as the page subject. A brief framing sentence about what streaming SSR is before the Pro description would help orient OSS users. Removed content from home-pro.md The refactor removed the Testimonials, FAQ, and Support React on Rails development sections. This appears to be collateral removal when the duplicate Features block was cleaned up. The FAQ (Why should I use Pro if ExecJS seems to work?) was useful onboarding content. Was this intentional, or should it be preserved somewhere? Minor — hyphenation inconsistency docs/pro/streaming-ssr.md line 131 reads without a full page reload while line 19 of the same file says no full-page reload needed. The compound adjective should be hyphenated consistently. |
| ReactOnRailsPro.configure do |config| | ||
| config.server_renderer = "NodeRenderer" | ||
| config.renderer_url = ENV["REACT_RENDERER_URL"] || "http://localhost:3800" | ||
| config.renderer_password = ENV.fetch("RENDERER_PASSWORD", "devPassword") |
There was a problem hiding this comment.
The "devPassword" fallback was changed from "changeme" (flagged by Cursor) but still exposes the same risk: a user who copies this snippet without setting RENDERER_PASSWORD will deploy with a publicly-known default secret.
Using ENV.fetch without a second argument raises KeyError at startup, which is far safer — the app refuses to boot until the secret is explicitly configured:
| config.renderer_password = ENV.fetch("RENDERER_PASSWORD", "devPassword") | |
| config.renderer_password = ENV.fetch("RENDERER_PASSWORD") |
If a dev-only fallback is genuinely wanted, add an explanatory comment:
# Set a strong secret in production. Falls back to a dev default only.
config.renderer_password = ENV.fetch("RENDERER_PASSWORD", "devPassword")| class ProductsController < ApplicationController | ||
| include ActionController::Live | ||
| include ReactOnRails::Controller | ||
| include ReactOnRailsPro::Stream |
There was a problem hiding this comment.
Same redundancy as in the Pro guide: if ReactOnRailsPro::Stream already includes ActionController::Live, showing both in the quick example creates confusion about what users actually need to add.
| class ProductsController < ApplicationController | |
| include ActionController::Live | |
| include ReactOnRails::Controller | |
| include ReactOnRailsPro::Stream | |
| class ProductsController < ApplicationController | |
| include ReactOnRails::Controller | |
| include ReactOnRailsPro::Stream |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b9afe843f
ℹ️ 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".
… hydration - fragment-caching.md: Change code fence from `ruby` to `erb` for ERB template - streaming-ssr.md: Add missing `import ReactOnRails` in registration example - streaming-ssr.md: Clarify immediate_hydration is auto-enabled (no config needed), show opt-out instead of opt-in Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
||
| const fetchData = async () => { | ||
| // Simulate API call | ||
| const response = await fetch('api/endpoint'); |
There was a problem hiding this comment.
Bug: relative URL breaks in Node.js SSR context
fetch('api/endpoint') is a relative URL. When this code runs inside the Node Renderer during SSR, there is no base URL to resolve against — the fetch will fail or produce an error at runtime.
This example should either use an absolute URL or, better, illustrate the more realistic pattern of reading from a database/service:
| const response = await fetch('api/endpoint'); | |
| const fetchData = async () => { | |
| // In SSR, use absolute URLs or read from your data layer directly | |
| const response = await fetch('https://your-api.example.com/api/endpoint'); | |
| return response.json(); | |
| }; |
Or replace the whole example with a DB/ORM access pattern (e.g., calling an ActiveRecord model via a custom API), which is the common real-world case.
| ```json | ||
| "dependencies": { | ||
| "react": "19.0.0", | ||
| "react-dom": "19.0.0" | ||
| } |
There was a problem hiding this comment.
Exact version pin will block patch/security updates
Pinning to "react": "19.0.0" (exact) means developers who copy-paste this won't receive security patches or bug fixes unless they manually update. Standard practice is to use a caret range:
| ```json | |
| "dependencies": { | |
| "react": "19.0.0", | |
| "react-dom": "19.0.0" | |
| } | |
| "dependencies": { | |
| "react": "^19.0.0", | |
| "react-dom": "^19.0.0" | |
| } |
Same issue exists in the original OSS streaming doc (carried over from the old content).
| ```ruby | ||
| # app/controllers/example_controller.rb | ||
|
|
||
| class ExampleController < ApplicationController | ||
| class ProductsController < ApplicationController | ||
| include ActionController::Live | ||
| include ReactOnRails::Controller | ||
| include ReactOnRailsPro::Stream | ||
|
|
||
| def show | ||
| stream_view_containing_react_components(template: 'example/show') | ||
| stream_view_containing_react_components(template: 'products/show') | ||
| end | ||
| end | ||
| ``` |
There was a problem hiding this comment.
Pro-only code in OSS page quick example — no warning
The :::tip Pro Feature at the top of this page correctly signals that streaming SSR requires Pro. However, this "Quick Example" then shows a controller that includes ReactOnRailsPro::Stream without any further note that this module is Pro-only.
An OSS user who skims past the tip admonition and copies the example will hit a NameError: uninitialized constant ReactOnRailsPro at runtime.
Consider wrapping the Ruby and ERB snippets in a :::note callout like:
:::note
The following examples require a React on Rails Pro license. See the [full guide](../../pro/streaming-ssr.md) for setup.
:::
Or replace the examples with read-only pseudocode so readers understand the shape of the API without being tempted to copy-paste non-functional code.
|
|
||
| **For Pages WITHOUT Streaming Components:** | ||
|
|
||
| With Shakapacker ≥ 8.2.0, `async: true` is recommended even for non-streaming pages to improve Time to Interactive (TTI): | ||
|
|
||
| ```erb | ||
| <!-- ✅ RECOMMENDED: Use async with immediate_hydration for optimal performance --> | ||
| <%= javascript_pack_tag('client-bundle', 'data-turbo-track': 'reload', async: true) %> | ||
| ``` |
There was a problem hiding this comment.
Inconsistency: old OSS doc required explicit config; new Pro doc says automatic
The old streaming-server-rendering.md (OSS) showed:
ReactOnRails.configure do |config|
config.immediate_hydration = true # Enable early hydration
endThis new page says "React on Rails Pro automatically enables the immediate_hydration feature … no configuration needed." If it truly became automatic in Pro 4.x, this is a good clarification — but it should explicitly say since which version so users upgrading from older Pro releases know what to expect (and can remove the old explicit config line if they have it).
Review: Docs — expand Pro docs and add Pro badges to OSS docsOverall this is a well-structured documentation refactor. The three new dedicated Pro pages ( Issues foundBug — relative URL in SSR fetch example ( Pinned exact React version ( Pro-only code in OSS page without sufficient warning (
Minor observations (no blocking)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd6d9cc0b5
ℹ️ 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".
|
|
||
| ```jsx | ||
| // app/javascript/packs/registration.jsx | ||
| import ReactOnRails from 'react-on-rails'; |
There was a problem hiding this comment.
Use the Pro package in the streaming registration example
This example imports react-on-rails, but streaming SSR depends on Pro-only behavior. In the core package, streamServerRenderedReactComponent is just a stub that throws (packages/react-on-rails/src/createReactOnRails.ts:71-73), and the core client startup still waits until full page load (packages/react-on-rails/src/clientStartup.ts:28-30). The Pro installation guide and dummy app both import react-on-rails-pro instead (docs/pro/installation.md:177-185, react_on_rails_pro/spec/dummy/client/app/packs/client-bundle.js:3). If a reader copies this registration file into their client/server bundles, the server bundle cannot perform streaming SSR and the client loses the immediate/selective hydration behavior this page is promising.
Useful? React with 👍 / 👎.
| The fastest way to set up the Node Renderer is with the Pro generator: | ||
|
|
||
| ```bash | ||
| bundle exec rails generate react_on_rails:pro |
There was a problem hiding this comment.
Point fresh installs at the
install --pro generator
react_on_rails:pro is only the upgrade path for apps that already have the base React on Rails install. The generator explicitly aborts when config/initializers/react_on_rails.rb is missing and tells users to run rails g react_on_rails:install first (react_on_rails/lib/generators/react_on_rails/pro_generator.rb:48-64, react_on_rails/lib/generators/react_on_rails/pro/USAGE:19-21). Presenting bundle exec rails generate react_on_rails:pro as the general “fastest” setup here means a fresh Pro install hits a prerequisite error on the first command instead of getting a working Node renderer setup.
Useful? React with 👍 / 👎.
## 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](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!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. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1ecdaa3. 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 * **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 <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## 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) <noreply@anthropic.com>
- Add 3 dedicated Pro feature overview pages: `docs/pro/node-renderer.md`, `docs/pro/streaming-ssr.md`, `docs/pro/fragment-caching.md` - Add Docusaurus `:::tip` admonition callouts to 6 OSS docs that have Pro upgrade paths (server rendering, streaming SSR, caching, configuration, deployment tips, quick start) - Update `docs/pro/home-pro.md` to link to the new dedicated feature pages Closes #2783 - [ ] Verify all Pro doc links resolve correctly (node-renderer.md, streaming-ssr.md, fragment-caching.md) - [ ] Verify `:::tip` admonitions render correctly in Docusaurus - [ ] Check that cross-references between OSS and Pro docs are valid - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only changes that add new Pro guides and adjust cross-links/callouts; low risk beyond potential broken links or Docusaurus admonition rendering issues. > > **Overview** > Adds three new React on Rails Pro overview guides for **`Node Renderer`**, **`Streaming SSR`**, and **`Fragment Caching`**, and reorganizes Pro docs (`home-pro.md`, release notes, troubleshooting, RSC SSR doc) to link to these dedicated pages. > > Updates several OSS docs to use consistent `:::tip` Pro admonitions and to **cross-link/redirect** detailed Pro content (notably trimming `streaming-server-rendering.md` down to a short overview that points to the new Pro streaming guide), plus minor link fixes (e.g., compression middleware troubleshooting now points to `docs/pro/streaming-ssr.md`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit dd6d9cc. 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 --> * **Documentation** * Replaced plain OSS/Pro callouts with unified Pro tip/admonition blocks and added internal cross-links to Pro content. * Simplified OSS streaming SSR guide and redirected detailed guidance to a new Pro Streaming SSR guide. * Added Pro documentation: Node Renderer, Streaming SSR, and Fragment Caching with examples, comparisons, and prerequisites. * Updated Pro home, configuration, and troubleshooting pages to reference the new Pro feature pages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 3 dedicated Pro feature overview pages: `docs/pro/node-renderer.md`, `docs/pro/streaming-ssr.md`, `docs/pro/fragment-caching.md` - Add Docusaurus `:::tip` admonition callouts to 6 OSS docs that have Pro upgrade paths (server rendering, streaming SSR, caching, configuration, deployment tips, quick start) - Update `docs/pro/home-pro.md` to link to the new dedicated feature pages Closes #2783 - [ ] Verify all Pro doc links resolve correctly (node-renderer.md, streaming-ssr.md, fragment-caching.md) - [ ] Verify `:::tip` admonitions render correctly in Docusaurus - [ ] Check that cross-references between OSS and Pro docs are valid - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Documentation-only changes that add new Pro guides and adjust cross-links/callouts; low risk beyond potential broken links or Docusaurus admonition rendering issues. > > **Overview** > Adds three new React on Rails Pro overview guides for **`Node Renderer`**, **`Streaming SSR`**, and **`Fragment Caching`**, and reorganizes Pro docs (`home-pro.md`, release notes, troubleshooting, RSC SSR doc) to link to these dedicated pages. > > Updates several OSS docs to use consistent `:::tip` Pro admonitions and to **cross-link/redirect** detailed Pro content (notably trimming `streaming-server-rendering.md` down to a short overview that points to the new Pro streaming guide), plus minor link fixes (e.g., compression middleware troubleshooting now points to `docs/pro/streaming-ssr.md`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit dd6d9cc. 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 --> * **Documentation** * Replaced plain OSS/Pro callouts with unified Pro tip/admonition blocks and added internal cross-links to Pro content. * Simplified OSS streaming SSR guide and redirected detailed guidance to a new Pro Streaming SSR guide. * Added Pro documentation: Node Renderer, Streaming SSR, and Fragment Caching with examples, comparisons, and prerequisites. * Updated Pro home, configuration, and troubleshooting pages to reference the new Pro feature pages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>


Summary
docs/pro/node-renderer.md,docs/pro/streaming-ssr.md,docs/pro/fragment-caching.md:::tipadmonition callouts to 6 OSS docs that have Pro upgrade paths (server rendering, streaming SSR, caching, configuration, deployment tips, quick start)docs/pro/home-pro.mdto link to the new dedicated feature pagesCloses #2783
Test plan
:::tipadmonitions render correctly in Docusaurus🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes that add new Pro guides and adjust cross-links/callouts; low risk beyond potential broken links or Docusaurus admonition rendering issues.
Overview
Adds three new React on Rails Pro overview guides for
Node Renderer,Streaming SSR, andFragment Caching, and reorganizes Pro docs (home-pro.md, release notes, troubleshooting, RSC SSR doc) to link to these dedicated pages.Updates several OSS docs to use consistent
:::tipPro admonitions and to cross-link/redirect detailed Pro content (notably trimmingstreaming-server-rendering.mddown to a short overview that points to the new Pro streaming guide), plus minor link fixes (e.g., compression middleware troubleshooting now points todocs/pro/streaming-ssr.md).Written by Cursor Bugbot for commit dd6d9cc. This will update automatically on new commits. Configure here.
Summary by CodeRabbit