Skip to content

Commit 6db68c5

Browse files
justin808claude
andcommitted
Fix CodeRabbit review issues: invalid config, version consistency, missing require
Addresses 3 critical issues identified in PR #1896 review: 1. Remove invalid javascript_transpiler configuration - Shakapacker 9.3.0 does not support a top-level javascript_transpiler key - Removed lines 39-42 from shakapacker.yml template - Transpiler selection is configured via webpack config and installed loaders 2. Update Pro package.json files to Shakapacker 9.3.0 - Updated react_on_rails_pro/spec/dummy/package.json (8.0.0 → 9.3.0) - Updated react_on_rails_pro/spec/execjs-compatible-dummy/package.json (8.0.0 → 9.3.0) - Added swc-loader and @swc/core dependencies to both files - Ensures version consistency across the codebase 3. Fix missing GeneratorMessages require in generator_helper.rb - Added require_relative "generator_messages" to prevent NameError - Issue occurred when detect_package_manager_and_exact_flag found multiple lock files - Now consistent with other generator files (base_generator.rb, install_generator.rb) All RuboCop checks pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a5b19dd commit 6db68c5

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/generators/react_on_rails/generator_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require "rainbow"
44
require "json"
5+
require_relative "generator_messages"
56

67
module GeneratorHelper
78
def package_json

lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ default: &default
3636
# Reload manifest.json on all requests so we reload latest compiled packs
3737
cache_manifest: false
3838

39-
# Select JavaScript transpiler to use
40-
# Available options: 'swc' (default, 20x faster), 'babel', or 'esbuild'
41-
# Note: When using rspack, swc is used automatically regardless of this setting
42-
javascript_transpiler: "swc"
43-
4439
# Raises an error if there is a mismatch in the shakapacker gem and npm package being used
4540
ensure_consistent_versioning: true
4641

react_on_rails_pro/spec/dummy/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
"sass": "^1.43.4",
6464
"sass-loader": "^12.3.0",
6565
"sass-resources-loader": "^2.0.0",
66-
"shakapacker": "8.0.0",
66+
"shakapacker": "9.3.0",
67+
"swc-loader": "^0.2.6",
68+
"@swc/core": "^1.7.0",
6769
"style-loader": "^3.3.1",
6870
"tailwindcss": "^3.2.7",
6971
"terser-webpack-plugin": "5",

react_on_rails_pro/spec/execjs-compatible-dummy/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"react": "^18.3.1",
3131
"react-dom": "^18.3.1",
3232
"react-on-rails": "link:.yalc/react-on-rails",
33-
"shakapacker": "8.0.0",
33+
"shakapacker": "9.3.0",
34+
"swc-loader": "^0.2.6",
35+
"@swc/core": "^1.7.0",
3436
"style-loader": "^4.0.0",
3537
"terser-webpack-plugin": "5",
3638
"webpack": "5",

0 commit comments

Comments
 (0)