Skip to content

Commit 6a6e5c8

Browse files
committed
Merge origin/main and finish the dependency consolidation
2 parents 660b717 + c2006e3 commit 6a6e5c8

20 files changed

Lines changed: 2233 additions & 1754 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ It outputs an ironically webpacked couple of files into `lib/assets/react-source
117117
- Update the [changelog](CHANGELOG.md) (find recent changes on GitHub by listing commits or showing closed PRs)
118118
- Regular versions: `bundle exec rake create_release\[2.7.0\]`
119119
- RC versions: `bundle exec rake create_release\[2.7.0.rc.2\]`
120+
- Dry run: `bundle exec rake create_release\[2.7.0,true\]`
120121
- Note, `rake create_release` runs `rake react:update` and `rake ujs:update`
121122

122123
## Styleguides

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
source "http://rubygems.org"
44

55
gemspec
6+
7+
# Keep development bundle compatible with both Ruby 2.7 CI and newer local Rubies.
8+
# Nokogiri 1.19+ requires Ruby 3.2+, which breaks the repo's Ruby 2.7 matrix.
9+
gem "nokogiri", "~> 1.15.7"

Gemfile.lock

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
react-rails (3.2.1)
4+
react-rails (3.3.0)
55
babel-transpiler (>= 0.7.0)
66
connection_pool
77
execjs
@@ -87,7 +87,7 @@ GEM
8787
babel-source (>= 4.0, < 6)
8888
execjs (~> 2.0)
8989
builder (3.2.4)
90-
byebug (11.0.1)
90+
byebug (11.1.3)
9191
capybara (3.37.1)
9292
addressable
9393
matrix
@@ -157,7 +157,7 @@ GEM
157157
matrix (0.4.2)
158158
method_source (1.0.0)
159159
mini_mime (1.1.2)
160-
mini_portile2 (2.8.6)
160+
mini_portile2 (2.8.9)
161161
minitest (5.17.0)
162162
minitest-retry (0.2.2)
163163
minitest (>= 5.0)
@@ -172,12 +172,14 @@ GEM
172172
net-smtp (0.5.0)
173173
net-protocol
174174
nio4r (2.7.3)
175-
nokogiri (1.14.3)
176-
mini_portile2 (~> 2.8.0)
175+
nokogiri (1.15.7)
176+
mini_portile2 (~> 2.8.2)
177177
racc (~> 1.4)
178-
nokogiri (1.14.3-x86_64-darwin)
178+
nokogiri (1.15.7-arm64-darwin)
179179
racc (~> 1.4)
180-
nokogiri (1.14.3-x86_64-linux)
180+
nokogiri (1.15.7-x86_64-darwin)
181+
racc (~> 1.4)
182+
nokogiri (1.15.7-x86_64-linux)
181183
racc (~> 1.4)
182184
notiffany (0.1.3)
183185
nenv (~> 0.1)
@@ -190,8 +192,8 @@ GEM
190192
byebug (~> 11.0)
191193
pry (~> 0.10)
192194
public_suffix (4.0.6)
193-
racc (1.6.2)
194-
rack (2.2.6.4)
195+
racc (1.8.1)
196+
rack (2.2.22)
195197
rack-test (2.0.2)
196198
rack (>= 1.3)
197199
rails (7.0.8.1)
@@ -256,6 +258,7 @@ GEM
256258
zeitwerk (2.6.6)
257259

258260
PLATFORMS
261+
arm64-darwin-23
259262
ruby
260263
x86_64-darwin-20
261264
x86_64-linux
@@ -273,6 +276,7 @@ DEPENDENCIES
273276
jbuilder
274277
listen (~> 3.0.0)
275278
minitest-retry
279+
nokogiri (~> 1.15.7)
276280
package_json
277281
pry-byebug (~> 3.8.0)
278282
rails (~> 7.0.7, >= 7.0.7.2)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Why? React on Rails code receives much more active development and testing. For
2222

2323
You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md).
2424

25+
For the fastest path, try the [LLM-assisted migration prompt](https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md#llm-assisted-migration-prompt).
26+
2527
---
2628
## ShakaCode Support
2729

docs/migrating-from-react-rails-to-react_on_rails.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
- [Why migrate?](#why-migrate)
77
- [Steps to migrate](#steps-to-migrate)
8+
- [LLM-assisted migration prompt](#llm-assisted-migration-prompt)
89

910
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1011

@@ -61,3 +62,43 @@ In this guide, it is assumed that you have upgraded the `react-rails` project to
6162

6263
You can also check [react-rails-to-react-on-rails](https://github.com/shakacode/react-rails-example-app/tree/react-rails-to-react-on-rails) branch on [react-rails example app](https://github.com/shakacode/react-rails-example-app) for an example of migration from `react-rails` v3 to `react_on_rails` v13.4.
6364

65+
## LLM-assisted migration prompt
66+
67+
You can usually do a safe first-pass migration quickly with a coding assistant. Give it this prompt:
68+
69+
If your assistant cannot browse URLs, paste this migration guide content directly into the prompt context before running the template.
70+
71+
```text
72+
You are a senior Rails + React engineer. Migrate this app from react-rails to react_on_rails.
73+
74+
Before starting, ask me for the relevant files (at minimum: Gemfile, package.json, JS entrypoints, config/initializers, and representative react_component usages).
75+
76+
Use this guide as the source of truth:
77+
https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md
78+
79+
Requirements:
80+
1. Keep changes minimal and production-safe.
81+
2. Work in clear phases:
82+
- dependencies
83+
- installer changes
84+
- bundle entry points
85+
- view helper updates
86+
- cleanup
87+
3. At each phase:
88+
- explain what changed and why
89+
- show commands run
90+
- show exact files changed
91+
4. Do not remove behavior unless you explain the replacement.
92+
5. After each phase, tell me the exact test/lint commands to run and wait for my output before continuing.
93+
6. End with:
94+
- a migration checklist
95+
- rollback steps
96+
- a PR summary with risk level
97+
7. Add safety checks:
98+
- if `rails g react_on_rails:install` fails to install JS deps, run the install commands shown by the generator
99+
- remove leftover `react_ujs` / `ReactRailsUJS` references
100+
- remove or replace stale `server_rendering.js` entries if present
101+
- if using Shakapacker, run `bundle exec rails shakapacker:compile` and fix compile errors before finalizing
102+
```
103+
104+
Review all generated diffs before merging.

0 commit comments

Comments
 (0)