-
-
Couldn't load subscription status.
- Fork 638
📚 Comprehensive documentation improvements for enhanced developer experience #1813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds and reorganizes extensive documentation: new docs hub pages (Quick Start, Troubleshooting, API, Advanced), planning docs, AI agent setup instructions; major README and getting-started rewrites; many formatting standardizations and small guide edits; and two doc link updates in a rake task. No code or public API changes. Changes
Sequence Diagram(s)(omitted — changes are documentation-only and do not introduce control-flow or runtime behavior) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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 |
📊 PR Review: Comprehensive Documentation ImprovementsThank you for this excellent documentation improvement! The visual design, content organization, and user experience enhancements are outstanding. Here's my detailed review: ✅ StrengthsContent & Organization
Documentation Quality
🚨 Critical Issues to Fix1. Broken Internal LinksSeveral links point to non-existent paths in
2. Critical TypoLine 83 in # ❌ Current (typo)
mkdir -p app/javacript/src/SimpleCounter/components
# ✅ Should be
mkdir -p app/javascript/src/SimpleCounter/components3. Version Hardcoding
bundle add react_on_rails --strict # Gets latest stable version4. Missing Step NumberQuick Start has "Step 2" but no "Step 1" - needs consistent numbering.
|
🔍 Code Review for PR #1813: Documentation Improvements📋 SummaryThis PR delivers substantial documentation improvements with 1,226 additions across 17 files, focusing on enhanced developer experience through better organization, visual design, and user-centric navigation. ✅ Strengths
🔧 Required FixesHigh Priority
Medium Priority
🛡️ Security & Performance✅ No security concerns - documentation only 📊 CLAUDE.md Compliance
🎯 Recommendation: REQUEST CHANGESThis is an outstanding documentation improvement that will significantly enhance developer experience. However, the broken links and formatting issues need to be resolved before merging. Once fixed, this will position React on Rails as having best-in-class documentation that reduces onboarding friction. 📝 Action Items
Great work on the user experience design and content organization! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
docs/guides/auto-bundling-file-system-based-automated-bundle-generation.md (2)
121-127: Incorrect import paths in exampleBar components live under src/Bar, but the example imports from src/Foo.
Apply this diff:
import ReactOnRails from 'react-on-rails'; import FooComponentOne from '../src/Foo/FooComponentOne'; -import BarComponentOne from '../src/Foo/BarComponentOne'; -import BarComponentTwo from '../src/Foo/BarComponentTwo'; +import BarComponentOne from '../src/Bar/BarComponentOne'; +import BarComponentTwo from '../src/Bar/BarComponentTwo';
326-338: CSS Modules import style inconsistent with project configPer project config (CSS Modules namedExports: true), examples should use namespace imports.
Apply this diff in both components:
-import styles from '../HelloWorld.module.css'; +import * as styles from '../HelloWorld.module.css';-import styles from '../HeavyMarkdownEditor.module.css'; +import * as styles from '../HeavyMarkdownEditor.module.css';Also applies to: 342-345
docs/javascript/render-functions.md (1)
192-197: Inconsistent requirement wording for react_component_hashEarlier sections specify the server-side hash is under renderedHtml.componentHtml, but this block says the object must include componentHtml at the top level. Align the requirement text.
Apply this diff:
-#### Requirements - -- The render function MUST return an object -- The object MUST include a `componentHtml` key -- All other keys are optional and can be accessed in your Rails view +#### Requirements + +- The render function MUST return an object +- The object MUST include a `renderedHtml` key containing a `componentHtml` key +- All other keys are optional and can be accessed in your Rails viewdocs/getting-started.md (1)
197-204: Code example bug: JSX uses, which is an undefined component.
Should be lowercase
<h1>.- // This is a React FunctionComponent because it is wrapped in a function. - return () => <H1>{JSON.stringify(props)}</H1>; + // This is a React FunctionComponent because it is wrapped in a function. + return () => <h1>{JSON.stringify(props)}</h1>;
🧹 Nitpick comments (18)
docs/guides/tutorial.md (1)
173-173: Prefer canonical names: SQLite and PostgreSQLImprove capitalization/accuracy of DB names.
Apply this diff:
-## Swap out sqlite for postgres +## Swap out SQLite for PostgreSQLAI_AGENT_INSTRUCTIONS.md (2)
8-11: Usegem infoor rely on Bundler instead ofgem search
gem searchdoesn’t reliably show the latest version in a usable way. Prefergem infoor just letbundle add --strictpin the latest automatically.Apply this diff:
-# Get latest available versions (recommended approach) -gem search react_on_rails --remote +# Optionally check the latest version +gem info react_on_rails --remote | sed -n '1p'
61-64: Clarifybin/dev killusage in docsThe
killsubcommand exists in the generated bin/dev template (lib/generators/react_on_rails/templates/base/base/bin/dev) and is implemented by lib/react_on_rails/dev/server_manager.rb (run_from_command_line → kill_processes), but there is no top-level bin/dev in the repo root — update AI_AGENT_INSTRUCTIONS.md (lines 61–64) to state that bin/dev is generated (run the installer/generator) or replace the reference with the equivalent overmind/foreman commands.DOCUMENTATION_IMPROVEMENT_PLAN.md (1)
1-168: Add ownership and timelines to drive executionSuggest adding DRI/owner per task and target dates per phase to ensure accountability and scheduling. Link each task to a GitHub issue.
DOCS_PR_SUMMARY.md (1)
31-35: Confirm referenced files exist and ensure trailing newline
- Please verify that DOCUMENTATION_IMPROVEMENT_PLAN.md was added and is linked correctly.
- Ensure this Markdown file ends with a trailing newline (repo guideline).
Also applies to: 146-149
README.md (1)
141-148: Align prerequisites across docsREADME lists Ruby >= 3.2 and Node >= 20, while Quick Start mentions Ruby 3.0+ and Node 18+. Recommend standardizing to a single set (prefer the stricter values here).
docs/guides/auto-bundling-file-system-based-automated-bundle-generation.md (1)
469-482: Bundle size numbers are inconsistent; consider making them illustrative“1.1MB total resources (50KB component-specific code …)” vs the listed 10.0 kB; also “2.2MB total (2.7MB with markdown libs)” conflicts with line-by-line totals. Suggest softening to approximate values or correcting the math.
docs/quick-start/README.md (3)
58-61: Add language to fenced code block (markdownlint MD040)Annotate this code fence with a language, e.g., text.
Apply this diff:
-``` +```text http://localhost:3000/hello_world--- `11-14`: **Standardize prerequisites with root README** Recommend aligning to Ruby >= 3.2, Node.js >= 20, and allow any JS package manager (npm/yarn/pnpm/bun) to match the main README. Apply this diff: ```diff -- **Rails 7+** application -- **Ruby 3.0+** -- **Node.js 18+** and **Yarn** +- **Rails 7+** application +- **Ruby 3.2+** +- **Node.js 20+** +- **JavaScript package manager** (npm, yarn, pnpm, or bun)
35-40: Outdated generator output pathsThe generator creates files under app/javascript (not client/). Please update bullets accordingly.
Apply this diff:
-- React component files in `client/` -- A sample controller and view -- Webpack configuration +- React component files in `app/javascript/src/` +- A sample controller and view +- Shakapacker configurationdocs/troubleshooting/README.md (1)
291-299: Use invite link for SlackDirect workspace links may fail for users not yet invited. Prefer the invite URL used elsewhere.
Apply this diff:
-- **[React + Rails Slack](https://reactrails.slack.com)** - Real-time community support +- **[React + Rails Slack](https://invite.reactrails.com)** - Real-time community supportdocs/getting-started.md (7)
17-17: Grammar: add article “a”.-### 📚 **Want comprehensive tutorial?** +### 📚 **Want a comprehensive tutorial?**
83-86: Link text doesn’t match target; simplify phrasing.-- Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See file [docs/basics/configuration.md](./guides/configuration.md) for documentation of all configuration options. +- Configure `config/initializers/react_on_rails.rb`. You can adjust necessary settings and defaults. See [Configuration](./guides/configuration.md) for documentation of all options.
74-77: Clarify command or remove trailing “#”.
bin/dev static #looks like an unfinished comment.-bin/dev static # +bin/dev static # start without HMR
101-101: Typo: remove “@” from component_name.-`@component_name` is a string and corresponds to the name you used to globally expose your React component. +`component_name` is a string and corresponds to the name you used to globally expose your React component.
112-117: Prefer Shakapacker 7 terminology: “entrypoints” over “packs”.If targeting Shakapacker 7+, use entrypoints for examples.
-// packs/hello-world-bundle.js +// entrypoints/hello-world-bundle.jsConfirm the project-wide guidance (packs vs entrypoints) to keep examples consistent with Shakapacker 7.
119-121: Keep ERB examples consistent (use props: keyword style).Earlier examples use
props: @some_props.-<%= react_component("HelloWorld", @hello_world_props) %> +<%= react_component("HelloWorld", props: @hello_world_props) %>
103-107: Capitalize Webpack.Minor terminology consistency.
-automatically creates the webpack bundle +automatically creates the Webpack bundle
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
AI_AGENT_INSTRUCTIONS.md(1 hunks)DOCS_PR_SUMMARY.md(1 hunks)DOCUMENTATION_IMPROVEMENT_PLAN.md(1 hunks)README.md(3 hunks)docs/README.md(1 hunks)docs/contributor-info/pull-requests.md(1 hunks)docs/getting-started.md(7 hunks)docs/guides/auto-bundling-file-system-based-automated-bundle-generation.md(1 hunks)docs/guides/how-to-use-different-files-for-client-and-server-rendering.md(3 hunks)docs/guides/tutorial.md(2 hunks)docs/guides/upgrading-react-on-rails.md(1 hunks)docs/javascript/render-functions.md(2 hunks)docs/outdated/rails-assets-relative-paths.md(1 hunks)docs/quick-start/README.md(1 hunks)docs/troubleshooting/README.md(1 hunks)lib/tasks/generate_packs.rake(2 hunks)spec/dummy/client/README.md(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru,js,jsx,ts,tsx,json,yml,yaml,md,css,scss}}
📄 CodeRabbit inference engine (CLAUDE.md)
Ensure all committed files end with a trailing newline character
Files:
docs/javascript/render-functions.mddocs/guides/how-to-use-different-files-for-client-and-server-rendering.mdDOCUMENTATION_IMPROVEMENT_PLAN.mdlib/tasks/generate_packs.rakespec/dummy/client/README.mddocs/contributor-info/pull-requests.mddocs/guides/auto-bundling-file-system-based-automated-bundle-generation.mddocs/troubleshooting/README.mddocs/quick-start/README.mddocs/guides/upgrading-react-on-rails.mdAI_AGENT_INSTRUCTIONS.mddocs/getting-started.mdREADME.mddocs/outdated/rails-assets-relative-paths.mddocs/guides/tutorial.mddocs/README.mdDOCS_PR_SUMMARY.md
**/*.{js,jsx,ts,tsx,json,yml,yaml,md,css,scss}
📄 CodeRabbit inference engine (CLAUDE.md)
Let Prettier handle all non-Ruby file formatting; never manually format these files
Files:
docs/javascript/render-functions.mddocs/guides/how-to-use-different-files-for-client-and-server-rendering.mdDOCUMENTATION_IMPROVEMENT_PLAN.mdspec/dummy/client/README.mddocs/contributor-info/pull-requests.mddocs/guides/auto-bundling-file-system-based-automated-bundle-generation.mddocs/troubleshooting/README.mddocs/quick-start/README.mddocs/guides/upgrading-react-on-rails.mdAI_AGENT_INSTRUCTIONS.mddocs/getting-started.mdREADME.mddocs/outdated/rails-assets-relative-paths.mddocs/guides/tutorial.mddocs/README.mdDOCS_PR_SUMMARY.md
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru}}
📄 CodeRabbit inference engine (CLAUDE.md)
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru}}: Before every commit/push, runbundle exec rubocopand fix all violations in Ruby code
Let RuboCop handle all Ruby code formatting; never manually format Ruby files
Files:
lib/tasks/generate_packs.rake
🧠 Learnings (6)
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Applied to files:
lib/tasks/generate_packs.rakedocs/guides/auto-bundling-file-system-based-automated-bundle-generation.mddocs/guides/upgrading-react-on-rails.mddocs/getting-started.mdREADME.md
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Applied to files:
lib/tasks/generate_packs.rakedocs/guides/auto-bundling-file-system-based-automated-bundle-generation.mddocs/guides/upgrading-react-on-rails.mddocs/getting-started.md
📚 Learning: 2025-01-23T18:20:45.824Z
Learnt from: alexeyr-ci
PR: shakacode/react_on_rails#1687
File: spec/dummy/package.json:0-0
Timestamp: 2025-01-23T18:20:45.824Z
Learning: When adding or updating dependencies in spec/dummy/package.json, maintain version consistency with other package.json files in the codebase to avoid potential version conflicts.
Applied to files:
spec/dummy/client/README.md
📚 Learning: 2025-09-22T07:21:12.910Z
Learnt from: CR
PR: shakacode/react_on_rails#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-22T07:21:12.910Z
Learning: Use Yarn only; never run npm commands
Applied to files:
spec/dummy/client/README.md
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
PR: shakacode/react_on_rails#1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.
Applied to files:
docs/guides/auto-bundling-file-system-based-automated-bundle-generation.mddocs/guides/upgrading-react-on-rails.mddocs/getting-started.mdREADME.md
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.
Applied to files:
docs/getting-started.mdREADME.md
🪛 markdownlint-cli2 (0.18.1)
docs/troubleshooting/README.md
11-11: Link fragments should be valid
(MD051, link-fragments)
12-12: Link fragments should be valid
(MD051, link-fragments)
13-13: Link fragments should be valid
(MD051, link-fragments)
14-14: Link fragments should be valid
(MD051, link-fragments)
15-15: Link fragments should be valid
(MD051, link-fragments)
47-47: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
126-126: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
docs/quick-start/README.md
58-58: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
docs/getting-started.md
67-67: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
140-140: Reference links and images should use a label that is defined
Missing link or image reference definition: "./guides/auto-bundling-file-system-based-automated-bundle-generation.md"
(MD052, reference-links-images)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: dummy-app-integration-tests (3.4, 22)
- GitHub Check: dummy-app-integration-tests (3.2, 20)
- GitHub Check: markdown-link-check
- GitHub Check: build
- GitHub Check: rspec-package-tests (3.4, minimum)
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: claude-review
🔇 Additional comments (9)
docs/outdated/rails-assets-relative-paths.md (1)
126-126: Consistent heading punctuation — looks goodColon removal matches the new docs style across the repo. No content impact.
docs/guides/upgrading-react-on-rails.md (1)
277-277: Consistent heading punctuation — approvedColon removed for consistency. No behavioral/content changes.
docs/contributor-info/pull-requests.md (1)
38-38: Consistent heading punctuation — approvedColon removal aligns with style cleanup.
docs/guides/how-to-use-different-files-for-client-and-server-rendering.md (1)
31-31: Heading punctuation cleanup — approvedAll four heading tweaks are consistent with the repo-wide style changes.
Also applies to: 58-58, 60-61, 83-84
spec/dummy/client/README.md (1)
30-30: Minor copy edit — approvedColon removal reads fine and matches the broader docs polish.
README.md (1)
98-105: Quick Start links: looks good; verify external URLsThe “Quick Start / Docs / Live Demo” links read well. Please double-check the hosted URLs resolve (site deploys sometimes lag behind doc changes).
lib/tasks/generate_packs.rake (1)
86-86: Updated docs links — file exists; confirm website path resolvesFound at docs/guides/auto-bundling-file-system-based-automated-bundle-generation.md. Verify the website path resolves.
docs/troubleshooting/README.md (1)
9-15: Anchors validated — table links resolve correctlyHeadings slugify to #installation-issues, #build-issues, #runtime-issues, #server-side-rendering-issues, and #performance-issues; these match the table links in docs/troubleshooting/README.md.
docs/getting-started.md (1)
30-36: Verify link path for Shakapacker v6 “special setup”.Path
./additional-details/tips-for-usage-with-sp6.mdmay differ (e.g., naming “sp6” vs “sp-v6”). Please confirm.
| # Create new Rails app | ||
| rails new myapp --skip-javascript --database=postgresql | ||
| cd myapp | ||
|
|
||
| # Use latest version | ||
| bundle add react_on_rails --version 16.0.1 --strict | ||
|
|
||
| bin/rails generate react_on_rails:install | ||
|
|
||
| # Accept change to bin/dev | ||
|
|
||
| # Start development servers | ||
| bin/dev | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Shakapacker and avoid hardcoding a specific RoR version
v16 requires Shakapacker. Also, hardcoding 16.0.1 will go stale; --strict will pin the latest for you.
Apply this diff to Scenario 1:
-# Create new Rails app
-rails new myapp --skip-javascript --database=postgresql
-cd myapp
-
-# Use latest version
-bundle add react_on_rails --version 16.0.1 --strict
-
-bin/rails generate react_on_rails:install
+# Create new Rails app
+rails new myapp --skip-javascript --database=postgresql
+cd myapp
+
+# Add required gems (pins exact latest versions)
+bundle add shakapacker --strict
+bundle add react_on_rails --strict
+
+# Install shakapacker first, then React on Rails
+bin/rails shakapacker:install
+bin/rails react_on_rails:install📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Create new Rails app | |
| rails new myapp --skip-javascript --database=postgresql | |
| cd myapp | |
| # Use latest version | |
| bundle add react_on_rails --version 16.0.1 --strict | |
| bin/rails generate react_on_rails:install | |
| # Accept change to bin/dev | |
| # Start development servers | |
| bin/dev | |
| ``` | |
| # Create new Rails app | |
| rails new myapp --skip-javascript --database=postgresql | |
| cd myapp | |
| # Add required gems (pins exact latest versions) | |
| bundle add shakapacker --strict | |
| bundle add react_on_rails --strict | |
| # Install shakapacker first, then React on Rails | |
| bin/rails shakapacker:install | |
| bin/rails react_on_rails:install | |
| # Accept change to bin/dev | |
| # Start development servers | |
| bin/dev |
🤖 Prompt for AI Agents
AI_AGENT_INSTRUCTIONS.md lines 19-32: The instructions currently hardcode
react_on_rails v16.0.1 and omit Shakapacker; update Scenario 1 to add the
shakapacker gem (and run its installer) because react_on_rails v16 requires
Shakapacker, and stop pinning an exact react_on_rails version—use bundle add
react_on_rails with --strict (or no explicit version) so the latest compatible
release is selected; keep the existing steps to run the react_on_rails
installer, accept the bin/dev change, and start bin/dev.
| cd /path/to/existing/app | ||
| # Use latest version | ||
| bundle add react_on_rails --version 16.0.1 --strict | ||
|
|
||
| bin/rails generate react_on_rails:install | ||
|
|
||
| # Accept change to bin/dev | ||
|
|
||
| # Start development servers | ||
| bin/dev | ||
| # Navigate to existing Rails app root | ||
|
|
||
| # Start development | ||
| bin/dev | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure Shakapacker is installed for existing apps and remove duplication
Add Shakapacker install steps and remove the duplicate/bin/dev ordering issue.
Apply this diff to Scenario 2:
-cd /path/to/existing/app
-# Use latest version
-bundle add react_on_rails --version 16.0.1 --strict
-
-bin/rails generate react_on_rails:install
-
-# Accept change to bin/dev
-
-# Start development servers
-bin/dev
-# Navigate to existing Rails app root
-
-# Start development
-bin/dev
+cd /path/to/existing/app
+# Add required gems (pins exact latest versions)
+bundle add shakapacker --strict
+bundle add react_on_rails --strict
+
+# Install shakapacker first, then React on Rails
+bin/rails shakapacker:install
+bin/rails react_on_rails:install
+
+# Accept change to bin/dev
+
+# Start development servers
+bin/dev📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| cd /path/to/existing/app | |
| # Use latest version | |
| bundle add react_on_rails --version 16.0.1 --strict | |
| bin/rails generate react_on_rails:install | |
| # Accept change to bin/dev | |
| # Start development servers | |
| bin/dev | |
| # Navigate to existing Rails app root | |
| # Start development | |
| bin/dev | |
| ``` | |
| cd /path/to/existing/app | |
| # Add required gems (pins exact latest versions) | |
| bundle add shakapacker --strict | |
| bundle add react_on_rails --strict | |
| # Install shakapacker first, then React on Rails | |
| bin/rails shakapacker:install | |
| bin/rails react_on_rails:install | |
| # Accept change to bin/dev | |
| # Start development servers | |
| bin/dev |
🤖 Prompt for AI Agents
In AI_AGENT_INSTRUCTIONS.md around lines 41 to 55, the script for Scenario 2 is
missing Shakapacker installation and contains a duplicated/incorrect ordering of
bin/dev; update Scenario 2 to include Shakapacker install steps for existing
Rails apps (add installation and any required setup commands before running
generators), remove the duplicate bin/dev lines so bin/dev is only invoked once
at the end, and ensure the react_on_rails generator and bin/dev invocation occur
after Shakapacker is installed and configured.
Code Review for PR #1813: Documentation ImprovementsExcellent documentation improvements! This PR significantly enhances the React on Rails developer experience. Strengths
Critical Issues
Suggestions
Security & Testing
Overall AssessmentHigh-quality PR that makes React on Rails much more accessible. Once the installation order documentation is restored, this will be an excellent addition. Recommendation: Approve with minor changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
docs/getting-started.md (3)
80-81: Link text/file path mismatch.The visible label references “docs/basics/configuration.md” while the link points to guides. Simplify the text for clarity.
-- Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See file [docs/basics/configuration.md](./guides/configuration.md) for documentation of all configuration options. +- Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See the [Configuration guide](./guides/configuration.md) for all configuration options.
179-181: Fix awkward phrasing (“which we using the name ...”).Improve readability and correctness.
-You have two ways to specify your React components. You can either register the React component (either function or class component) directly, or you can create a function that returns a React component, which we using the name of a "render-function". Creating a render-function allows you to: +You have two ways to specify your React components. You can either register the React component (function or class) directly, or create a function that returns a React component, which we refer to as a "render-function." Creating a render-function allows you to:
195-201: Fix JSX example: HTML tag should be lowercase (h1), notH1.As written,
H1implies a React component that isn’t defined/imported.- // This is a React FunctionComponent because it is wrapped in a function. - return () => <H1>{JSON.stringify(props)}</H1>; + // This is a React FunctionComponent because it is wrapped in a function. + return () => <h1>{JSON.stringify(props)}</h1>;
🧹 Nitpick comments (4)
docs/guides/tutorial.md (1)
173-173: Use correct product names: “SQLite” and “PostgreSQL”Recommend: “## Swap out SQLite for PostgreSQL”. If you apply this, also update the TOC link target accordingly.
docs/getting-started.md (3)
70-74: Incomplete inline comment in code block.Trailing “#” without explanation is confusing. Either remove it or add a brief description.
```bash bin/dev help bin/dev # start with hmr -bin/dev static # +bin/dev static # serve precompiled assets (no HMR)--- `51-53`: **Avoid overly specific version pin that will stale quickly.** Recommend a pessimistic constraint to allow patch updates within 16.x while keeping docs aligned with “use the latest”. ```diff - bundle add react_on_rails --version=16.0.0 --strict + bundle add react_on_rails --version "~> 16.0" --strict
116-119: Use consistentprops:syntax forreact_componentexample.Elsewhere you use
props: @some_props. Keep examples consistent.-<%= react_component("HelloWorld", @hello_world_props) %> +<%= react_component("HelloWorld", props: @hello_world_props) %>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
AI_AGENT_INSTRUCTIONS.md(1 hunks)docs/README.md(1 hunks)docs/api/README.md(1 hunks)docs/getting-started.md(7 hunks)docs/guides/advanced/README.md(1 hunks)docs/guides/tutorial.md(2 hunks)docs/quick-start/README.md(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- docs/api/README.md
- docs/guides/advanced/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
- AI_AGENT_INSTRUCTIONS.md
- docs/README.md
- docs/quick-start/README.md
🧰 Additional context used
📓 Path-based instructions (2)
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru,js,jsx,ts,tsx,json,yml,yaml,md,css,scss}}
📄 CodeRabbit inference engine (CLAUDE.md)
Ensure all committed files end with a trailing newline character
Files:
docs/getting-started.mddocs/guides/tutorial.md
**/*.{js,jsx,ts,tsx,json,yml,yaml,md,css,scss}
📄 CodeRabbit inference engine (CLAUDE.md)
Let Prettier handle all non-Ruby file formatting; never manually format these files
Files:
docs/getting-started.mddocs/guides/tutorial.md
🧠 Learnings (4)
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
PR: shakacode/react_on_rails#1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.
Applied to files:
docs/getting-started.md
🪛 markdownlint-cli2 (0.18.1)
docs/getting-started.md
58-58: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: build-dummy-app-webpack-test-bundles (3.4, 22)
- GitHub Check: rspec-package-tests (3.4, minimum)
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: markdown-link-check
- GitHub Check: build
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: claude-review
🔇 Additional comments (4)
docs/guides/tutorial.md (1)
25-25: Resolved: pluralization fix looks goodHeader corrected to “Table of Contents.”
docs/getting-started.md (3)
62-66: Thanks for fixing the malformed fenced code block.The backticks/language spec are now correct, resolving the earlier MD040 issue.
137-140: Thanks for converting the reference-style link to an inline link.This addresses the previous MD052 warning.
28-36: Fix broken intra-doc link in docs/getting-started.mdMissing image link: ../images/bundle-splitting-hello-world.png -> images/bundle-splitting-hello-world.png (file not found). Add the image to repo or update the link to the correct path.
⛔ Skipped due to learnings
Learnt from: justin808 PR: shakacode/react_on_rails#1770 File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2 Timestamp: 2025-09-16T08:01:11.146Z Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.
| ### 📚 **Want comprehensive tutorial?** | ||
|
|
||
| **→ [Complete Tutorial](./guides/tutorial.md)** - Step-by-step with Redux and routing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar: add missing article (“a”).
Update the heading to read naturally.
-### 📚 **Want comprehensive tutorial?**
+### 📚 **Want a comprehensive tutorial?**📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### 📚 **Want comprehensive tutorial?** | |
| **→ [Complete Tutorial](./guides/tutorial.md)** - Step-by-step with Redux and routing | |
| ### 📚 **Want a comprehensive tutorial?** | |
| **→ [Complete Tutorial](./guides/tutorial.md)** - Step-by-step with Redux and routing |
🤖 Prompt for AI Agents
In docs/getting-started.md around lines 17 to 19, the heading "Want
comprehensive tutorial?" is missing the article "a"; update the heading to read
"Want a comprehensive tutorial?" and ensure the link and following text remain
unchanged.
| `@component_name` is a string and corresponds to the name you used to globally expose your React component. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify component name (remove Ruby instance variable sigil).
Using “@component_name” here is misleading; it’s not a Ruby instance variable.
-`@component_name` is a string and corresponds to the name you used to globally expose your React component.
+The component name is a string and corresponds to the name you used to globally expose your React component.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| `@component_name` is a string and corresponds to the name you used to globally expose your React component. | |
| The component name is a string and corresponds to the name you used to globally expose your React component. |
🤖 Prompt for AI Agents
In docs/getting-started.md around lines 98 to 99, the text uses
“@component_name” which wrongly implies a Ruby instance-variable sigil; update
the wording to use a plain identifier (for example component_name or
your-component-name) and clarify that it should match the global name you
exposed for your React component (no @). Replace any occurrences of
“@component_name” with the chosen plain identifier and adjust surrounding
sentence to read that it is a string corresponding to the global name used to
expose the component.
📝 Code Review: Documentation Improvements PRThank you for this comprehensive documentation improvement effort! The modernization and user experience focus are excellent. However, I've identified several critical issues that need to be addressed before merging. 🔴 Critical Issues to Fix1. Broken Links (Blocking)Several links point to non-existent files:
2. File Reference InconsistenciesThe auto-bundling guide rename creates broken references in README.md's feature table. 🟡 Moderate Issues3. AI Agent Instructions
4. Documentation StructureSome promised guides in ✅ Notable StrengthsExcellent Improvements:
Technical Accuracy:
📋 Specific RecommendationsMust Fix Before Merge:
Should Fix:
Nice to Have:
🎯 Compliance Check✅ Follows project conventions per CLAUDE.md 🚀 VerdictConditional Approval: This is a valuable documentation improvement that will significantly help new users. However, the broken links must be fixed before merging as they will frustrate users trying to navigate the docs. Once the critical issues are resolved, this will be an excellent addition to React on Rails! Review focuses on documentation quality, technical accuracy, and user experience. |
🔍 Pull Request Review: Documentation ImprovementsThank you for this comprehensive documentation update! The improvements are substantial and well-structured. Here is my detailed review: ✅ Strengths📚 Excellent Documentation Organization
🎯 User Experience Improvements
💡 Technical Accuracy
🔧 Code Quality Issues1. Missing Trailing NewlinesPer the CLAUDE.md requirements, ALL files must end with a newline character. Please ensure all new and modified files have trailing newlines. CI will fail without this. 2. Code Improvements in lib/tasks/generate_packs.rakeThe rake task improvements are good, but consider:
📝 Suggestions for EnhancementDocumentation Suggestions
Content Consistency
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
docs/README.md(1 hunks)docs/additional-details/recommended-project-structure.md(1 hunks)docs/getting-started.md(7 hunks)docs/guides/rails-webpacker-react-integration-options.md(1 hunks)docs/javascript/capistrano-deployment.md(1 hunks)docs/planning/DOCS_PR_SUMMARY.md(1 hunks)docs/planning/DOCUMENTATION_IMPROVEMENT_PLAN.md(1 hunks)docs/quick-start/README.md(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- docs/additional-details/recommended-project-structure.md
- docs/planning/DOCUMENTATION_IMPROVEMENT_PLAN.md
- docs/javascript/capistrano-deployment.md
🚧 Files skipped from review as they are similar to previous changes (2)
- docs/quick-start/README.md
- docs/README.md
🧰 Additional context used
📓 Path-based instructions (2)
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru,js,jsx,ts,tsx,json,yml,yaml,md,css,scss}}
📄 CodeRabbit inference engine (CLAUDE.md)
Ensure all committed files end with a trailing newline character
Files:
docs/guides/rails-webpacker-react-integration-options.mddocs/getting-started.mddocs/planning/DOCS_PR_SUMMARY.md
**/*.{js,jsx,ts,tsx,json,yml,yaml,md,css,scss}
📄 CodeRabbit inference engine (CLAUDE.md)
Let Prettier handle all non-Ruby file formatting; never manually format these files
Files:
docs/guides/rails-webpacker-react-integration-options.mddocs/getting-started.mddocs/planning/DOCS_PR_SUMMARY.md
🧠 Learnings (4)
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
PR: shakacode/react_on_rails#1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.
Applied to files:
docs/guides/rails-webpacker-react-integration-options.mddocs/getting-started.md
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Applied to files:
docs/guides/rails-webpacker-react-integration-options.mddocs/getting-started.md
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.
Applied to files:
docs/getting-started.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: dummy-app-integration-tests (3.2, 20)
- GitHub Check: dummy-app-integration-tests (3.4, 22)
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: rspec-package-tests (3.4, minimum)
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: claude-review
- GitHub Check: build
- GitHub Check: markdown-link-check
🔇 Additional comments (8)
docs/guides/rails-webpacker-react-integration-options.md (1)
145-147: Minor improvement: Fix code fence language consistency.Changing from
shtobashaligns with other command blocks in the repository's documentation and provides better syntax highlighting consistency. Good attention to detail in standardizing the documentation format.docs/planning/DOCS_PR_SUMMARY.md (1)
1-149: Well-structured documentation improvement plan with clear objectives and success metrics.This planning document effectively captures the comprehensive nature of the documentation overhaul with:
- Clear before/after analysis highlighting specific pain points and solutions
- Concrete deliverables and visual improvements that address user experience issues
- Measurable success criteria and business impact assessment
- Proper phased implementation approach
The emphasis on user-centric paths (beginner → experienced → migrating users) and self-service troubleshooting aligns well with reducing support burden while improving developer onboarding experience.
docs/getting-started.md (6)
17-19: Fix grammatical error in heading.The heading is missing the article "a" and should read naturally.
-### 📚 **Want comprehensive tutorial?** +### 📚 **Want a comprehensive tutorial?**
99-99: Remove misleading Ruby instance variable syntax.Using
@component_nameincorrectly implies a Ruby instance variable when it should refer to a plain string parameter.-`@component_name` is a string and corresponds to the name you used to globally expose your React component. +The component name is a string and corresponds to the name you used to globally expose your React component.
138-140: Fix reference-style link syntax.The link uses incorrect reference-style bracket syntax instead of inline link parentheses.
-See [Auto-Bundling: File-System-Based Automated Bundle Generation][./guides/auto-bundling-file-system-based-automated-bundle-generation.md] +See [Auto-Bundling: File-System-Based Automated Bundle Generation](./guides/auto-bundling-file-system-based-automated-bundle-generation.md)
168-168: Fix likely broken image path.The image path uses
../images/which likely results in a 404 error from the current file location indocs/getting-started.md.- +
101-141: Excellent addition: Auto-Bundling documentation with clear comparison.The new Auto-Bundling section provides excellent value by:
- Clearly contrasting manual registration vs auto-bundling approaches
- Providing concrete code examples for both patterns
- Explaining the benefits of
auto_load_bundle: true- Cross-referencing detailed documentation
This addresses a key pain point mentioned in the PR objectives by giving developers a clear path to modern React on Rails patterns while maintaining backward compatibility understanding.
234-253: Well-organized progressive learning path structure.The new "More Reading" and "Additional Resources" sections create a clear learning progression that addresses different user types mentioned in the PR objectives:
- API reference for experienced developers seeking specific information
- Tutorial for comprehensive learning
- Configuration details for advanced users
- Migration guide for existing users
This structure aligns perfectly with the documented goal of providing "multiple entry points based on user type" and reduces the information overload issue identified in the planning documents.
- Update 20+ broken links in docs/README.md to point to existing files - Fix 5 broken links in docs/quick-start/README.md - Fix image path in docs/getting-started.md (../images -> ./images) - Update Storybook URL to current domain (getstorybook.io -> storybook.js.org) - Reconcile version requirements across docs to match gemspec: - Shakapacker 6+ (7+ recommended) instead of "7+ required" - Ruby 3.0+ (required) instead of "Ruby 2.7+ supported" - Rails 5.2+ supported for consistency 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
📋 Code Review for Documentation Improvements PRThank you for this comprehensive documentation update! The improvements significantly enhance the developer experience. Here's my detailed review: ✅ Strengths🎯 Excellent User Journey Optimization
📚 Content Quality
🔧 Technical Accuracy
🚨 Critical Issues to Address1. Missing Newlines at End of FilesPer CLAUDE.md requirements, ALL files must end with a newline character. The following new files are missing trailing newlines:
Fix: Add a newline at the end of each file. 2. Inconsistent Code Block Language SpecifiersSeveral places use "
|
- Update internal anchor links to include emoji prefixes for proper GitHub anchor generation - Fixes 5 dead anchor links: #installation-issues, #build-issues, #runtime-issues, #server-side-rendering-issues, #performance-issues 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/getting-started.md (2)
146-158: Fix JSX: use native h1 tag instead of undefined H1 component.Avoid confusing readers with an undeclared component.
Apply this diff:
- return () => ( - <div> - Your locale is {railsContext.i18nLocale}.<br /> - Hello, {props.name}! - </div> - ); + return () => ( + <div> + Your locale is {railsContext.i18nLocale}.<br /> + <h1>Hello, {props.name}!</h1> + </div> + );
1-254: Fix docs: remove stray@component_name, correct uppercase JSX tag, and add an automated CI check
- docs/getting-started.md:99 — replace the misleading
@component_nametext with a string example (e.g.'component_name'or"HelloWorld") so it’s clear the helper expects a string, not an instance variable.- docs/getting-started.md:199 — change
return () => <H1>{JSON.stringify(props)}</H1>;to use a lowercase HTML tag (<h1>…</h1>) or a real component name if intended.- Add a CI lint step (ripgrep) to fail on lingering placeholders / bad JSX in docs, e.g.:
rg -n -F -e '@component_name' -e '' -e '
' --type=md && exit 1
🧹 Nitpick comments (10)
docs/javascript/angular-js-integration-migration.md (1)
21-21: Fix heading casing: “Storybook” (not “StoryBook”).Align the section heading with the corrected link text/brand.
Apply this diff:
-## StoryBook +## Storybookdocs/troubleshooting/README.md (3)
47-47: Use a proper heading instead of emphasis (MD036).Convert emphasized “Error …” line to a subheading for consistency.
Apply this diff:
-**Error in browser console or webpack output** +#### Error in browser console or webpack output
126-126: Use a proper heading instead of emphasis (MD036).Same issue as above in the SSR section.
Apply this diff:
-**Error during server-side rendering** +#### Error during server-side rendering
226-231: Fix bundle analysis command (manifest.json is not a valid input).webpack-bundle-analyzer expects a stats file or plugin output. Use the ANALYZE flow or point to a stats file.
Apply this diff:
-3. **Check for large dependencies:** - ```bash - yarn why package-name - webpack-bundle-analyzer public/packs/manifest.json - ``` +3. **Check for large dependencies:** + ```bash + yarn why package-name + # If your project is configured to emit stats, analyze them: + npx webpack-bundle-analyzer tmp/webpack-stats.json + # Or use the built-in analyze mode: + ANALYZE=true bin/webpack + ```docs/quick-start/README.md (2)
37-42: Align generator output list with new paths/conventions.“client/” is legacy; the guide uses app/javascript/src and ror_components. Update bullets for consistency.
Apply this diff:
-- jsx files created -- Shakapacker install -- React component files in `client/` -- A sample controller and view -- Webpack configuration +- JSX/TSX files created +- Shakapacker install +- React component files in `app/javascript/src/.../ror_components/` +- A sample controller and view +- Webpack configuration
204-209: Update “Key File Locations” to match auto-bundling conventions.Use ror_components and clarify entrypoints/registration.
Apply this diff:
-### Key File Locations - -- **Components**: `client/app/bundles/[ComponentName]/components/` -- **Registration**: `client/app/bundles/[ComponentName]/startup/registration.js` -- **Packs**: `app/javascript/packs/` -- **Config**: `config/initializers/react_on_rails.rb` -- **Webpack**: `config/shakapacker.yml` +### Key File Locations + +- **Components (auto-bundling)**: `app/javascript/src/[Feature]/ror_components/` +- **Registration (manual only)**: your entrypoints (e.g., `app/javascript/packs/hello-world-bundle.js`) +- **Entrypoints (packs)**: `app/javascript/packs/` (or `app/packs/` depending on `shakapacker.yml`) +- **Config (React on Rails)**: `config/initializers/react_on_rails.rb` +- **Config (Shakapacker)**: `config/shakapacker.yml`docs/getting-started.md (4)
69-75: Simplify dev commands; clarify comments.The three lines are confusing. Keep the primary command and optional notes.
Apply this diff:
-```bash -bin/dev help -bin/dev # start with hmr -bin/dev static # -``` +```bash +./bin/dev # Starts Rails + webpack-dev-server with HMR (per Procfile.dev) +```
81-82: Fix link text to match target path.Avoid mismatched text (“docs/basics/…”) linking to guides/.
Apply this diff:
-- Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See file [docs/basics/configuration.md](./guides/configuration.md) for documentation of all configuration options. +- Configure `config/initializers/react_on_rails.rb`. You can adjust some necessary settings and defaults. See [Configuration](./guides/configuration.md) for documentation of all configuration options.
110-115: Correct example path for entrypoint file.Use a realistic Shakapacker path for packs/entrypoints.
Apply this diff:
-// packs/hello-world-bundle.js +// app/javascript/packs/hello-world-bundle.js
180-185: Fix wording: “which we call a ‘render-function’.”Minor clarity/grammar improvement.
Apply this diff:
-You can either register the React component (either function or class component) directly, or you can create a function that returns a React component, which we using the name of a "render-function". Creating a render-function allows you to: +You can either register the React component (function or class) directly, or create a function that returns a React component, which we call a "render-function". Creating a render-function allows you to:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
docs/README.md(1 hunks)docs/getting-started.md(7 hunks)docs/javascript/angular-js-integration-migration.md(1 hunks)docs/quick-start/README.md(1 hunks)docs/troubleshooting/README.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/README.md
🧰 Additional context used
📓 Path-based instructions (2)
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru,js,jsx,ts,tsx,json,yml,yaml,md,css,scss}}
📄 CodeRabbit inference engine (CLAUDE.md)
Ensure all committed files end with a trailing newline character
Files:
docs/javascript/angular-js-integration-migration.mddocs/getting-started.mddocs/quick-start/README.mddocs/troubleshooting/README.md
**/*.{js,jsx,ts,tsx,json,yml,yaml,md,css,scss}
📄 CodeRabbit inference engine (CLAUDE.md)
Let Prettier handle all non-Ruby file formatting; never manually format these files
Files:
docs/javascript/angular-js-integration-migration.mddocs/getting-started.mddocs/quick-start/README.mddocs/troubleshooting/README.md
🧠 Learnings (5)
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
PR: shakacode/react_on_rails#1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
PR: shakacode/react_on_rails#1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.
Applied to files:
docs/getting-started.mddocs/quick-start/README.md
📚 Learning: 2025-02-18T13:08:01.477Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
PR: shakacode/react_on_rails#1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
Applied to files:
docs/getting-started.md
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
PR: shakacode/react_on_rails#1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.
Applied to files:
docs/getting-started.md
🪛 markdownlint-cli2 (0.18.1)
docs/quick-start/README.md
170-170: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4
(MD001, heading-increment)
docs/troubleshooting/README.md
14-14: Link fragments should be valid
(MD051, link-fragments)
47-47: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
126-126: Emphasis used instead of a heading
(MD036, no-emphasis-as-heading)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: dummy-app-integration-tests (3.2, 20)
- GitHub Check: dummy-app-integration-tests (3.4, 22)
- GitHub Check: rspec-package-tests (3.4, minimum)
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: markdown-link-check
- GitHub Check: build
🔇 Additional comments (4)
docs/javascript/angular-js-integration-migration.md (1)
23-23: Correct Storybook brand/style update.Good catch updating the URL and casing.
docs/getting-started.md (2)
17-19: Grammar: add missing article in heading.This was flagged previously; please apply.
Apply this diff:
-### 📚 **Want comprehensive tutorial?** +### 📚 **Want a comprehensive tutorial?**
99-100: Clarify component name (remove Ruby sigil).Using “@component_name” suggests a Ruby ivar; use a plain identifier.
Apply this diff:
-`@component_name` is a string and corresponds to the name you used to globally expose your React component. +The component name is a string and must match the name you globally exposed for your React component.docs/troubleshooting/README.md (1)
1-305: Trailing newlines present — no changes needed.Verified: docs/troubleshooting/README.md, docs/quick-start/README.md, docs/getting-started.md, docs/javascript/angular-js-integration-migration.md all end with a newline.
| Note, your layout needs to include this in the <head>: | ||
|
|
||
| ```erb | ||
| <%= stylesheet_pack_tag %> | ||
| <%= javascript_pack_tag %> | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix pack tag usage in layout example.
Helpers require entrypoint names. Provide a realistic example.
Apply this diff:
-Note, your layout needs to include this in the <head>:
+Note, your layout needs to include your entrypoints in the <head> (example uses "application"):
```erb
- <%= stylesheet_pack_tag %>
- <%= javascript_pack_tag %>
+<%= stylesheet_pack_tag 'application', media: 'all' %>
+<%= javascript_pack_tag 'application' %>
<details>
<summary>🤖 Prompt for AI Agents</summary>
In docs/quick-start/README.md around lines 127 to 133, the layout example uses
stylesheet_pack_tag and javascript_pack_tag without required entrypoint names;
update the example to call the helpers with a realistic entrypoint (e.g.,
'application') and include the media attribute for the stylesheet: replace the
two tag lines with calls that pass 'application' to both helpers and add media:
'all' to the stylesheet helper so the example reflects valid usage.
</details>
<!-- fingerprinting:phantom:triton:chinchilla -->
<!-- This is an auto-generated comment by CodeRabbit -->
| - ✅ Installed and configured React on Rails | ||
| - ✅ Seen server-side rendering in action | ||
| - ✅ Experienced hot module reloading | ||
| - ✅ Created and used a custom React component with auto-bundling | ||
| - ✅ Passed props from Rails to React | ||
| - ✅ Used zero-configuration automatic bundling (no manual pack setup!) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove inaccurate SSR claim or show how to enable it.
The steps don't demonstrate prerendering. Either remove the SSR bullet or add a step using prerender: true.
Apply this diff to remove the claim:
- ✅ Seen server-side rendering in actionOptionally, add a short SSR example after Step 5:
+### Optional: Enable Server-Side Rendering
+
+```erb
+<%= react_component("SimpleCounter", { initialCount: 5 }, { auto_load_bundle: true, prerender: true }) %>
+```🤖 Prompt for AI Agents
In docs/quick-start/README.md around lines 149 to 155, the checklist incorrectly
claims server-side rendering (SSR) without demonstrating it; either remove the
"✅ Seen server-side rendering in action" bullet or add instructions to enable
SSR by setting prerender: true when rendering components. To fix: delete the SSR
checklist line if you want to avoid claiming it, or keep the line and add a
short example after Step 5 showing how to call react_component with prerender
enabled and auto_load_bundle true (i.e., show the erb invocation with prerender:
true) so the docs actually demonstrate prerendering.
| | Problem Area | Quick Check | Go to Section | | ||
| | -------------------- | ------------------------------------------- | -------------------------------------------- | | ||
| | **Installation** | Generator fails or components don't appear | [Installation Issues](#-installation-issues) | | ||
| | **Compilation** | Webpack errors, build failures | [Build Issues](#-build-issues) | | ||
| | **Runtime** | Components not rendering, JavaScript errors | [Runtime Issues](#-runtime-issues) | | ||
| | **Server Rendering** | SSR not working, hydration mismatches | [SSR Issues](#-server-side-rendering-issues) | | ||
| | **Performance** | Slow builds, large bundles, memory issues | [Performance Issues](#-performance-issues) | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix invalid anchor fragments in the table (MD051).
The emoji-prefixed headings generate anchors without a leading hyphen. Update links to valid fragments.
Apply this diff:
-| **Installation** | Generator fails or components don't appear | [Installation Issues](#-installation-issues) |
-| **Compilation** | Webpack errors, build failures | [Build Issues](#-build-issues) |
-| **Runtime** | Components not rendering, JavaScript errors | [Runtime Issues](#-runtime-issues) |
-| **Server Rendering** | SSR not working, hydration mismatches | [SSR Issues](#-server-side-rendering-issues) |
-| **Performance** | Slow builds, large bundles, memory issues | [Performance Issues](#-performance-issues) |
+| **Installation** | Generator fails or components don't appear | [Installation Issues](#installation-issues) |
+| **Compilation** | Webpack errors, build failures | [Build Issues](#build-issues) |
+| **Runtime** | Components not rendering, JavaScript errors | [Runtime Issues](#runtime-issues) |
+| **Server Rendering** | SSR not working, hydration mismatches | [SSR Issues](#server-side-rendering-issues) |
+| **Performance** | Slow builds, large bundles, memory issues | [Performance Issues](#performance-issues) |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Problem Area | Quick Check | Go to Section | | |
| | -------------------- | ------------------------------------------- | -------------------------------------------- | | |
| | **Installation** | Generator fails or components don't appear | [Installation Issues](#-installation-issues) | | |
| | **Compilation** | Webpack errors, build failures | [Build Issues](#-build-issues) | | |
| | **Runtime** | Components not rendering, JavaScript errors | [Runtime Issues](#-runtime-issues) | | |
| | **Server Rendering** | SSR not working, hydration mismatches | [SSR Issues](#-server-side-rendering-issues) | | |
| | **Performance** | Slow builds, large bundles, memory issues | [Performance Issues](#-performance-issues) | | |
| | Problem Area | Quick Check | Go to Section | | |
| | -------------------- | ------------------------------------------- | -------------------------------------------- | | |
| | **Installation** | Generator fails or components don't appear | [Installation Issues](#installation-issues) | | |
| | **Compilation** | Webpack errors, build failures | [Build Issues](#build-issues) | | |
| | **Runtime** | Components not rendering, JavaScript errors | [Runtime Issues](#runtime-issues) | | |
| | **Server Rendering** | SSR not working, hydration mismatches | [SSR Issues](#server-side-rendering-issues) | | |
| | **Performance** | Slow builds, large bundles, memory issues | [Performance Issues](#performance-issues) | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
14-14: Link fragments should be valid
(MD051, link-fragments)
🤖 Prompt for AI Agents
In docs/troubleshooting/README.md around lines 9 to 16, the table's "Go to
Section" links use fragment identifiers with a leading hyphen (e.g.
[Installation Issues](#-installation-issues)) which are invalid per MD051;
remove the leading hyphen from each fragment so they match the generated anchors
(e.g. change #-installation-issues to #installation-issues, #‑build-issues to
#build-issues, #‑runtime-issues to #runtime-issues,
#‑server-side-rendering-issues to #server-side-rendering-issues, and
#‑performance-issues to #performance-issues).
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
This category index file was an orphaned remnant from PR #1813 that used a different navigation approach with category landing pages. During the IA redesign (PR #1845), similar category index files like guides/advanced/README.md were deleted as "redundant" because docs/README.md now serves as the single navigation hub. The api-reference/README.md survived by accident and is now the only category with such an index file, creating inconsistency. Changes: - Deleted docs/api-reference/README.md (7-line TOC) - Updated docs/README.md reference to point directly to view-helpers-api.md (the main API reference file) - Preserves existing folder-level link on line 50 that points to api-reference/ Rationale: Category folders don't need README indexes when the main docs hub already provides navigation. This matches the pattern established when we deleted guides/advanced/README.md.
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
This category index file was an orphaned remnant from PR #1813 that used a different navigation approach with category landing pages. During the IA redesign (PR #1845), similar category index files like guides/advanced/README.md were deleted as "redundant" because docs/README.md now serves as the single navigation hub. The api-reference/README.md survived by accident and is now the only category with such an index file, creating inconsistency. Changes: - Deleted docs/api-reference/README.md (7-line TOC) - Updated docs/README.md reference to point directly to view-helpers-api.md (the main API reference file) - Preserves existing folder-level link on line 50 that points to api-reference/ Rationale: Category folders don't need README indexes when the main docs hub already provides navigation. This matches the pattern established when we deleted guides/advanced/README.md.
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
This category index file was an orphaned remnant from PR #1813 that used a different navigation approach with category landing pages. During the IA redesign (PR #1845), similar category index files like guides/advanced/README.md were deleted as "redundant" because docs/README.md now serves as the single navigation hub. The api-reference/README.md survived by accident and is now the only category with such an index file, creating inconsistency. Changes: - Deleted docs/api-reference/README.md (7-line TOC) - Updated docs/README.md reference to point directly to view-helpers-api.md (the main API reference file) - Preserves existing folder-level link on line 50 that points to api-reference/ Rationale: Category folders don't need README indexes when the main docs hub already provides navigation. This matches the pattern established when we deleted guides/advanced/README.md.
- Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication.
This category index file was an orphaned remnant from PR #1813 that used a different navigation approach with category landing pages. During the IA redesign (PR #1845), similar category index files like guides/advanced/README.md were deleted as "redundant" because docs/README.md now serves as the single navigation hub. The api-reference/README.md survived by accident and is now the only category with such an index file, creating inconsistency. Changes: - Deleted docs/api-reference/README.md (7-line TOC) - Updated docs/README.md reference to point directly to view-helpers-api.md (the main API reference file) - Preserves existing folder-level link on line 50 that points to api-reference/ Rationale: Category folders don't need README indexes when the main docs hub already provides navigation. This matches the pattern established when we deleted guides/advanced/README.md.
* Remove orphaned docs/guides/advanced/README.md This navigation index file was left behind after the reorganization in #1845. The links it contained point to files now in core-concepts/, making this index redundant. Cleanup after PR #1845. * Create introduction.md and remove redundant overview - Add docs/introduction.md as unified homepage - Explains what React on Rails is and why to use it - Clear when to use / when not to use decision guide - Three clear paths: Quick Start, Installation, Tutorial - Built from actual docs (overview, doctrine, system requirements) - Added community stat (thousands of production sites) - Delete docs/core-concepts/react-on-rails-overview.md - Content consolidated into introduction.md - Outdated prerequisites (Rails >=5 vs current Rails 7+) - Creates confusion with two similar entry points - Update links to overview.md: - docs/home.md: Overview → Introduction - docs/misc/doctrine.md: Overview → Introduction Solves Problem 1.2 (Multiple Conflicting Entry Points) from docs improvement plan. Next: Handle remaining entry point files (home.md, README.md, getting-started.md). * Simplify docs/README.md and enhance introduction.md - Simplify docs/README.md for GitHub users: - Direct users to website first - Keep valuable learning paths from PR #1813 - Keep popular use cases table - Add documentation categories overview - Remove duplicate content (now in introduction.md) - Reduced from 173 lines to 65 lines - Enhance introduction.md: - Add missing react_on_rails_demo_ssr_hmr example repo - Now has all 3 example repos (spec/dummy, demo SSR/HMR, live reactrails.com) Purpose: docs/README.md serves GitHub users browsing repo structure, while introduction.md serves as website homepage. Different audiences, minimal duplication. * Update ia-redesign-live.md with Phase 3 progress Document completion of entry point consolidation work: - Created introduction.md - Deleted overview.md - Simplified docs/README.md - Updated folder structure to reflect changes Next: Delete home.md, handle getting-started.md * Delete docs/home.md - replaced by introduction.md - Was the current website homepage (29 lines of links) - All valuable content already in introduction.md or README.md - No unique content lost (example repos, use cases, help links all covered) - Replaced by introduction.md as new website homepage Updated ia-redesign-live.md to reflect completion. Next: Extract content from getting-started.md then delete it. * Transform getting-started.md into understanding-react-on-rails.md Transform docs/getting-started.md (253 lines) into a focused conceptual guide: docs/getting-started/understanding-react-on-rails.md (238 lines). Changes: - Removed redundant sections (Choose Starting Point, System Requirements, More Reading) - Transformed installation section into brief conceptual overview with links - Kept and refined: Basic Usage, Auto-Bundling, Render-Functions, Error Handling - Added clear 'Next Steps' section with organized learning paths - Updated link in quick-start.md to point to new file - Deleted original docs/getting-started.md Purpose: This is now a conceptual journey guide explaining how React on Rails works, complementing the hands-on tutorial and quick-start guides. Addresses user feedback that tutorial was too overwhelming and mixed audiences. Next: Website config updates (keeping for last as requested) * Rename understanding-react-on-rails.md to using-react-on-rails.md Rationale: - "understanding" is vague and confusing next to how-react-on-rails-works.md - "using" clearly indicates practical usage guide - Better distinction: how-react-on-rails-works.md (architecture) vs using-react-on-rails.md (practical usage) Changes: - Renamed docs/getting-started/understanding-react-on-rails.md → using-react-on-rails.md - Updated link in quick-start.md - Updated references in ia-redesign-live.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Improve tutorial: extract Heroku deployment, fix versions, reorganize structure Changes to tutorial.md: 1. Replaced Heroku deployment section (139 lines) with brief Deployment section linking to deployment guides 2. Updated versions: Ruby 2.7 → 3.0+, Rails 5.1.3 → 7.0+, RoR v13 → v16 3. Clarified Redux usage: tutorial demonstrates Redux, but basic installer uses Hooks (user choice) 4. Merged duplicate HMR sections into one cohesive section using ./bin/dev 5. Renamed "Other features" → "Going Further" with better organization: - Server Rendering (important) - Optional Configuration subsection (/client structure, Cloud9, RubyMine) Changes to heroku-deployment.md: 1. Merged tutorial's detailed Heroku instructions with existing guide 2. Added note about older versions with link to current Heroku Rails 7 guide 3. Organized into clear sections: Create App, Buildpacks, Postgres, Puma, Node/Yarn, Assets, Deploy Rationale: - Tutorial was overwhelming with platform-specific deployment before core features - Heroku content now in dedicated guide (reusable, maintainable) - Clear separation: tutorial teaches React on Rails, deployment guides teach platforms - Better progression: install → run → features → deploy → advanced 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Delete outdated manual-installation-overview.md Rationale: - File has been outdated since 2018 (had "TODO: Review this file" for 7 years) - Confused purpose: title says "Manual Installation" but subtitle says "summarizes what generator does" - Outdated content: references /client directory, webpacker, missing auto-bundling - No clear use case: rails generate react_on_rails:install IS the manual installation (not external CLI like create-react-app) - Content is better covered in: - how-react-on-rails-works.md (architecture) - using-react-on-rails.md (usage) - Generator source code (what files are created) Changes: - Deleted docs/advanced-topics/manual-installation-overview.md - Removed link in installation-into-an-existing-rails-app.md - Updated ia-redesign-live.md tracker Decision discussed with team in Slack. Can be reverted if use case is identified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update IA redesign plan to reflect Phase 3 completion Mark Phase 3 as completed with notes on what actually happened vs what was planned: - ✅ Created introduction.md (as planned) - ✅ Transformed getting-started.md → using-react-on-rails.md (adapted from original plan) - ✅ Simplified README.md (kept, not deleted) - ✅ Deleted home.md (as planned) - ✅ Added tutorial improvements (discovered during work) - ✅ Deleted manual-installation-overview.md (discovered during work) - ✅ Updated cross-references manually (not scripted) Updated testing checklist to show what's complete and what's deferred to Phase 1. * linting * Fix MDX parsing error in quick-start.md Escape <head> tag in prose to prevent MDX from expecting closing tag. Changed "in the <head>:" to "in the `<head>` section:" to use inline code. This fixes gatsby-plugin-mdx compilation error: "Expected a closing tag for <head> before the end of paragraph" * Fix documentation H1 headings for improved search indexing Add missing H1 headings and improve H1 quality across 10 documentation files to enable proper Algolia search indexing and improve accessibility. Critical fixes (missing H1): - configuration.md: Add "React on Rails Configuration Options" - react-on-rails-pro.md: Change H2 to H1 - rails-engine-integration.md: Add "Integrating React on Rails with Rails Engines" - troubleshooting-when-using-webpacker.md: Add H1 and fix structure - troubleshooting-when-using-shakapacker.md: Add H1 and fix heading hierarchy - credits.md: Add "React on Rails Credits and Authors" Quality improvements (better searchability): - images.md: "Images" → "Configuring Images and Assets with Webpack" - foreman-issues.md: "Foreman Issues" → "Troubleshooting Foreman with React on Rails" - updating-dependencies.md: "Updating Dependencies" → "Updating Ruby and JavaScript Dependencies" - api-reference/README.md: "API Reference" → "React on Rails API Reference Guide" Why: Algolia indexes H1 as primary title. Files without H1 show as "Untitled" in search results. Generic H1s reduce searchability. Reference: docs/planning/docs-improvement/h1-headings-audit-report.md (local file, not tracked) * Fix multiple H1 headings in documentation for improved search indexing Continue fixing H1 heading issues by addressing files with multiple H1s. Demoted duplicate H1s to H2 throughout documentation while maintaining proper heading hierarchy (H1→H2→H3→H4). Files changed: - tutorial.md: Demoted 6 H1s (Table of Contents, Installation, HMR, Deployment, Going Further, Conclusion) - rails-engine-integration.md: Changed "Github Issues" H1 to H2 - hmr-and-hot-reloading-with-the-webpack-dev-server.md: Fixed 2 H1s with proper hierarchy - i18n.md: "Notes" H1 to H2 - react-and-redux.md: "Redux Reducers" H1 to H2 - react-router.md: "Server Rendering Using React Router V4" H1 to H2 - rspec-configuration.md: 2 H1s to H2s - generator-details.md: "Understanding the Organization..." H1 to H2 - redux-store-api.md: "More Details" H1 to H2 - view-helpers-api.md: "More details" H1 to H2 - style.md: "Git Usage" H1 to H2 Rationale: Multiple H1s per document confuse Algolia search ranking, screen readers, and violate accessibility standards. Each document should have exactly one H1 as the main title. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Restructure turbolinks.md to clarify Turbo vs legacy Turbolinks Reorganize turbolinks.md content to clearly separate modern Turbo (recommended) from legacy Turbolinks support. All Turbolinks v2 and v5 content is now properly nested under "Legacy Turbolinks Support" section. Key structural changes: - "Using Turbo" section remains at H2 level (modern, recommended approach) - Created "Legacy Turbolinks Support" H2 section with clear deprecation notice - Nested all Turbolinks content as H3-H5 subsections: - Why Turbolinks? (H3) - Requirements and "Why Not" sections (H3) - Installation details with checklists (H3→H4→H5) - Turbolinks 5 Specific Information (H3) - Technical Details and Troubleshooting (H3→H4) Content improvements: - Added explicit support status for Turbolinks 5.x and 2.x - Clarified auto-detection behavior for legacy versions - Moved CSRF/MIME type technical details under proper troubleshooting section - Updated messaging from "may be outdated" to "still supported, migrate when possible" Rationale: Based on codebase investigation (pageLifecycle.ts, turbolinksUtils.ts), Turbo is the recommended navigation system since 2021. All Turbolinks versions are legacy but still supported. Original flat structure mixed modern and legacy content without clear distinction, potentially confusing users about which system to use. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Modernize generator and project structure documentation This commit updates documentation that was 9.5 years outdated, removing references to directory structures and patterns that haven't existed since 2016 and replacing them with accurate modern (2025) guidance. ## Changes to docs/api-reference/generator-details.md - Replace outdated structure description with accurate modern organization - Document both non-Redux and Redux generator structures separately - Add visual directory trees showing actual generated code locations - Document previously undocumented --typescript option - Remove references to non-existent app/lib folder (removed Apr 2016) - Remove incorrect path app/javascript/app/bundles (never existed - was docs typo) - Add auto-bundling explanation with cross-reference - Show real component structure: src/ComponentName/ror_components/ ## Changes to docs/building-features/react-router.md - Update path reference from legacy client/app/bundles to modern src/ structure - Clarify this example applies to --redux generator option - Make path reference generic rather than specific to outdated structure ## Changes to docs/getting-started/project-structure.md Complete rewrite to reflect modern React on Rails: ### Removed outdated content: - Old bundles/ structure presented as current (was 2015-2016 pattern) - "Moving node_modules to /client" section (tested and proven broken with Shakapacker) - References to /client/app/assets directory (generator stopped creating in Apr 2016) - Outdated CSS/assets management discussion ### Added modern content: - Modern auto-bundling structure as recommended approach - Traditional manual structure as legacy option with clear use cases - Decision guide for choosing between approaches - CSS Modules documentation (default in generator since modern versions) - Real code examples from actual generator templates - Rails Asset Pipeline as alternative approach - Advanced global styles pattern ## Historical Context Research revealed: - Oct 2015: Generator created client/app/lib/middlewares/ and client/app/bundles/ - Apr 5, 2016: Docs added describing app/lib folder - Apr 23, 2016: Generator removed these directories (18 days later!) - Apr 2016 - Oct 2025: Docs never updated - outdated for 9.5 years ## Testing Performed Created test app at /home/ihab/ihab/work/shakacode/test/default-structure-test/: - Verified default generator creates src/ structure, not bundles/ - Verified CSS modules co-located with components - Tested /client conversion: works perfectly (just move + config change) - Tested moving node_modules to /client: FAILS with Shakapacker - Confirmed SHAKAPACKER_CONFIG env var doesn't solve the issue 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update React Router documentation and spec/dummy to v6 This major update modernizes React Router integration from outdated v4/v5 to current v6 API, fixing critical gaps discovered through testing. Documentation Changes (docs/building-features/react-router.md): - Remove 5-year-old "needs updating" warning - Pin React Router to v6 (^6.0.0) with explanation about v7 incompatibility - Add critical "Rails Routes Configuration" section with wildcard routing - Update all code examples to React Router v6 API: * Switch → Routes * component prop → element prop * StaticRouter import from 'react-router-dom/server' - Add path matching guidance (React Router paths must match Rails routes) - Update Turbolinks → Turbo/Turbolinks with Rails version context - Improve clarity: generator doesn't create React Router code - Add installation instructions and compatibility notes spec/dummy Updates (v5→v6 migration): - client/app/routes/routes.jsx: Add Routes wrapper, wildcard path support - client/app/components/RouterLayout.jsx: Switch→Routes, use relative paths - client/app/startup/RouterApp.server.jsx: Update StaticRouter import location - package.json: Upgrade react-router-dom from ^5.2.0 to ^6.0.0 - yarn.lock: Update dependencies (@remix-run/router@1.23.0) Key Discoveries from Testing: 1. React Router v7 merged with Remix, incompatible with our SSR approach 2. Rails wildcard routing is CRITICAL but was never documented 3. Documentation examples were 9+ years misleading about generator output 4. StaticRouter import location changed in v6 (breaks without this update) Testing: - Created fresh test app following documentation step-by-step - Validated client-side routing, SSR, direct URL visits, browser navigation - Confirmed spec/dummy React Router demo works with v6 API 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Modernize process manager documentation Replace outdated foreman-issues.md with comprehensive process-managers.md guide. Changes: - Create docs/building-features/process-managers.md with modern guidance - Documents both Overmind (recommended) and Foreman - Explains why React on Rails needs multiple processes - Includes authoritative explanation from Foreman's wiki about not bundling - Shows how bin/dev works under the hood - Move docs/building-features/foreman-issues.md to docs/outdated/ - Preserves 2017-era bug reports for historical reference - Removes clutter from main docs (outdated/ filtered from navigation) - Update lib/react_on_rails/dev/process_manager.rb - Change link from our old doc to official Foreman wiki - Users get explanation directly from authoritative source Addresses feedback that foreman-issues.md was outdated and didn't mention modern alternatives like Overmind (which bin/dev actually prefers). * Move outdated code-splitting.md to outdated/ and update references The code-splitting.md file was explicitly marked as "(Outdated)" and directed users to contact justin@shakacode.com instead of following it. The modern solution is React on Rails Pro's loadable-components guide. Changes: - Moved docs/building-features/code-splitting.md → docs/outdated/code-splitting.md - Updated API reference to point to Pro loadable-components (appropriate for reference docs) - Removed outdated code-splitting links from beginner guides (quick-start, using-react-on-rails) - Updated planning doc to track the move Rationale: - File content from 2017 for React Router v3/v4 with ExecJS - Uses deprecated patterns (manual renderer functions, webpack v1) - Example uses abandoned react-s3-uploader package - Pro's loadable-components doc (updated Sept 2022) provides modern approach - Uses @loadable/component (React team's official recommendation) - Both docs solve the same problem: code splitting WITH SSR - Outdated doc itself says to contact Justin about loadable-components Decision: Keep Pro feature out of beginner docs to avoid confusion about whether Pro is required. Only mention in API reference where advanced users look for specific features. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix broken links to outdated/webpack.md Two user-facing docs were linking to docs/outdated/webpack.md which is excluded from the website, causing 404 errors. Changes: - docs/core-concepts/webpack-configuration.md: Updated to link to Shakapacker's webpack customization docs (most relevant for users customizing webpack) - docs/deployment/troubleshooting-build-errors.md: Updated to link to our own webpack-configuration.md (keeps users in our documentation) Context: webpack.md was moved to outdated/ in commit e08f91d (Oct 3, 2025) because it contained "outdated Webpack v2 content". The file references Webpack v2 patterns and links to a 2017 forum post. These two links were not updated when the file was moved, causing broken references. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove outdated documentation folder The docs/outdated/ folder contained deprecated content that was excluded from the website build. This content is preserved in git history and can be accessed through previous commits if needed. Deleted files: - docs/outdated/code-splitting.md - docs/outdated/converting-from-custom-webpack-config-to-rails-webpacker-config.md - docs/outdated/deferred-rendering.md - docs/outdated/foreman-issues.md - docs/outdated/rails-assets-relative-paths.md - docs/outdated/rails-assets.md - docs/outdated/rails3.md - docs/outdated/tips-for-usage-with-sp6.md - docs/outdated/upgrade-webpacker-v3-to-v4.md - docs/outdated/webpack-v1-notes.md - docs/outdated/webpack.md This cleanup follows the recommendation to rely on git history rather than maintaining hidden documentation in the main branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix failing RSpec test after process manager docs update Updated test expectation to match the new Foreman documentation link. In commit 6cc93c7, we updated lib/react_on_rails/dev/process_manager.rb to link to Foreman's official wiki instead of our outdated foreman-issues.md. The test was still expecting the old link pattern. Change: - Old expectation: /foreman-issues\.md/ - New expectation: /Don't-Bundle-Foreman/ This matches the new error message which now points to: https://github.com/ddollar/foreman/wiki/Don't-Bundle-Foreman Fixes the failing spec: ReactOnRails::Dev::ProcessManager.show_process_manager_installation_help displays helpful error message with installation instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix broken markdown links to turbolinks.md Updated two broken links in react-router.md that were pointing to the old location ../rails/turbolinks.md which no longer exists. The turbolinks.md file was moved from docs/rails/ to docs/building-features/ during the PR #1845 documentation reorganization, but these links were not updated at that time. Changes: - ../rails/turbolinks.md → ./turbolinks.md (same directory) This fixes the markdown-link-check CI failure: ERROR: 1 dead link found in docs/building-features/react-router.md ! [✖] ../rails/turbolinks.md → Status: 400 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Enable React Router v7 future flags to silence warnings in tests Added future flags to BrowserRouter in the dummy app to enable v7-compatible behavior and eliminate console warnings that were causing test failures. Changes: - spec/dummy/client/app/startup/RouterApp.client.jsx: Added future prop with v7_startTransition and v7_relativeSplatPath flags Why this fixes the issue: The dummy app integration tests were failing because selenium_logger.rb treats JavaScript console warnings as errors. React Router v6 emits warnings about upcoming v7 changes:⚠️ React Router Future Flag Warning: React Router will begin wrapping state updates in React.startTransition in v7. You can use the v7_startTransition future flag to opt-in early.⚠️ React Router Future Flag Warning: Relative route resolution within Splat routes is changing in v7. You can use the v7_relativeSplatPath future flag to opt-in early. By enabling these flags, we: 1. Silence the warnings 2. Adopt v7-compatible behavior early 3. Demonstrate best practices for React Router v6 users 4. Align with React Router's official migration guide Reference: https://reactrouter.com/upgrading/future Fixes test failures: - React Router when rendering /react_router is expected to have text "Woohoo..." - React Router when rendering /react_router clicking links correctly renders... 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix documentation issues identified in PR review Addresses valid issues from Claude's PR review: 1. Fixed JavaScript syntax error in using-react-on-rails.md:192 - Changed semicolon to comma in object destructuring example - Was accidentally introduced during linting commit 2. Clarified Rails version requirements in tutorial.md - Changed "We support Rails 6 and later" to "This tutorial targets Rails 7.0+" - Explicitly noted Rails 6 is supported but tutorial uses Rails 7 - Removed version confusion between prerequisites and tutorial steps 3. Fixed markdownlint issues - Added language hint to code fence in using-react-on-rails.md (text) - Added language hint to Procfile code fence in heroku-deployment.md (procfile) These changes ensure code examples are syntactically correct and version requirements are clear for users following the tutorial. * typo * Remove redundant api-reference/README.md This category index file was an orphaned remnant from PR #1813 that used a different navigation approach with category landing pages. During the IA redesign (PR #1845), similar category index files like guides/advanced/README.md were deleted as "redundant" because docs/README.md now serves as the single navigation hub. The api-reference/README.md survived by accident and is now the only category with such an index file, creating inconsistency. Changes: - Deleted docs/api-reference/README.md (7-line TOC) - Updated docs/README.md reference to point directly to view-helpers-api.md (the main API reference file) - Preserves existing folder-level link on line 50 that points to api-reference/ Rationale: Category folders don't need README indexes when the main docs hub already provides navigation. This matches the pattern established when we deleted guides/advanced/README.md. * fix dead link * another dead link * Update Node.js requirement from 18+/16 to 20+ across documentation Fixes Node version inconsistencies identified by CodeRabbit in PR #1860. Changes: - docs/introduction.md: 18+ → 20+ - docs/getting-started/quick-start.md: 18+ → 20+ - docs/deployment/heroku-deployment.md: 16.19.0 → 20.0.0 Rationale: - React on Rails v16 requires Node 20+ for ESM module support - Node 16 reached EOL in September 2023 - Node 18 reaches EOL in April 2025 - CI currently tests only Node 20 and 22 - Release notes specify Node 20.19.0+ or 22.12.0+ required The tutorial.md (line 7) says "Updated for React on Rails v16" and users following it would use Node 20+, so deployment guide should match to avoid confusion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix broken React Router v6 migration guide link The link was returning 404. Updated from the incorrect path: - /en/main/upgrading/v5 (broken) to the working path: - /docs/en/v6/upgrading/v5 (verified working) This link was added in commit 391281a when updating React Router documentation to v6. The URL structure changed on reactrouter.com. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix inconsistent link text in how-to-conditionally-server-render doc Update link display text from 'here in docs/basics/configuration.md' to 'available here' to match the actual URL path (docs/api-reference/configuration/) Co-authored-by: Ihab Adham <ihabadham@users.noreply.github.com> * Document Turbo integration and immediate_hydration feature (resolve TODO) Replace TODO from PR #1620 with comprehensive Turbo documentation covering both free (Turbo Frames) and Pro (Turbo Streams) features. Changes: 1. **New "Using Turbo" Section** - Installation steps (turbo-rails gem + @hotwired/turbo-rails package) - Basic configuration (ReactOnRails.setOptions({ turbo: true })) - Turbo Frames usage (free, works out of the box) - Turbo Streams usage (requires immediate_hydration: true - Pro feature) - Complete working example with turbo_frame_tag and turbo_stream.update - Links to v16.0 release notes, streaming docs, and spec/dummy example 2. **Migration Context** - Note about force_load → immediate_hydration rename in v16.0 - Clear distinction between free vs Pro features - Explanation of WHY Turbo Streams need immediate_hydration (they don't dispatch turbo:render events, directly manipulate DOM) 3. **Improved Async Scripts Warning** - Replaced confusing "Do not use immediate_hydration: false" warning - New clear warning: "Async Scripts with Turbolinks Require Pro Feature" - Explains the race condition problem - Provides three alternatives with behavioral descriptions: * defer (waits for full page load before hydration) * Upgrade to Turbo (recommended) * Use Pro for immediate_hydration: true Technical Context: - PR #1620 (Aug 2024) added force_load for Turbo Streams - PR #1781 (Sep 2025) renamed to immediate_hydration + made Pro-only - Feature still actively used (spec/dummy has working example) - Default immediate_hydration: false causes race conditions with async scripts Resolves TODO on line 16 left by Justin in PR #1620 comments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove confusing "(Free)" label from Turbo Basic Setup heading The "(Free)" label in "### Basic Setup (Free)" was confusing because: - Appears before any mention of Pro features - Not used elsewhere in the codebase - Readers don't know what it's contrasting with yet - The Pro callout box later provides sufficient contrast Changed to simply "### Basic Setup" to match patterns used in other docs like streaming-server-rendering.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix multiple H1 headings in client-vs-server-rendering.md Changed second H1 to H2 for proper document structure: - Line 21: "# Different Server-Side Rendering Code" → "## Different..." Having multiple H1s in a document is problematic for: - SEO (search engines expect one H1 per page) - Accessibility (screen readers use heading hierarchy) - Documentation systems (assume H1 is the page title) - Navigation/table of contents generation The second heading is a subtopic about techniques for having different client/server code, so it should be H2 under the main page topic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Ihab Adham <ihabadham@users.noreply.github.com>
🎯 Summary
This PR consolidates and enhances React on Rails documentation with a focus on improving developer onboarding, user experience, and clarity. The changes combine the best improvements from previous documentation efforts while maintaining compatibility and accuracy.
📊 Key Improvements
🚀 New Documentation Resources
✨ Enhanced Existing Documentation
🔧 Technical Updates
auto_load_bundle: trueinstead of manual registration💡 User Experience Benefits
For New Users
For Experienced Developers
For AI Coding Agents
📈 Content Organization Improvements
🔗 Related Context
This PR consolidates improvements from multiple documentation enhancement efforts:
📋 Files Changed
New Files
AI_AGENT_INSTRUCTIONS.md- Setup guide for AI coding agentsdocs/README.md- Documentation navigation hubdocs/quick-start/README.md- 15-minute hands-on tutorialdocs/troubleshooting/README.md- Comprehensive troubleshooting guideDOCS_PR_SUMMARY.md- This documentation effort summaryEnhanced Files
README.md- Modernized main project READMEdocs/getting-started.md- Enhanced with user paths and system requirements✅ Quality Assurance
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com
This change is
Summary by CodeRabbit