Skip to content

Commit 55c2194

Browse files
justin808claude
andcommitted
Upgrade React on Rails from 14.2.1 to 16.0.1.rc.2
- Update react_on_rails gem: 14.2.1 → 16.0.1.rc.2 - Update react-on-rails npm: 14.2.1 → 16.0.1-rc.2 - Update rescript-react-on-rails: 1.0.1 → 1.1.0 (for React on Rails 16 support) - Add test environment configuration to resolve server bundle path issue - Add .prettierignore rule for ReScript generated files - All 38 tests passing ✅ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6e5113f commit 55c2194

File tree

6 files changed

+27
-13
lines changed

6 files changed

+27
-13
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ spec/support/
77
client/app/libs/i18n/translations.js
88
client/app/libs/i18n/default.js
99
vendor/bundle
10+
11+
# ReScript generated files should not be formatted
12+
**/*.bs.js

Gemfile

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

66
ruby "3.3.4"
77

8-
gem "react_on_rails", "14.2.1"
8+
gem "react_on_rails", "16.0.1.rc.2"
99
gem "shakapacker", "8.0.0"
1010

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

Gemfile.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,13 @@ GEM
298298
rdoc (6.14.2)
299299
erb
300300
psych (>= 4.0.0)
301-
react_on_rails (14.2.1)
301+
react_on_rails (16.0.1.rc.2)
302302
addressable
303303
connection_pool
304304
execjs (~> 2.5)
305305
rails (>= 5.2)
306306
rainbow (~> 3.0)
307+
shakapacker (>= 6.0)
307308
redcarpet (3.6.0)
308309
redis (5.3.0)
309310
redis-client (>= 0.22.0)
@@ -484,7 +485,7 @@ DEPENDENCIES
484485
rails-html-sanitizer
485486
rails_best_practices
486487
rainbow
487-
react_on_rails (= 14.2.1)
488+
react_on_rails (= 16.0.1.rc.2)
488489
redcarpet
489490
redis (~> 5.0)
490491
rspec-rails (~> 6.0.0)

config/initializers/react_on_rails.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
# not affect performance.
1515
config.server_bundle_js_file = "server-bundle.js"
1616

17+
# React on Rails 16 compatibility: Workaround for removed error handling
18+
#
19+
# BREAKING CHANGE in v16: React on Rails 14.2.1 had robust error handling that would
20+
# fallback to the Shakapacker output path when bundle lookup failed. This was removed
21+
# in v16.0.1.rc.2, causing it to look in the wrong directory during tests.
22+
#
23+
# This configuration tells React on Rails where to find bundles in test environment.
24+
# Without this, it defaults to public/webpack/test/ instead of public/packs/
25+
config.generated_assets_dir = Rails.public_path.join("packs").to_s if Rails.env.test?
26+
1727
################################################################################
1828
# CLIENT RENDERING OPTIONS
1929
# Below options can be overriden by passing options to the react_on_rails

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"react": "^19.0.0",
7979
"react-dom": "^19.0.0",
8080
"react-intl": "^6.4.4",
81-
"react-on-rails": "14.2.1",
81+
"react-on-rails": "16.0.1-rc.2",
8282
"react-redux": "^8.1.0",
8383
"react-router": "^6.13.0",
8484
"react-router-dom": "^6.13.0",
@@ -87,7 +87,7 @@
8787
"redux": "^4.2.1",
8888
"redux-thunk": "^2.2.0",
8989
"rescript": "^11.1.4",
90-
"rescript-react-on-rails": "^1.0.1",
90+
"rescript-react-on-rails": "1.1.0",
9191
"resolve-url-loader": "^2.2.0",
9292
"sanitize-html": "^2.11.0",
9393
"sass": "^1.58.3",

yarn.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7268,10 +7268,10 @@ react-is@^18.0.0:
72687268
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
72697269
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
72707270

7271-
react-on-rails@14.2.1:
7272-
version "14.2.1"
7273-
resolved "https://registry.npmjs.org/react-on-rails/-/react-on-rails-14.2.1.tgz#e3072f21bb76a45de789fc78046d2bf0d9496878"
7274-
integrity sha512-1a7RCDzhM2/oAZChnJMcYDV023Gl6nwa5SAS+NW13jIpkigihiRw2ecYAFSjQq2BfCnASDw2z1ElmfTXhrYagw==
7271+
react-on-rails@16.0.1-rc.2:
7272+
version "16.0.1-rc.2"
7273+
resolved "https://registry.npmjs.org/react-on-rails/-/react-on-rails-16.0.1-rc.2.tgz#efa95be66173f7653d954271005a38814cbb6065"
7274+
integrity sha512-A4aiSqoFpebpFlW5aFf0+vm+icFazO6PHmyvs9PdEfvgSwvFfakvYZ132hrNsZmHdHB+nl8C+xg0gFxG7lMmfA==
72757275

72767276
react-proxy@^1.1.7:
72777277
version "1.1.8"
@@ -7499,10 +7499,10 @@ requires-port@^1.0.0:
74997499
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
75007500
integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==
75017501

7502-
rescript-react-on-rails@^1.0.1:
7503-
version "1.0.1"
7504-
resolved "https://registry.yarnpkg.com/rescript-react-on-rails/-/rescript-react-on-rails-1.0.1.tgz#541dffdae64ec5053a50a3792b9db8783c959d1b"
7505-
integrity sha512-sbkDNCoiEWM9rqIiu+4joAj6W92yhM64KtLZQYfvYYm578jMcG02d98xpDeBT7MxZoPZZggFIed0m6Dj8bbDYA==
7502+
rescript-react-on-rails@1.1.0:
7503+
version "1.1.0"
7504+
resolved "https://registry.npmjs.org/rescript-react-on-rails/-/rescript-react-on-rails-1.1.0.tgz#391eaaab3fa70cbee501a30e99dcb806ce5d16ed"
7505+
integrity sha512-ujYfNlf8nm2wivoFWXanuluLT3K22oCgmB6oAUHtCNZ0ObXutZBtSmptkrWpMkGQViZ9Y+VsLBcYkgdwFccXrg==
75067506

75077507
rescript@^11.1.4:
75087508
version "11.1.4"

0 commit comments

Comments
 (0)