Skip to content

Add --pro and --rsc flags to install generator#2284

Merged
justin808 merged 69 commits intomasterfrom
ihabadham/feature/pro-rsc-generator
Feb 16, 2026
Merged

Add --pro and --rsc flags to install generator#2284
justin808 merged 69 commits intomasterfrom
ihabadham/feature/pro-rsc-generator

Conversation

@ihabadham
Copy link
Copy Markdown
Collaborator

@ihabadham ihabadham commented Jan 5, 2026

Summary

Adds --pro and --rsc flags to rails g react_on_rails:install, plus standalone generators for upgrading existing apps.

New commands:

# Fresh install with Pro
rails g react_on_rails:install --pro

# Fresh install with RSC (includes Pro)
rails g react_on_rails:install --rsc

# Upgrade existing React on Rails app to Pro
rails g react_on_rails:pro

# Upgrade existing Pro app to RSC
rails g react_on_rails:rsc

Closes #2277

What's Included

Pro Generator (--pro)

  • Creates config/initializers/react_on_rails_pro.rb with Node Renderer config
  • Creates client/node-renderer.js bootstrap file
  • Appends node-renderer process to Procfile.dev
  • Installs react-on-rails-pro and react-on-rails-pro-node-renderer npm packages
  • Handles upgrade from base React on Rails (removes react-on-rails package when installing Pro)

RSC Generator (--rsc)

  • Creates config/webpack/rscWebpackConfig.js for React Server Components bundle
  • Creates HelloServer example component (JSX and TypeScript variants)
  • Creates HelloServerController and view
  • Adds RSC routes (rsc_payload_route, hello_server)
  • Installs react-on-rails-rsc npm package
  • Pins React to ~19.0.4 (security: CVE-2025-55182, CVE-2025-67779, CVE-2026-23864)
  • Adds RSC config to react_on_rails_pro.rb initializer

Standalone Generators

  • react_on_rails:pro — upgrades an existing React on Rails app to Pro
  • react_on_rails:rsc — upgrades an existing Pro app to RSC
  • Reuses the same setup modules as the install generator flags
  • Prerequisite validation (Pro gem required, React version check for RSC)

Webpack Config Transforms

  • Renames generateWebpackConfigs.jsServerClientOrBoth.js with RSC bundle support
  • Adds rscBundle parameter to serverWebpackConfig.js for RSC builds
  • Adds client/server webpack config conditionals for Pro

Documentation

  • USAGE files for standalone Pro and RSC generators
  • Generator details in docs/api-reference/generator-details.md
  • Pro installation guide additions in react_on_rails_pro/docs/installation.md

Testing

  • Unit tests for Pro/RSC prerequisite validation
  • Integration tests for --pro, --rsc, and all flag combinations (--typescript, --redux, --rspack)
  • Integration tests for standalone pro and rsc generators
  • Idempotency tests
  • Regression test for webpack config transforms

Design Decisions

  • Reusable modules: Pro and RSC setup logic lives in ProSetup and RscSetup modules, shared between install flags and standalone generators
  • Idempotent: All generators are safe to run multiple times — existing files aren't overwritten, Procfile entries aren't duplicated
  • Flag combinations: Works with --typescript, --redux, --rspack
  • React version pinning: RSC pins to ~19.0.4 (not latest 19.x) because RSC support requires 19.0.x specifically

Test Plan

  • bundle exec rspec spec/react_on_rails/generators/ — all generator tests pass
  • Manual verification in test app — Pro and RSC setup works end-to-end
  • CI: rspec-package-tests, markdown-link-check, pre-commit hooks

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added --pro and --rsc generator flags and standalone generators; auto-sets up Node Renderer, Procfile.dev entries, webpack transforms, and dependency changes.
    • Scaffolds React Server Components (HelloServer + client LikeButton), routes, controller, views, and RSC webpack bundle.
  • Documentation

    • Expanded generator docs, Pro installation/usage, Node Renderer guide, and RSC usage/prerequisites.
  • Tests

    • Expanded generator and integration specs covering Pro, RSC, TypeScript, Redux, Rspack, and idempotence.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 5, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds --pro and --rsc generator flags and standalone pro/rsc generators; scaffolds Pro initializer and node renderer, RSC webpack/config/components/routes, updates Procfile and webpack templates, augments JS dependency handling and generator helpers, and adds tests and documentation.

Changes

Cohort / File(s) Summary
Generator core & helpers
react_on_rails/lib/generators/react_on_rails/base_generator.rb, react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb, react_on_rails/lib/generators/react_on_rails/generator_helper.rb, react_on_rails/lib/generators/react_on_rails/generator_messages.rb
Adds --pro/--rsc options and :rsc test flag; feature-detection helpers (use_pro?, use_rsc?, pro_gem_installed?), React version detection, message printing, and conditional scaffolding (routes, HelloWorld/HelloServer, assets).
Install orchestration & JS deps
react_on_rails/lib/generators/react_on_rails/install_generator.rb, react_on_rails/lib/generators/react_on_rails/js_dependency_manager.rb
Install generator forwards pro/rsc flags and invokes Pro/RSC flows; JS manager adds PRO/RSC dependency sets, removes/upgrades base package, pins React for RSC, and detects Rspack.
Pro generator & setup
react_on_rails/lib/generators/react_on_rails/pro_generator.rb, react_on_rails/lib/generators/react_on_rails/pro_setup.rb, react_on_rails/lib/generators/react_on_rails/pro/USAGE
New ProGenerator + ProSetup create config/initializers/react_on_rails_pro.rb, client/node-renderer.js, Procfile.dev entries, modify server webpack template, validate prerequisites, and add Pro npm packages.
RSC generator & setup
react_on_rails/lib/generators/react_on_rails/rsc_generator.rb, react_on_rails/lib/generators/react_on_rails/rsc_setup.rb, react_on_rails/lib/generators/react_on_rails/rsc/USAGE
New RscGenerator + RscSetup (RSC implies Pro) generate rscWebpackConfig, HelloServer components/controllers/views/routes, Procfile.dev watcher, inject RSC wiring into webpack templates, and warn about React version compatibility.
Webpack templates & rename
react_on_rails/lib/generators/.../templates/.../config/webpack/ServerClientOrBoth.js.tt, serverWebpackConfig.js.tt, clientWebpackConfig.js.tt, rscWebpackConfig.js.tt, development.js.tt, production.js.tt, test.js.tt
Rename generateWebpackConfigsServerClientOrBoth, export serverClientOrBoth, add conditional imports/exports for Pro/RSC, expose extractLoader under Pro, and template an RSC webpack config.
Pro & RSC templates / assets
react_on_rails/lib/generators/.../templates/pro/..., react_on_rails/lib/generators/.../templates/rsc/...
Adds Pro initializer template, node-renderer bootstrap, node renderer Procfile entry, HelloServer (JSX/TSX) components and wrappers, LikeButton client component, HelloServer controller/view, and RSC webpack template.
Tests & fixtures
react_on_rails/lib/generators/.../templates/dev_tests/spec/system/hello_server_spec.rb, react_on_rails/spec/react_on_rails/generators/*, react_on_rails/spec/.../support/generator_spec_helper.rb
Adds hello_server system test, many new generator specs for --pro/--rsc combinations (TypeScript/Redux/Rspack variants), idempotence/prerequisite checks, React version warnings, and webpack fixture helpers.
Engine / misc core
react_on_rails/lib/react_on_rails/engine.rb, react_on_rails/lib/react_on_rails/version_checker.rb, react_on_rails/.rubocop.yml
Switches generator detection to defined?(Rails::Generators), improves Pro upgrade messaging, and excludes new specs from RuboCop BeforeAfterAll.
Docs & Procfile updates
docs/api-reference/generator-details.md, react_on_rails_pro/docs/*, react_on_rails/spec/dummy/Procfile.dev
Documents --pro/--rsc options and usage, adds Pro docs (node-renderer), and renames Procfile.dev entries (wp-client/wp-serverdev-server/server-bundle).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant InstallGen as InstallGenerator
    participant ProGen as ProGenerator
    participant RscGen as RscGenerator
    participant FS as FileSystem
    participant NPM as NPM/PackageManager

    User->>InstallGen: run generator (--pro / --rsc)
    InstallGen->>InstallGen: validate prerequisites (pro gem, react version)
    InstallGen->>ProGen: invoke pro flow (if use_pro?)
    ProGen->>FS: create initializer, client/node-renderer.js, patch Procfile.dev, update server webpack
    ProGen->>NPM: add Pro npm packages
    InstallGen->>RscGen: invoke rsc flow (if use_rsc?)
    RscGen->>FS: create rscWebpackConfig, HelloServer components, controller/view, add routes, append RSC watcher
    RscGen->>NPM: add RSC npm packages
    InstallGen->>NPM: finalize remaining JS dependencies
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

Poem

"I hopped through code with nimble paws,
I stitched new flags and patched the laws,
Pro wakes node and RSC hums server-side,
Bundles bloom, tests cheer — a carrot for the stride! 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.05% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (40 files):

⚔️ CHANGELOG.md (content)
⚔️ docs/api-reference/generator-details.md (content)
⚔️ package.json (content)
⚔️ packages/create-react-on-rails-app/package.json (content)
⚔️ packages/react-on-rails-pro-node-renderer/package.json (content)
⚔️ packages/react-on-rails-pro/package.json (content)
⚔️ packages/react-on-rails/package.json (content)
⚔️ pnpm-lock.yaml (content)
⚔️ react_on_rails/.rubocop.yml (content)
⚔️ react_on_rails/Gemfile.lock (content)
⚔️ react_on_rails/lib/generators/react_on_rails/base_generator.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/generator_helper.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/generator_messages.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/install_generator.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/js_dependency_manager.rb (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/Procfile.dev (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/clientWebpackConfig.js.tt (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/development.js.tt (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/production.js.tt (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/serverWebpackConfig.js.tt (content)
⚔️ react_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/test.js.tt (content)
⚔️ react_on_rails/lib/react_on_rails/engine.rb (content)
⚔️ react_on_rails/lib/react_on_rails/helper.rb (content)
⚔️ react_on_rails/lib/react_on_rails/pro_helper.rb (content)
⚔️ react_on_rails/lib/react_on_rails/version.rb (content)
⚔️ react_on_rails/lib/react_on_rails/version_checker.rb (content)
⚔️ react_on_rails/spec/dummy/Gemfile.lock (content)
⚔️ react_on_rails/spec/dummy/Procfile.dev (content)
⚔️ react_on_rails/spec/dummy/spec/helpers/react_on_rails_helper_spec.rb (content)
⚔️ react_on_rails/spec/react_on_rails/engine_spec.rb (content)
⚔️ react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb (content)
⚔️ react_on_rails/spec/react_on_rails/support/generator_spec_helper.rb (content)
⚔️ react_on_rails_pro/Gemfile.lock (content)
⚔️ react_on_rails_pro/docs/installation.md (content)
⚔️ react_on_rails_pro/docs/node-renderer/basics.md (content)
⚔️ react_on_rails_pro/lib/react_on_rails_pro/version.rb (content)
⚔️ react_on_rails_pro/spec/dummy/Gemfile.lock (content)
⚔️ react_on_rails_pro/spec/dummy/package.json (content)
⚔️ react_on_rails_pro/spec/execjs-compatible-dummy/Gemfile.lock (content)

These conflicts must be resolved before merging into master.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add --pro and --rsc flags to install generator' accurately summarizes the main change in the PR, which adds two new command-line flags to the install generator as specified in the linked issue #2277.
Linked Issues check ✅ Passed The pull request comprehensively addresses all coding requirements from issue #2277: adds --pro and --rsc flags with helper predicates, validates prerequisites, implements Pro/RSC setup with idempotent file operations, supports flag combinations, includes comprehensive tests, and updates documentation.
Out of Scope Changes check ✅ Passed All changes in the PR are directly aligned with the objectives in issue #2277. The changes include the new generators, supporting infrastructure, webpack config updates, documentation, and tests—all scoped to Pro and RSC feature implementation for the install generator.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ihabadham/feature/pro-rsc-generator

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.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@ihabadham ihabadham force-pushed the ihabadham/feature/pro-rsc-generator branch from 506aab7 to 5913009 Compare January 9, 2026 23:45
@ihabadham ihabadham force-pushed the ihabadham/feature/pro-rsc-generator branch from 5913009 to 2fa0366 Compare January 24, 2026 22:17
@claude

This comment has been minimized.

@claude

This comment has been minimized.

ihabadham and others added 8 commits February 11, 2026 18:34
This commit implements Phase 1 of the Pro/RSC generator feature:

Generator flags:
- --pro: Install React on Rails Pro with Node Renderer
- --rsc: Install React Server Components support (implies --pro)

Prerequisite validation:
- Checks if react_on_rails_pro gem is installed when flags are used
- Shows friendly error message with installation instructions
- Includes free trial messaging to lower friction

React version validation (RSC only):
- Warns if React version is not 19.0.x (required for RSC)
- Warns about security vulnerabilities (CVE-2025-55182, CVE-2025-67779)
  if React version is below 19.0.3

UX improvements:
- Added blank lines between generator messages for readability
- Improved license messaging ("Try Pro free!")

Code quality:
- Extracted gem_in_lockfile? helper to eliminate duplication
- Fixed memoization pattern in pro_gem_installed?
- Reused existing version parsing patterns from VersionChecker

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Test coverage for:
- missing_pro_gem? validation (5 tests)
  - --pro without gem → blocks with error
  - --rsc without gem → blocks with error
  - --pro with gem in loaded_specs → allows
  - --pro with gem in lockfile → allows
  - no flag → skips check

- detect_react_version parsing (4 tests)
  - standard version, caret prefix, workspace protocol, nil

- warn_about_react_version_for_rsc (5 tests)
  - React 19.0.3 → no warning
  - React 19.1.x/18.x → incompatibility warning
  - React 19.0.0-19.0.2 → CVE security warning
  - no --rsc → skips check

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Creates files and configuration for React on Rails Pro when --pro flag is used:

Files created:
- config/initializers/react_on_rails_pro.rb - Pro configuration
- client/node-renderer.js - Node Renderer bootstrap

Procfile.dev:
- Appends node-renderer process (idempotent)

NPM packages:
- react-on-rails-pro
- react-on-rails-pro-node-renderer

Implementation:
- setup_pro orchestrates Pro file generation
- Idempotency checks skip existing files
- Pro dependencies added in add_js_dependencies flow (single npm install)
- RSC config conditionally included when --rsc flag used

Templates based on:
- react_on_rails_pro/spec/dummy/ (actual patterns)
- react_on_rails_pro/docs/installation.md (config options)

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
When users upgrade from the base React on Rails to Pro:
- The validation now provides clear upgrade instructions with the
  REACT_ON_RAILS_SKIP_VALIDATION=true command
- The generator automatically removes the base 'react-on-rails' npm
  package when installing Pro, since Pro includes all base functionality

This enables a smooth upgrade path:
1. Add react_on_rails_pro gem to Gemfile
2. Run: REACT_ON_RAILS_SKIP_VALIDATION=true rails g react_on_rails:install --pro
3. Generator removes base package and installs Pro packages

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Tests cover:
- Pro initializer creation with NodeRenderer configuration
- node-renderer.js bootstrap file generation
- Procfile.dev node-renderer process addition
- Pro npm dependencies installation
- Flag combinations: --pro --redux, --pro --typescript, --pro --rspack
- Idempotency: existing Pro files are not overwritten
- Unit tests for add_pro_to_procfile behavior

This completes the test coverage for the Pro generator implementation
(Phase 2 of the --pro/--rsc generator feature).

Part of #2277

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
… bundle support

Aligns webpack config naming with Pro ecosystem convention. The rename
affects the generated config file and all require() references.

Adds RSC (React Server Components) three-bundle architecture support:
- RSC conditionals in ServerClientOrBoth.js for third bundle
- New rscWebpackConfig.js template that extends server config
- RSC_BUNDLE_ONLY env var for building RSC bundle separately

The RSC webpack config:
- Clones server webpack config
- Renames entry to rsc-bundle
- Adds react-on-rails-rsc/WebpackLoader after JS loader
- Adds react-server condition for RSC bundle identification
- Aliases react-dom/server to false (not needed for RSC payload)

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Adds setup_rsc method that runs when --rsc flag is used:
- Creates rscWebpackConfig.js from template
- Adds RSC bundle watcher to Procfile.dev

Adds react-on-rails-rsc npm package to RSC_DEPENDENCIES in
JsDependencyManager, installed alongside other dependencies
during generator run.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- serverWebpackConfig: Add target=node, libraryTarget, RSCWebpackPlugin,
  extractLoader, node=false for Pro mode
- clientWebpackConfig: Add RSCWebpackPlugin for RSC mode
- ServerClientOrBoth: Use destructured import for Pro mode
- rscWebpackConfig: Use destructured import from serverWebpackConfig
- base_generator: Add pro/rsc class options

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
ihabadham added a commit that referenced this pull request Mar 14, 2026
The --pro and --rsc combination contexts (--redux, --typescript, --rspack)
each duplicated the same Pro/RSC assertions inline with inconsistent depth.
Extract shared examples following the established pattern:

- pro_common_files: initializer (with NodeRenderer check), node-renderer.js
  (with content check), Procfile.dev (with port check). Combo contexts that
  previously had shallow or missing assertions now inherit full coverage.

- rsc_common_files: 5-file common files array + Pro initializer with all
  RSC config values (enable_rsc_support, rsc_bundle_js_file,
  rsc_payload_generation_url_path). Replaces 4 identical inline blocks.

Also reuse shared examples in standalone generator specs:
- pro_generator_spec.rb: use pro_common_files
- rsc_generator_spec.rb: use rsc_hello_server_files (levels up weak
  controller/view assertions to include layout, Stream, and no-prerender
  checks)

Remove stale TODO at install_generator_spec.rb that referenced "when --rsc
tests are added" — those tests were added in the same PR (#2284).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
ihabadham added a commit that referenced this pull request Mar 14, 2026
## Summary

- Remove no-op `prerender: true` from RSC generator template —
`stream_react_component` always performs server-side rendering and
ignores this option; the comment also falsely claimed it enabled
streaming
- Extract inline `render_label` conditional in `generator_messages.rb`
into a `build_render_label` private method, consistent with the existing
`build_render_example` pattern
- Replace four identical `HelloServerController` inline `it` blocks
(base `--rsc` and the three combination contexts) with a shared example
`rsc_hello_server_files`, which also adds view coverage to the
combination contexts for free
- Remove unused `let(:expected)` in the "with helpful message" spec
context
- Extract `pro_common_files` shared example (initializer + node-renderer
+ Procfile) — replaces inline duplicates in `--pro --redux`, `--pro
--typescript`, `--pro --rspack` contexts and `pro_generator_spec.rb`;
combo contexts gain Procfile coverage they previously lacked
- Extract `rsc_common_files` shared example (common files + Pro
initializer with RSC config) — replaces inline duplicates in all four
`--rsc` contexts; combo contexts gain full RSC config assertions they
previously lacked
- Remove stale TODO referencing "when --rsc tests are added" — those
tests were added in the same PR (#2284)
- Reuse `rsc_hello_server_files` in `rsc_generator_spec.rb`, leveling up
weak controller/view assertions to include layout, Stream, and
no-prerender checks

## Test Plan

- [x] CI passes (generator specs, RuboCop)
- [x] `rsc_hello_server_files` shared example runs in all four RSC
contexts + standalone RSC generator spec
- [x] `pro_common_files` shared example runs in three Pro combo contexts
+ standalone Pro generator spec
- [x] `rsc_common_files` shared example runs in all four RSC contexts

---------

Co-authored-by: Justin Gordon <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
justin808 added a commit that referenced this pull request Mar 30, 2026
- Remove no-op `prerender: true` from RSC generator template —
`stream_react_component` always performs server-side rendering and
ignores this option; the comment also falsely claimed it enabled
streaming
- Extract inline `render_label` conditional in `generator_messages.rb`
into a `build_render_label` private method, consistent with the existing
`build_render_example` pattern
- Replace four identical `HelloServerController` inline `it` blocks
(base `--rsc` and the three combination contexts) with a shared example
`rsc_hello_server_files`, which also adds view coverage to the
combination contexts for free
- Remove unused `let(:expected)` in the "with helpful message" spec
context
- Extract `pro_common_files` shared example (initializer + node-renderer
+ Procfile) — replaces inline duplicates in `--pro --redux`, `--pro
--typescript`, `--pro --rspack` contexts and `pro_generator_spec.rb`;
combo contexts gain Procfile coverage they previously lacked
- Extract `rsc_common_files` shared example (common files + Pro
initializer with RSC config) — replaces inline duplicates in all four
`--rsc` contexts; combo contexts gain full RSC config assertions they
previously lacked
- Remove stale TODO referencing "when --rsc tests are added" — those
tests were added in the same PR (#2284)
- Reuse `rsc_hello_server_files` in `rsc_generator_spec.rb`, leveling up
weak controller/view assertions to include layout, Stream, and
no-prerender checks

- [x] CI passes (generator specs, RuboCop)
- [x] `rsc_hello_server_files` shared example runs in all four RSC
contexts + standalone RSC generator spec
- [x] `pro_common_files` shared example runs in three Pro combo contexts
+ standalone Pro generator spec
- [x] `rsc_common_files` shared example runs in all four RSC contexts

---------

Co-authored-by: Justin Gordon <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
justin808 added a commit that referenced this pull request Apr 6, 2026
- Remove no-op `prerender: true` from RSC generator template —
`stream_react_component` always performs server-side rendering and
ignores this option; the comment also falsely claimed it enabled
streaming
- Extract inline `render_label` conditional in `generator_messages.rb`
into a `build_render_label` private method, consistent with the existing
`build_render_example` pattern
- Replace four identical `HelloServerController` inline `it` blocks
(base `--rsc` and the three combination contexts) with a shared example
`rsc_hello_server_files`, which also adds view coverage to the
combination contexts for free
- Remove unused `let(:expected)` in the "with helpful message" spec
context
- Extract `pro_common_files` shared example (initializer + node-renderer
+ Procfile) — replaces inline duplicates in `--pro --redux`, `--pro
--typescript`, `--pro --rspack` contexts and `pro_generator_spec.rb`;
combo contexts gain Procfile coverage they previously lacked
- Extract `rsc_common_files` shared example (common files + Pro
initializer with RSC config) — replaces inline duplicates in all four
`--rsc` contexts; combo contexts gain full RSC config assertions they
previously lacked
- Remove stale TODO referencing "when --rsc tests are added" — those
tests were added in the same PR (#2284)
- Reuse `rsc_hello_server_files` in `rsc_generator_spec.rb`, leveling up
weak controller/view assertions to include layout, Stream, and
no-prerender checks

- [x] CI passes (generator specs, RuboCop)
- [x] `rsc_hello_server_files` shared example runs in all four RSC
contexts + standalone RSC generator spec
- [x] `pro_common_files` shared example runs in three Pro combo contexts
+ standalone Pro generator spec
- [x] `rsc_common_files` shared example runs in all four RSC contexts

---------

Co-authored-by: Justin Gordon <[email protected]>
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

enhancement needs-review No final review yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --pro and --rsc flags to install generator

3 participants