-
-
Couldn't load subscription status.
- Fork 638
Update instructions to agents on formatting #1794
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
- **troubleshooting-build-errors.md**: Comprehensive guide for webpack/build issues - Missing routes file error patterns and solutions - ProvidePlugin module resolution troubleshooting - Environment setup dependencies and workarounds - Agent-friendly diagnostic scripts and auto-fixes - **coding-agents-guide.md**: Structured workflows for AI coding agents - Version compatibility matrix - Installation and upgrade workflows with error detection - Auto-fix strategies for common issues - Emergency procedures and rollback guidance - **upgrading-react-on-rails.md**: - Removed js:export from upgrade steps (it's a setup issue, not upgrade-specific) - Focused troubleshooting on actual upgrade-related issues - Added reference to comprehensive build errors guide - **getting-started.md**: Updated to use react_on_rails v16.0.0 - **home.md**: Added troubleshooting guide to navigation - Separated setup/installation issues from upgrade-specific issues - Provided agent-friendly automation and error detection - Enhanced troubleshooting with actionable solutions - Improved documentation discoverability These improvements make react_on_rails documentation more comprehensive and accessible for both human developers and AI coding agents. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
## Problem Documentation gave the impression that js-routes was a core react_on_rails requirement, when it's actually an optional integration used only in specific scenarios. ## Changes Made ### troubleshooting-build-errors.md - Added clear note that missing routes error only occurs with js-routes gem - Explained when js-routes IS and ISN'T needed - Provided alternative solution: remove ProvidePlugin if not using js-routes - Distinguished modern SPA patterns from Rails-heavy integration patterns ### coding-agents-guide.md - Added "(if using js-routes gem)" qualifier to all js:export commands - Updated auto-fix functions to clarify js-routes context - Modified diagnostic scripts to indicate js-routes dependency ### Environment dependencies - Clarified that rails js:export is only needed for js-routes gem ## Result - Documentation now accurately reflects js-routes as optional - Developers won't be confused into thinking it's required for react_on_rails - Clear guidance on when to use js-routes vs modern alternatives - Better separation of concerns between react_on_rails core and optional integrations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. WalkthroughDocumentation updates establish Prettier as the sole formatting authority, add explicit workflows for standard development and merge-conflict resolution, and expand developer commands. A new ignore rule is added for Claude Code local settings. Sections are renamed and renumbered in contributor guides, with updated examples for upgrade status output. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
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 |
Code Review for PR #1794: Update documentation for v16 and coding agentsThank you for updating the documentation! I've reviewed the changes and have the following feedback: ✅ Strengths
📝 Observations & Suggestions1. Markdown Table FormattingThe table header separator change in -| -------------- | ----------- | ------- | ------- | ---- |
+|----------------|-------------|---------|---------|------|This provides cleaner, more consistent formatting. 2. Code Block ConsistencyGood improvements in JavaScript code blocks, particularly the standardization of quotes and semicolons: new webpack.ProvidePlugin({
Routes: "$app/utils/routes"
})3. Documentation StructureExcellent removal of redundant blank lines after headers like "Detection:" and "Auto-fix:" - this creates tighter, more readable documentation.
|
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/contributor-info/coding-agents-guide.md (1)
108-112: Fix: sed corrupts Gemfile quoting — use Bundler or a safer sed
The sed replacement will produce mismatched quotes (e.g.gem 'react_on_rails", "~> 16.0'); replace with either:- sed -i 's/react_on_rails.*~> 14\.0/react_on_rails", "~> 16.0/' Gemfile + bundle add react_on_rails --version="~> 16.0" --strict- sed -i 's/react_on_rails.*~> 14\.0/react_on_rails", "~> 16.0/' Gemfile + sed -i -E "s/(gem ['\"]react_on_rails['\"], )['\"~><=^ 0-9.]+/\1'~> 16.0'/" Gemfile
🧹 Nitpick comments (8)
docs/javascript/troubleshooting-build-errors.md (2)
56-59: Map default export in ProvidePlugin (ESM correctness).If
app/javascript/utils/routes.jsexportsexport default Routes, ProvidePlugin should reference the default export to avoid injecting the module namespace. Recommend:- new webpack.ProvidePlugin({ - Routes: "$app/utils/routes" - }) + new webpack.ProvidePlugin({ + Routes: ["$app/utils/routes", "default"] + })
64-68: Mirror the ESM fix in the “remove if not using js-routes” example.Keep the example consistent with the default‑export mapping so users don’t copy a mismatched pattern elsewhere.
- new webpack.ProvidePlugin({ - Routes: "$app/utils/routes" // ← Remove this - }) + new webpack.ProvidePlugin({ + Routes: ["$app/utils/routes", "default"] // ← Remove this + })docs/contributor-info/coding-agents-guide.md (6)
81-82: Fix prerequisite check: verify Gemfile contents, not filename.
ls Gemfile | grep -q shakapackeralways succeeds if the file exists. Use grep on file content:- ls Gemfile | grep -q shakapacker || echo "⚠️ Shakapacker required" + grep -q "shakapacker" Gemfile || echo "⚠️ Shakapacker required"
141-143: Add Ruby version check to the pre‑upgrade checklist.You already check Node; add Ruby to ensure compatibility with the v16 matrix.
echo "Node.js version: $(node --version)" +echo "Ruby version: $(ruby -v)"
24-31: Call out CSS Modules import pattern (project‑specific gotcha).Given the project’s CSS Modules config with namedExports: true, add a reminder that imports should use
import * as style from './file.module.css'to avoid runtime/classname issues. Consider adding a bullet here or in Best Practices.
102-123: Optional: prefer Bundler flow over manual sed during upgrades.Since you already recommend
bundle addelsewhere, keep upgrade steps consistent and less error‑prone:- # 1. Update versions - sed -i 's/react_on_rails.*~> 14\.0/react_on_rails", "~> 16.0/' Gemfile - sed -i 's/"react-on-rails": "^14\./"react-on-rails": "^16./' package.json + # 1. Update versions + bundle add react_on_rails --version="~> 16.0" --strict + npm pkg set dependencies.react-on-rails="^16.0.0"
306-356: Include upgrade‑specific path note: app‑react16 files move to app/.Agents frequently miss that
app-react16/*files are copied/moved to/app/*during conversion, affecting import paths. Add a one‑liner in Best Practices or Upgrade Workflows to re‑verify relative imports after the move.
221-235: Tighten detection regex for ProvidePlugin alias errors.Anchoring on
$appis good; also consider matching both alias and file path to reduce false positives:-/Error: Can't resolve.*\$app/ +/Error: Can't resolve.*(\$app|utils\/routes)/
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/contributor-info/coding-agents-guide.md(1 hunks)docs/guides/upgrading-react-on-rails.md(0 hunks)docs/javascript/troubleshooting-build-errors.md(2 hunks)
💤 Files with no reviewable changes (1)
- docs/guides/upgrading-react-on-rails.md
🧰 Additional context used
🧠 Learnings (2)
📚 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/javascript/troubleshooting-build-errors.mddocs/contributor-info/coding-agents-guide.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/javascript/troubleshooting-build-errors.mddocs/contributor-info/coding-agents-guide.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). (7)
- GitHub Check: dummy-app-integration-tests (3.2, 20)
- GitHub Check: dummy-app-integration-tests (3.4, 22)
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: build
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: rspec-package-tests (3.4, minimum)
🔇 Additional comments (1)
docs/javascript/troubleshooting-build-errors.md (1)
150-159: Compatibility table formatting LGTM.Header alignment is correct and improves readability. No content change needed.
Apply Prettier formatting to documentation files that were left with inconsistent formatting after resolving merge conflicts during rebase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request Review: #1794 - Only formatting changes to docsSummaryThis PR appears to have no actual changes in the diff. The PR shows 0 additions and 0 deletions, with no files modified. Issues Identified
Recommendations
Next StepsPlease update the PR with the actual formatting changes so they can be properly reviewed. If you need help with git commands or have already made the changes locally but they're not showing up, let me know and I can assist. Note: Unable to review code quality, performance, security, or test coverage as no changes are present in this PR. |
Add comprehensive formatting guidelines to prevent formatting wars: - CLAUDE.md: Add Prettier as critical requirement with merge conflict workflow - linters.md: Add dedicated Prettier section with conflict resolution steps - coding-agents-guide.md: Add formatting requirements for AI agents Key principle: Prettier is the SOLE authority for formatting - never manually format code, especially during merge conflict resolution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request Review: Documentation Updates🔍 Current StatusThis PR shows 0 additions and 0 deletions despite having 3 commits that describe documentation improvements:
|
Code Review for PR #1794: Only formatting changes to docsThank you for these documentation improvements! I've reviewed the changes and here's my feedback: ✅ Strengths
📋 Recommendations
✅ Code Quality Assessment
🔒 Security & Performance
🧪 Test CoverageNot applicable for documentation changes. ✅ VerdictAPPROVED - These are valuable documentation improvements that will help prevent common formatting issues and improve the developer experience. The emphasis on Prettier as the sole formatting authority is particularly important for maintaining consistency across the codebase. The PR title accurately reflects that these are formatting-related documentation changes only, with no code modifications. Reviewed according to project guidelines in CLAUDE.md |
Code Review for PR #1794: Only formatting changes to docs✅ Overall AssessmentThis PR successfully improves the documentation around formatting rules and Prettier usage, which is crucial for maintaining consistent code formatting across the project. The changes are well-structured and address important pain points. 🎯 Strengths
📋 Suggestions for Improvement1. Consider consolidating duplicate contentThe formatting rules are now duplicated across three files (CLAUDE.md, coding-agents-guide.md, linters.md). Consider:
2. Add examples for common scenariosThe merge conflict resolution workflow could benefit from a concrete example showing actual Git commands and file states. 3. Clarify Prettier configurationConsider mentioning where the Prettier configuration lives (.prettierrc or package.json) and what file types it handles. ✔️ Code Quality
🔒 SecurityNo security concerns - this PR only modifies documentation and gitignore. 🚀 PerformanceNo performance impact - documentation only. 🧪 Test CoverageNot applicable for documentation changes. 💡 Additional NotesThe emphasis on 'NEVER manually format' and letting Prettier be the 'SOLE authority' is excellent - this will prevent many common issues with formatting conflicts between developers and tools. ✨ RecommendationAPPROVE - This PR improves the developer experience by clarifying formatting rules and workflows. The changes are beneficial and ready to merge. Great work on improving the project documentation! 🎉 |
Update formatting documentation to use proper automated commands: - Use `rake autofix` instead of manual `npx prettier --write <files>` - Use `yarn start format.listDifferent` for checking - Use `git add .` instead of manual file listing - Emphasize automated workflow over manual file management This makes the process much more reliable and less error-prone. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request Review: Update instructions to agents on formattingThank you for this PR that enhances the documentation for AI coding agents and formatting guidelines. Here's my comprehensive review: ✅ Strengths
📝 Suggestions for Improvement
🔍 Code Quality
✅ Security & PerformanceNo security or performance concerns - these are documentation-only changes. ✅ Test CoverageNot applicable for documentation changes. 💡 Additional Considerations
✅ Overall AssessmentThis is a valuable PR that will significantly improve the developer experience, especially for those using AI coding assistants. The emphasis on automated formatting and clear workflows will help prevent common issues. I recommend approval with the minor suggestions above considered for future improvements. The changes align well with the project's existing documentation style and provide practical, actionable guidance that will reduce friction in the development process. |
This change is
Summary by CodeRabbit
Documentation
Chores