Skip to content

Commit bc716e0

Browse files
ihabadhamclaude
andcommitted
Move ServerComponentsPage to ror_components for auto-discovery
Justin's PR used manual registerServerComponent() in stimulus-bundle.js because his custom rspackRscPlugin didn't integrate with the auto-bundling flow. With the upstream RSCWebpackPlugin, auto-bundling works: the generate_packs task scans ror_components/ directories, classifies files without 'use client' as Server Components, and generates the registration file in generated/ServerComponentsPage.js automatically. Moved from: bundles/server-components/ServerComponentsPage.jsx Moved to: bundles/server-components/ror_components/ServerComponentsPage.jsx Updated relative imports (./components/ -> ../components/) and flipped the view from auto_load_bundle: false to true. No manual registration, no stimulus-bundle.js modification. Matches the Pro dummy pattern where server component sources sit in the auto-discovered directory. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 138befb commit bc716e0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= react_component("ServerComponentsPage",
22
prerender: false,
3-
auto_load_bundle: false,
3+
auto_load_bundle: true,
44
trace: Rails.env.development?,
55
id: "ServerComponentsPage-react-component-0") %>

client/app/bundles/server-components/ServerComponentsPage.jsx renamed to client/app/bundles/server-components/ror_components/ServerComponentsPage.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// None of these imports are shipped to the client bundle.
44

55
import React, { Suspense } from 'react';
6-
import ServerInfo from './components/ServerInfo';
7-
import CommentsFeed from './components/CommentsFeed';
8-
import TogglePanel from './components/TogglePanel';
6+
import ServerInfo from '../components/ServerInfo';
7+
import CommentsFeed from '../components/CommentsFeed';
8+
import TogglePanel from '../components/TogglePanel';
99

1010
const ServerComponentsPage = () => {
1111
return (

0 commit comments

Comments
 (0)