-
Notifications
You must be signed in to change notification settings - Fork 380
Migrate to shakapacker 8.4.0 #660
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
- Updated shakapacker gem from 8.2.0 to 8.4.0 - Updated shakapacker npm package from 8.2.0 to 8.4.0 - Fixed webpack configuration to preserve sass-resources-loader - Fixed path configurations for client/app structure - Added missing i18n default and translations files - Created symlinks for React on Rails compatibility - Built ReScript components - All tests passing and application working Note: Attempted migration to 9.0.0.beta.5 but encountered TypeScript compilation issues with the beta version. Will create separate PR for TypeScript conversion. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Warning
Rate limit exceeded
@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 57 seconds before requesting another review.
⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the @coderabbitai review
command as a PR comment. Alternatively, push new commits to this PR.
We recommend that you space out your commits to avoid hitting the rate limit.
🚦 How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.
⛔ Files ignored due to path filters (2)
Gemfile.lock
is excluded by!**/*.lock
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (24)
Gemfile
(1 hunks)Procfile.dev
(1 hunks)Procfile.dev-prod-assets
(1 hunks)Procfile.dev-static-assets
(1 hunks)app/controllers/hello_world_controller.rb
(1 hunks)app/javascript/generated
(1 hunks)app/javascript/packs/generated
(1 hunks)app/javascript/packs/server-bundle.js
(1 hunks)app/javascript/src/HelloWorld/ror_components/HelloWorld.module.css
(1 hunks)app/views/layouts/hello_world.html.erb
(1 hunks)babel.config.js
(1 hunks)config/initializers/react_on_rails.rb
(1 hunks)config/routes.rb
(1 hunks)config/shakapacker.yml
(2 hunks)config/webpack/alias.js
(1 hunks)config/webpack/clientWebpackConfig.js
(1 hunks)config/webpack/commonWebpackConfig.js
(2 hunks)config/webpack/development.js
(1 hunks)config/webpack/generateWebpackConfigs.js
(1 hunks)config/webpack/production.js
(1 hunks)config/webpack/serverWebpackConfig.js
(2 hunks)config/webpack/test.js
(1 hunks)package.json
(1 hunks)spec/rails_helper.rb
(1 hunks)
✨ Finishing touches
- 📝 Generate Docstrings
🧪 Generate unit tests
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
shakapacker-9-beta-5
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 @coderabbitai help
to get the list of available commands and usage tips.
🚀 Quick Review App Commands
Welcome! Here are the commands you can use in this PR:
/deploy-review-app
Deploy your PR branch for testing
/delete-review-app
Remove the review app when done
/help
Show detailed instructions, environment setup, and configuration options.
PR Review: Migrate to shakapacker 8.4.0
Thank you for this PR! I've reviewed the migration from shakapacker 8.2.0 to 8.4.0 and have the following feedback:
✅ Positive Aspects
- Conservative approach: Good decision to use stable 8.4.0 instead of the beta version after encountering TypeScript issues
- Comprehensive testing: All critical functionality appears tested (webpack compilation, Rails server, React components)
- Proper symlink setup: Smart use of symlinks for maintaining compatibility with React on Rails' expected directory structure
- HMR configuration: React Refresh setup is properly conditional based on WEBPACK_SERVE environment variable
🔍 Issues Found
1. Configuration Error in spec/rails_helper.rb (Lines 40-49)
There's a duplicate RSpec configuration block that causes a syntax error:
- Line 43 has ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config) inside the block
- Line 46 has an orphaned config.include FactoryBot::Syntax::Methods outside any block
- Lines 48-49 duplicate the same configuration
Fix needed: Remove lines 46-49 or properly structure the RSpec.configure block.
2. Incomplete webpack configuration in serverWebpackConfig.js
The file appears truncated at line 5 with 'const { merge, config } = requ'. This needs to be completed.
3. Missing controller and view files
New files were added (HelloWorldController, hello_world layout) that appear to be test/example code. Consider whether these should be included in the migration or kept separate.
⚠️ Potential Issues
-
Performance: The babel config enables React Refresh only when WEBPACK_SERVE is set, which is good. However, ensure this doesn't affect production builds.
-
Security: The new enforce_private_server_bundles setting in React on Rails config is correctly set to true for production security.
-
Procfile changes: The simplified Procfiles remove redis and rescript processes. Ensure this doesn't break any dependent functionality.
📝 Recommendations
- Fix the RSpec configuration error before merging
- Complete the serverWebpackConfig.js file
- Consider removing or documenting the HelloWorld example files if they're not needed
- Add migration notes to help other developers understand the key changes when updating
- Verify symlinks work correctly in all deployment environments
Test Coverage
The existing test suite appears adequate for this migration. The configuration properly uses ReactOnRails::TestHelper.configure_rspec_to_compile_assets for asset compilation during tests.
Overall, this is a solid migration with just a few issues that need addressing before merging. The approach is thoughtful and the documentation in the PR description is helpful.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Changes Made
Notes
Test Plan
🤖 Generated with Claude Code
This change is Reviewable