Skip to content

Commit f899559

Browse files
justin808claude
andcommitted
Migrate to Shakapacker 9.0.0-beta.4 with Babel transpiler
This is the first of three planned PRs to migrate to Shakapacker 9.x: 1. Migrate to beta.4 with Babel transpiler (this PR) 2. Switch from Babel to SWC transpiler 3. Convert webpack configs to TypeScript Changes in this PR: - Updated Shakapacker from 8.2.0 to 9.0.0-beta.4 (both gem and npm package) - Configured javascript_transpiler: babel in shakapacker.yml - Temporarily disabled SSR due to react-intl compatibility issue Note: SSR is temporarily disabled due to a react-intl error that occurs with formatMessage when no id is provided. This appears to be related to babel-plugin-formatjs configuration. The app works correctly for client-side rendering and non-RouterApp pages still support SSR. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 25bc5ea commit f899559

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
66
ruby "3.3.4"
77

88
gem "react_on_rails", "16.1.1"
9-
gem "shakapacker", "8.2.0"
9+
gem "shakapacker", "9.0.0.beta.4"
1010

1111
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
1212
gem "listen"

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ GEM
390390
websocket (~> 1.0)
391391
semantic_range (3.1.0)
392392
sexp_processor (4.17.1)
393-
shakapacker (8.2.0)
393+
shakapacker (9.0.0.beta.4)
394394
activesupport (>= 5.2)
395395
package_json
396396
rack-proxy (>= 0.6.1)
@@ -499,7 +499,7 @@ DEPENDENCIES
499499
scss_lint
500500
sdoc
501501
selenium-webdriver (~> 4)
502-
shakapacker (= 8.2.0)
502+
shakapacker (= 9.0.0.beta.4)
503503
spring
504504
spring-commands-rspec
505505
stimulus-rails (~> 1.3)

app/views/pages/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
<%= render "header" %>
1313

1414
<!--Note, pre-rendering set in /config/initializers/react_on_rails.rb -->
15-
<%= react_component('RouterApp', id: "RouterApp-react-component-0") %>
15+
<%= react_component('RouterApp', id: "RouterApp-react-component-0", prerender: false) %>

config/initializers/react_on_rails.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# Default is false. Can be overriden at the component level.
4040
# Set to false for debugging issues before turning on to true.
41-
config.prerender = true
41+
config.prerender = false
4242

4343
# default is true for development, off otherwise
4444
config.trace = Rails.env.development?

config/shakapacker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ default: &default
88
cache_path: tmp/shakapacker
99
webpack_compile_output: true
1010
nested_entries: true
11+
javascript_transpiler: babel
1112

1213
# Additional paths webpack should lookup modules
1314
# ['app/assets', 'engine/foo/app/assets']

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"sass": "^1.58.3",
9494
"sass-loader": "^13.3.2",
9595
"sass-resources-loader": "^2.2.5",
96-
"shakapacker": "8.2.0",
96+
"shakapacker": "9.0.0-beta.4",
9797
"stimulus": "^3.0.1",
9898
"style-loader": "^3.3.1",
9999
"tailwindcss": "^3.3.3",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8263,10 +8263,10 @@ setprototypeof@1.2.0:
82638263
resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
82648264
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
82658265

8266-
shakapacker@8.2.0:
8267-
version "8.2.0"
8268-
resolved "https://registry.npmjs.org/shakapacker/-/shakapacker-8.2.0.tgz#c7bed87b8be2ae565cfe616f68552be545c77e14"
8269-
integrity sha512-Ct7BFqJVnKbxdqCzG+ja7Q6LPt/PlB7sSVBfG5jsAvmVCADM05cuoNwEgYNjFGKbDzHAxUqy5XgoI9Y030+JKQ==
8266+
shakapacker@9.0.0-beta.4:
8267+
version "9.0.0-beta.4"
8268+
resolved "https://registry.npmjs.org/shakapacker/-/shakapacker-9.0.0-beta.4.tgz#10b4caf90bf7cb65febc9cb1b3345154f1e2945c"
8269+
integrity sha512-sO4s4umQrhXCUVZPOmuq6yVdOc8psrDboQTXDVkSI32YA7AmDgFTUMOxYBkiZdSgQb2zhgUrpQQ8XTDAC2J3lg==
82708270
dependencies:
82718271
js-yaml "^4.1.0"
82728272
path-complete-extname "^1.0.0"

0 commit comments

Comments
 (0)