Skip to content

Commit 9e71313

Browse files
justin808claude
andcommitted
Address review feedback: stale heading, missing only:, version range, redundant prerender
- Remove stale "with Async Props" from Pattern 3 heading in rsc-context-and-state.md - Add only: whitelist to User.find.as_json in rsc-data-fetching.md - Fix form_with version range from 5.2 to 5.1 in rsc-third-party-libs.md - Remove redundant prerender: true from stream_react_component in rsc-preparing-app.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8140bb4 commit 9e71313

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

docs/oss/migrating/rsc-context-and-state.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default function ProductPage({ user, product }) {
120120

121121
**Key insight:** Components that don't need context (static header, footer) stay **outside** the provider wrapper, keeping them as Server Components with zero JavaScript cost.
122122

123-
## Pattern 3: Streaming Slow Data with Async Props
123+
## Pattern 3: Streaming Slow Data
124124

125125
> **Note:** This section covers a cross-cutting concern (data fetching via `stream_react_component`) that affects how you structure context and state. For the full treatment of data fetching patterns, see [Data Fetching Migration](rsc-data-fetching.md).
126126

docs/oss/migrating/rsc-data-fetching.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ For data that is truly independent, render multiple `stream_react_component` cal
362362
<%= stream_react_component("DashboardHeader",
363363
props: { title: "My Dashboard" }) %>
364364
<%= stream_react_component("UserProfile",
365-
props: { user: User.find(params[:user_id]).as_json }) %>
365+
props: { user: User.find(params[:user_id]).as_json(only: [:id, :name, :avatar_url]) }) %>
366366
<%= stream_react_component("StatsPanel",
367367
props: { stats: DashboardStats.compute.as_json }) %>
368368
<%= stream_react_component("PostFeed",

docs/oss/migrating/rsc-preparing-app.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,7 @@ In each view, replace `react_component` with `stream_react_component`:
514514
<%# app/views/products/show.html.erb %>
515515
<h1><%= @product.name %></h1>
516516
<%= stream_react_component("ProductPage",
517-
props: { product: @product.as_json(include: [:specs, :reviews]) },
518-
prerender: true) %>
517+
props: { product: @product.as_json(include: [:specs, :reviews]) }) %>
519518
```
520519

521520
`stream_react_component` automatically sets `prerender: true` and enables `immediate_hydration` for optimal selective hydration. The component renders identically -- the difference is that the response is now streamed, which will matter when you start adding Suspense boundaries and async Server Components.

docs/oss/migrating/rsc-third-party-libs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default function UserForm() {
194194
<% end %>
195195
```
196196

197-
> **Note:** `local: true` is required for Rails 5.2–6.0, where `form_with` defaults to `remote: true` (Ajax). Rails 6.1+ defaults to `local: true`, so it can be omitted on newer versions.
197+
> **Note:** `local: true` is required for Rails 5.1–6.0, where `form_with` defaults to `remote: true` (Ajax). Rails 6.1+ defaults to `local: true`, so it can be omitted on newer versions.
198198
199199
Both patterns leverage Rails' full controller/model layer -- authentication, authorization, CSRF protection, and validations all work as expected.
200200

0 commit comments

Comments
 (0)