-
-
Notifications
You must be signed in to change notification settings - Fork 638
Add --rspack generator option for faster builds #1852
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
base: master
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 46 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (7)
WalkthroughAdds an Rspack option to React on Rails generators, conditionally configures Shakapacker for Rspack with SWC, installs appropriate Rspack dependencies, and introduces a bin/switch-bundler script to toggle between Webpack and Rspack, updating config and JS deps. Documentation describes usage, configuration, and dependency changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant InstallGen as InstallGenerator
participant BaseGen as BaseGenerator
participant FS as Filesystem
participant PkgMgr as Package Manager
Dev->>InstallGen: run react_on_rails:install --rspack
InstallGen->>InstallGen: select deps (Rspack vs Webpack)
InstallGen->>PkgMgr: install deps/devDeps (Rspack set)
InstallGen->>BaseGen: invoke with rspack: true
BaseGen->>FS: copy Shakapacker config
BaseGen->>FS: update shakapacker.yml (assets_bundler=rspack, webpack_loader=swc)
BaseGen-->>Dev: generator completed
sequenceDiagram
autonumber
participant Dev as Developer
participant Script as bin/switch-bundler
participant FS as Filesystem
participant PkgMgr as Package Manager
Dev->>Script: bin/switch-bundler rspack|webpack
Script->>Script: validate target bundler
Script->>FS: update shakapacker.yml (assets_bundler, webpack_loader)
Script->>FS: modify package.json deps/devDeps
Script->>PkgMgr: detect yarn/pnpm/npm
Script->>PkgMgr: install updated dependencies
Script-->>Dev: print next steps
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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: Add --rspack generator option for faster buildsSummaryThis PR adds a --rspack flag to enable Rspack bundler support. Overall, this is a well-structured and valuable feature that follows existing patterns. However, there are several issues that need to be addressed before merging. Critical Issues1. Security Vulnerability: YAML.load_file usageLocation: lib/generators/react_on_rails/templates/base/base/bin/switch-bundler:50 YAML.load_file is unsafe and can execute arbitrary code. Use YAML.safe_load_file instead with permitted_classes parameter. 2. Missing JSON requireLocation: lib/generators/react_on_rails/templates/base/base/bin/switch-bundler:73 The script uses JSON.parse but doesn't require the JSON library. Add require json at the top. 3. Fragile Regex-Based YAML ManipulationLocation: lib/generators/react_on_rails/base_generator.rb:416-418 The regex assumes source_path is always the first key after default: and will fail silently if the YAML structure is different. Better approach: Parse YAML, modify the hash, and write it back using YAML.safe_load_file. 4. Inconsistent YAML HandlingThe switch-bundler script properly parses YAML but base_generator.rb uses regex string manipulation. This inconsistency is error-prone. High Priority Issues5. Missing Test CoverageI searched the spec directory and found NO tests for the new --rspack flag. The existing generator has comprehensive tests for --redux and --typescript, so this feature should have similar coverage including:
6. No Validation of Existing assets_bundler SettingThe code checks if assets_bundler exists but doesn't handle the case where it is already set to something else. The gsub on line 422 will replace ALL webpack_loader occurrences, potentially breaking existing configuration. 7. Missing Error Handling in switch-bundlerThe script aborts after installing dependencies but before dev dependencies, leaving the system in an inconsistent state if the first command succeeds but the second fails. Suggestions8. Code Quality: DuplicationThe pattern for installing dependencies is repeated multiple times. Consider extracting to a helper method. 9. User Experience: Add Warning When SwitchingThe switch-bundler script should warn users about potential breaking changes and ask for confirmation. 10. Documentation: Missing CHANGELOG EntryA feature of this significance should have a CHANGELOG entry. What is Done Well
Priority RecommendationsMust fix before merge:
Should fix before merge: Great work on this feature! The performance improvements from Rspack are significant. Please address the critical security and testing issues before merging. |
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 (4)
RSPACK_IMPLEMENTATION.md
(1 hunks)lib/generators/react_on_rails/base_generator.rb
(3 hunks)lib/generators/react_on_rails/install_generator.rb
(4 hunks)lib/generators/react_on_rails/templates/base/base/bin/switch-bundler
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
{Gemfile,Rakefile,config.ru,**/*.{rb,rake,gemspec,ru}}
📄 CodeRabbit inference engine (CLAUDE.md)
{Gemfile,Rakefile,config.ru,**/*.{rb,rake,gemspec,ru}}
: All Ruby code must pass RuboCop with zero offenses before commit/push
RuboCop is the sole authority for Ruby file formatting; never manually format Ruby files
Files:
lib/generators/react_on_rails/install_generator.rb
lib/generators/react_on_rails/base_generator.rb
**/*.{js,jsx,ts,tsx,css,scss,json,yml,yaml,md}
📄 CodeRabbit inference engine (CLAUDE.md)
Prettier is the sole authority for formatting all non-Ruby files; never manually format them
Files:
RSPACK_IMPLEMENTATION.md
🧬 Code graph analysis (2)
lib/generators/react_on_rails/install_generator.rb (2)
lib/generators/react_on_rails/generator_helper.rb (1)
add_npm_dependencies
(23-39)lib/generators/react_on_rails/base_generator.rb (2)
handle_npm_failure
(248-260)add_dev_dependencies
(207-217)
lib/generators/react_on_rails/base_generator.rb (1)
lib/react_on_rails/packer_utils.rb (1)
shakapacker_version
(15-19)
⏰ 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). (12)
- GitHub Check: dummy-app-integration-tests (3.2, 20)
- GitHub Check: dummy-app-integration-tests (3.4, 22)
- GitHub Check: claude-review
- GitHub Check: rspec-package-tests (3.4, latest)
- GitHub Check: rspec-package-tests (3.4, minimum)
- GitHub Check: rspec-package-tests (3.2, latest)
- GitHub Check: rspec-package-tests (3.2, minimum)
- GitHub Check: examples (3.2, minimum)
- GitHub Check: examples (3.4, latest)
- GitHub Check: markdown-link-check
- GitHub Check: build
- GitHub Check: build-and-test
🔇 Additional comments (15)
lib/generators/react_on_rails/base_generator.rb (2)
22-26
: LGTM!The rspack option follows the established pattern for generator options and is clearly documented.
91-91
: LGTM!The conditional calls to
configure_rspack_in_shakapacker
are correctly placed to handle both fresh Shakapacker installations and existing configurations.Also applies to: 99-99
RSPACK_IMPLEMENTATION.md (1)
1-141
: LGTM!The documentation is comprehensive, accurate, and well-structured. It clearly explains the implementation, usage, configuration changes, and benefits of the rspack option.
lib/generators/react_on_rails/install_generator.rb (5)
31-35
: LGTM!The rspack option definition is consistent with other generator options and clearly documented.
82-83
: LGTM!The rspack option is correctly propagated to the base generator alongside other options.
434-434
: LGTM!The conditional call to
add_rspack_dependencies
is correctly placed in the dependency installation flow.
500-514
: LGTM!The
add_rspack_dependencies
method follows the established pattern for dependency installation with proper error handling and fallback mechanisms.
516-538
: Do not update BaseGenerator for rspack logicInstallGenerator defines and uses its own add_dev_dependencies (and does not inherit from BaseGenerator), so BaseGenerator’s hard-coded Webpack deps aren’t invoked here.
Likely an incorrect or invalid review comment.
lib/generators/react_on_rails/templates/base/base/bin/switch-bundler (7)
9-17
: LGTM!The dependency constants accurately reflect the packages needed for each bundler and match the documented dependencies in RSPACK_IMPLEMENTATION.md.
19-44
: LGTM!The initialization and validation logic is straightforward and provides clear error messages for invalid input.
46-61
: LGTM!The YAML configuration update uses proper parsing with
YAML.load_file
andYAML.dump
, which is more robust than string manipulation. This is the correct approach.
64-87
: LGTM!The dependency removal logic correctly identifies and removes the opposing bundler's packages from both dependencies and devDependencies, with appropriate error handling.
91-123
: LGTM!The dependency installation logic correctly detects the package manager and constructs appropriate commands for each, with proper error handling.
126-131
: LGTM!The package manager detection logic is consistent with the pattern used in the install generator.
135-143
: LGTM!The main execution block provides clear usage instructions and properly invokes the bundler switcher.
def configure_rspack_in_shakapacker | ||
shakapacker_config_path = "config/shakapacker.yml" | ||
return unless File.exist?(shakapacker_config_path) | ||
|
||
8000 | puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow | |
|
||
# Read the current config | ||
config_content = File.read(shakapacker_config_path) | ||
|
||
# Update assets_bundler to rspack in default section | ||
unless config_content.include?("assets_bundler:") | ||
# Add assets_bundler after source_path in default section | ||
config_content.gsub!(/^default: &default\n(\s+source_path:.*\n)/) do | ||
"default: &default\n#{Regexp.last_match(1)} assets_bundler: 'rspack'\n" | ||
end | ||
end | ||
|
||
# Update webpack_loader to swc (rspack works best with SWC) | ||
config_content.gsub!(/^\s*webpack_loader:.*$/, " webpack_loader: 'swc'") | ||
|
||
File.write(shakapacker_config_path, config_content) | ||
puts Rainbow("✅ Updated shakapacker.yml for Rspack").green | ||
end |
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 to use YAML parsing instead of string manipulation.
The current implementation uses string manipulation (regex and gsub!) on YAML content, which is fragile and error-prone. This approach has several issues:
- Line 414: The
unless config_content.include?("assets_bundler:")
check won't update an existingassets_bundler
setting (e.g., if it's already set to'webpack'
). - Lines 416-418: The regex assumes specific whitespace formatting and may not match variations.
- Line 422: The
gsub!(/^\s*webpack_loader:.*$/, ...)
updates ALL occurrences globally, not just in thedefault
section, which could affect environment-specific overrides.
Apply this diff to use proper YAML parsing:
def configure_rspack_in_shakapacker
shakapacker_config_path = "config/shakapacker.yml"
return unless File.exist?(shakapacker_config_path)
puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow
- # Read the current config
- config_content = File.read(shakapacker_config_path)
-
- # Update assets_bundler to rspack in default section
- unless config_content.include?("assets_bundler:")
- # Add assets_bundler after source_path in default section
- config_content.gsub!(/^default: &default\n(\s+source_path:.*\n)/) do
- "default: &default\n#{Regexp.last_match(1)} assets_bundler: 'rspack'\n"
- end
- end
-
- # Update webpack_loader to swc (rspack works best with SWC)
- config_content.gsub!(/^\s*webpack_loader:.*$/, " webpack_loader: 'swc'")
-
- File.write(shakapacker_config_path, config_content)
+ # Parse YAML config
+ config = YAML.load_file(shakapacker_config_path)
+
+ # Update default section
+ config["default"] ||= {}
+ config["default"]["assets_bundler"] = "rspack"
+ config["default"]["webpack_loader"] = "swc"
+
+ # Write back as YAML
+ File.write(shakapacker_config_path, YAML.dump(config))
puts Rainbow("✅ Updated shakapacker.yml for Rspack").green
end
Note: This approach is already used correctly in the switch-bundler
script (lines 50-59), so applying the same pattern here maintains consistency.
📝 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.
def configure_rspack_in_shakapacker | |
shakapacker_config_path = "config/shakapacker.yml" | |
return unless File.exist?(shakapacker_config_path) | |
puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow | |
# Read the current config | |
config_content = File.read(shakapacker_config_path) | |
# Update assets_bundler to rspack in default section | |
unless config_content.include?("assets_bundler:") | |
# Add assets_bundler after source_path in default section | |
config_content.gsub!(/^default: &default\n(\s+source_path:.*\n)/) do | |
"default: &default\n#{Regexp.last_match(1)} assets_bundler: 'rspack'\n" | |
end | |
end | |
# Update webpack_loader to swc (rspack works best with SWC) | |
config_content.gsub!(/^\s*webpack_loader:.*$/, " webpack_loader: 'swc'") | |
File.write(shakapacker_config_path, config_content) | |
puts Rainbow("✅ Updated shakapacker.yml for Rspack").green | |
end | |
def configure_rspack_in_shakapacker | |
shakapacker_config_path = "config/sh 8000 akapacker.yml" | |
return unless File.exist?(shakapacker_config_path) | |
puts Rainbow("🔧 Configuring Shakapacker for Rspack...").yellow | |
# Parse YAML config | |
config = YAML.load_file(shakapacker_config_path) | |
# Update default section | |
config["default"] ||= {} | |
config["default"]["assets_bundler"] = "rspack" | |
config["default"]["webpack_loader"] = "swc" | |
# Write back as YAML | |
File.write(shakapacker_config_path, YAML.dump(config)) | |
puts Rainbow("✅ Updated shakapacker.yml for Rspack").green | |
end |
Code Review: PR #1852 - Add --rspack generator option for faster builds📋 SummaryThis PR adds Rspack bundler support to React on Rails generators, providing a faster alternative to Webpack. The implementation is well-structured and follows existing patterns, but there are several areas that need attention before merging. ✅ Strengths
🔴 Critical Issues1. Missing rspack option in install_generator.rb line 127File: invoke "react_on_rails:base", [], { typescript: options.typescript?, redux: options.redux? } This line is missing the Expected: invoke "react_on_rails:base", [],
{ typescript: options.typescript?, redux: options.redux?, rspack: options.rspack? } Impact: HIGH - The rspack option won't work without this fix 2. Missing rspack class option declarationFile: The diff shows adding the Expected (after line 29): # --rspack
class_option :rspack,
type: :boolean,
default: false,
desc: "Use Rspack instead of Webpack as the bundler. Default: false" Impact: HIGH - Without this declaration, the 3. Missing rspack option in base_generator.rbFile: The diff shows adding the rspack class option at lines 22-26, but the actual file only shows the redux option at lines 15-20. The rspack option is missing entirely. Expected (after line 20): # --rspack
class_option :rspack,
type: :boolean,
default: false,
desc: "Use Rspack instead of Webpack as the bundler" Impact: HIGH - Base generator won't recognize the rspack option 4. Missing configure_rspack_in_shakapacker methodFile: The method Impact: CRITICAL - This will cause immediate runtime errors 5. Missing rspack dependency installationFile: The add_react_on_rails_package
add_react_dependencies
add_css_dependencies
add_dev_dependencies Expected (add after line 477): add_rspack_dependencies if options.rspack? Impact: HIGH - Rspack dependencies won't be installed 6. Missing add_rspack_dependencies methodFile: The Impact: CRITICAL - Method not found error when rspack option is used 7. add_dev_dependencies not updated for rspackFile: The current implementation always installs webpack dependencies, but according to the diff (lines 515-534), it should conditionally install rspack OR webpack dependencies based on the flag. Current: dev_deps = %w[
@pmmmwh/react-refresh-webpack-plugin
react-refresh
] Expected: dev_deps = if options.rspack?
%w[
@rspack/cli
@rspack/plugin-react-refresh
react-refresh
]
else
%w[
@pmmmwh/react-refresh-webpack-plugin
react-refresh
]
end Impact: HIGH - Will install wrong dependencies
|
Code Review for PR #1852: Add --rspack generator optionI've reviewed this PR and here's my comprehensive feedback: ✅ Strengths
🐛 Potential Issues1. YAML Regex Pattern Issue (base_generator.rb:416-418)The regex assumes source_path is always the first line after default: &default, which may not be true. Recommendation: Use YAML parsing instead of regex for safer manipulation. 2. Missing Error Handling (base_generator.rb:404-426)The configure_rspack_in_shakapacker method doesn't handle cases where the regex match fails, YAML structure is unexpected, or file write operations fail. 3. Incomplete JSON Require (bin/switch-bundler:72)Missing require 'json' at the top of the file. 4. Webpack Dependencies Still InstalledWhen using --rspack, the code doesn't prevent webpack dependencies from being installed by Shakapacker. 🧪 Test Coverage ConcernsCRITICAL: No automated tests were added for the new --rspack option. Tests should be added to spec/react_on_rails/generators/install_generator_spec.rb similar to existing tests for --redux and --typescript. 🎯 Before MergingPer CLAUDE.md requirements:
SummaryThis is a solid implementation that follows the project's conventions well. Main concerns:
Once tests are added and the YAML handling is improved, this will be ready to merge! 🤖 Generated with Claude Code |
Implements --rspack flag for react_on_rails:install generator to use Rspack bundler instead of Webpack, providing ~20x faster builds. ## Changes - Added --rspack option to install_generator.rb and base_generator.rb - Conditional dependency installation (rspack vs webpack packages) - Auto-configures shakapacker.yml for rspack with SWC transpiler - Created bin/switch-bundler utility to switch bundlers post-install ## Key Features - Rspack packages: @rspack/core, @rspack/cli, @rspack/plugin-react-refresh - Compatible with --typescript and --redux options - Reversible via bin/switch-bundler script - Supports npm, yarn, and pnpm package managers ## Usage rails generate react_on_rails:install --rspack bin/switch-bundler rspack # Switch existing app Based on patterns from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implements unified configuration approach where the same webpack config files work with both webpack and rspack bundlers, based on the assets_bundler setting in shakapacker.yml. ## Changes **development.js.tt**: - Add config import from shakapacker to access assets_bundler setting - Conditional React Refresh plugin loading: - Rspack: @rspack/plugin-react-refresh - Webpack: @pmmmwh/react-refresh-webpack-plugin - Prevents "window not found" errors when using rspack **serverWebpackConfig.js.tt**: - Replace hardcoded webpack require with bundler variable - Bundler conditionally requires @rspack/core or webpack - Use bundler.optimize.LimitChunkCountPlugin instead of webpack-specific - Eliminates warnings about webpack when using rspack **RSPACK_IMPLEMENTATION.md**: - Document webpack config template changes - Explain unified configuration approach ## Benefits - Single set of config files works for both bundlers - No warnings when using rspack about webpack.config.js - Seamless switching between bundlers via bin/switch-bundler - Follows pattern from react_on_rails-demos PR #20 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
0cee9aa
to
5006113
Compare
Pull Request Review: Add --rspack generator optionSummaryThis PR adds support for Rspack bundler as an alternative to Webpack. The implementation is well-structured and follows existing patterns. Overall, this is a solid contribution with good documentation. Strengths
Critical Issues1. Missing JSON require in switch-bundler (line 73)
2. Regex fragility in configure_rspack_in_shakapacker (base_generator.rb:416-418)
3. Code duplication
Medium Priority Issues4. Missing test coverage
5. Defensive plugin loading
Security & Performance
Action Items Before MergeMust Fix:
Should Fix:
Overall AssessmentRating: Strong Approve (after addressing critical issues) Well-designed feature with clear value. The two critical issues must be fixed but are straightforward. Once addressed this will be a great addition. Generated with Claude Code |
Code Review for PR 1852I have reviewed this PR implementing the rspack option. This is a well-structured implementation. Strengths
Critical IssuesMissing JSON Require - HIGH PRIORITYbin/switch-bundler uses JSON.parse without requiring json library No Test Coverage - HIGH PRIORITYNo automated tests included for rspack option File Permissions - MEDIUMbin/switch-bundler needs executable permissions RecommendationsAdd automated tests for:
Priority fixes: JSON require, executable permissions, test coverage Overall solid implementation - request changes for critical fixes then approve. |
Adds comprehensive test coverage for the --rspack generator option: ## New Test Contexts **with --rspack**: - Verifies base generator and non-redux generator behavior - Tests bin/switch-bundler script creation - Validates rspack dependencies in package.json - Ensures webpack dependencies are NOT installed - Checks unified webpack config with bundler detection - Verifies server webpack config uses bundler variable **with --rspack --typescript**: - Tests combination of rspack and typescript options - Verifies TypeScript component file creation (.tsx) - Validates tsconfig.json generation - Checks both rspack and typescript dependencies installed - Ensures TypeScript typing is correct ## Test Coverage 19 new examples added, all passing: - Dependency management (rspack vs webpack packages) - Webpack configuration templates (bundler detection) - TypeScript integration with rspack - bin/switch-bundler utility script ## Validation All specs pass successfully with 0 failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Code Review: Rspack Generator OptionThis is a well-structured PR. Here is my review: Strengths
Critical Issues1. YAML Regex Fragility (base_generator.rb:416-418)The regex pattern for inserting assets_bundler is brittle and assumes source_path is always first. Use YAML parser instead for reliability. 2. Switch-Bundler Script Lacks Safety (bin/switch-bundler:87-121)Script modifies package.json without backup or rollback. Add backup before modification. Medium Priority Issues
Low Priority Issues
SecurityGood security practices overall. Consider validating package manager exists before running system commands. Test CoverageExcellent coverage for main scenarios. Missing: --rspack --redux tests, shakapacker.yml YAML validation, switch-bundler functionality tests, error handling tests. SummaryHigh-quality work! Main recommendation: Address YAML parsing fragility before merging. Other issues can be follow-ups. Review following CLAUDE.md guidelines. |
Code Review - PR #1852: Add --rspack generator optionOverall, this is a well-structured implementation that adds Rspack support. The code follows existing patterns and provides good documentation. Strengths
Critical Issues - Must Fix Before Merge1. Missing require json in switch-bundler 2. Command injection vulnerability in switch-bundler 3. YAML formatting issue Additional Suggestions
VerdictGreat work! The unified config approach is well thought out. Please address the 3 critical security/bug issues above before merging. |
Summary
Implements
--rspack
flag forreact_on_rails:install
generator to use Rspack bundler instead of Webpack, providing significantly faster builds (~20x improvement with SWC).Based on implementation patterns from react_on_rails-demos PR #20.
Key Changes
--rspack
option toinstall_generator.rb
andbase_generator.rb
assets_bundler: 'rspack'
andwebpack_loader: 'swc'
bin/switch-bundler
utility: Allows switching between bundlers post-installationImplementation Details
Rspack Dependencies Installed
Production:
@rspack/core
- Core Rspack bundlerrspack-manifest-plugin
- Manifest generationDevelopment:
@rspack/cli
- Rspack CLI tools@rspack/plugin-react-refresh
- React Fast Refresh for Rspackreact-refresh
- React Fast Refresh runtimeWebpack Dependencies NOT Installed (with --rspack)
webpack
,webpack-cli
,webpack-dev-server
webpack-assets-manifest
,webpack-merge
@pmmmwh/react-refresh-webpack-plugin
Configuration Changes
When
--rspack
is used,config/shakapacker.yml
is updated:Usage Examples
Generate new app with Rspack:
With TypeScript:
With Redux:
Switch existing app:
Performance Benefits
According to react_on_rails-demos PR #20:
Bundler Switching Utility
The new
bin/switch-bundler
script allows easy switching between bundlers:Features:
shakapacker.yml
configurationUsage:
Compatibility
--typescript
option--redux
optionbin/switch-bundler
scriptTesting
Documentation
See
RSPACK_IMPLEMENTATION.md
for detailed implementation documentation.Test Plan
--rspack
flag--rspack --typescript
--rspack --redux
bin/switch-bundler
utility🤖 Generated with Claude Code
This change is
Summary by CodeRabbit
New Features
Documentation