Add --pro support to create-react-on-rails-app CLI#2818
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 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 |
Review SummaryThe PR is a clean, focused addition that wires A few issues worth addressing: Minor issues
Test coverage gaps (
|
Greptile SummaryThis PR adds a Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[npx create-react-on-rails-app my-app] --> B{Flags provided?}
B -->|--pro| C[proRequested = true\nproModeLabel = '--pro']
B -->|--rsc| D[proRequested = true\nproModeLabel = '--rsc']
B -->|--pro + --rsc| E[proRequested = true\nproModeLabel = '--rsc'\nrsc takes precedence]
B -->|none| F[proRequested = false]
C --> G[Step 1: rails new]
D --> G
E --> G
F --> G
G --> H[Step 2: bundle add react_on_rails]
H --> I{proRequested?}
I -->|Yes| J[Step 3: bundle add react_on_rails_pro]
I -->|No| K[Step 3: run generator]
J --> L[Step 4: run generator\nwith --pro or --rsc flag]
K --> M{options.rsc?}
L --> M
M -->|Yes| N[Visit /hello_server]
M -->|No| O[Visit /hello_world]
|
size-limit report 📦
|
d702419 to
866c494
Compare
|
Addressed review feedback in latest push:
Local verification:
|
|
Follow-up push applied: added explicit Re-verified locally:
|
|
Overall this is a clean, focused implementation that correctly threads the A few things worth noting (inline comments posted separately):
Cleanup messages when both Missing No Help text does not explain what All of these are nits or suggestions. The core logic is correct and the important paths are well-tested. |
|
Follow-up push (9af72eb) addresses the remaining thread about
Re-verified locally:
|
Review: Add --pro support to create-react-on-rails-app CLIOverall this is a clean, well-structured PR. The implementation correctly threads Confirmed: The underlying Rails generator already accepts One minor wording issue flagged inline — see comment on |
| if (options.rsc) { | ||
| logInfo('Note: --rsc installs react_on_rails_pro and requires that gem to be installable.'); | ||
| if (options.rsc && options.pro) { | ||
| logInfo('Note: --rsc takes precedence over --pro; --pro will be ignored.'); |
There was a problem hiding this comment.
The phrase "will be ignored" is slightly misleading here. --pro is not fully ignored — the react_on_rails_pro gem is still installed (because proRequested = options.pro || options.rsc in create-app.ts). What's actually superseded is only the generator mode flag (--pro → --rsc).
A user seeing this message might worry that Pro features won't be set up, when in reality --rsc already includes everything --pro provides (and more). Consider a clearer message:
| logInfo('Note: --rsc takes precedence over --pro; --pro will be ignored.'); | |
| logInfo('Note: --rsc includes all --pro functionality; the --pro flag is redundant when --rsc is set.'); |
Summary
--proCLI option tocreate-react-on-rails-appprothroughCliOptionsand generator arg buildingreact_on_rails_profor both--proand--rsc--rscprecedence when both flags are provided--progenerator args and app creation flowCloses #2437
Testing
pnpm --filter create-react-on-rails-app testpnpm --filter create-react-on-rails-app type-checkNote
Medium Risk
Moderate risk because it changes scaffolding behavior and gem installation flow for new apps, including new flag precedence rules between
--proand--rsc. Impact is limited to thecreate-react-on-rails-appCLI and is covered by expanded unit tests.Overview
Adds explicit
--promode tocreate-react-on-rails-app, wiring it through CLI parsing,CliOptions, and generator arg construction (with--rsctaking precedence when both are provided).Updates app creation to install
react_on_rails_profor both--proand--rsc, adjusts progress messaging/error cleanup guidance accordingly, and extends help text and tests to cover the new mode and precedence behavior. Also documents the new flag inCHANGELOG.md.Written by Cursor Bugbot for commit 9af72eb. This will update automatically on new commits. Configure here.