Skip to content

Commit de2d407

Browse files
committed
docs: promote llm-assisted react_on_rails migration
1 parent 8c2b44a commit de2d407

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ While ShakaCode will continue to support this gem, you might consider migrating
2121
Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/main/react_ujs/index.js) implementation compared to the [ReactOnRails Node package](https://github.com/shakacode/react_on_rails/tree/master/node_package) which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as [React Server Components](https://react.dev/reference/rsc/server-components).
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).
24+
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).
2425

2526
---
2627
## ShakaCode Support

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

Lines changed: 32 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,34 @@ 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+
```text
70+
You are a senior Rails + React engineer. Migrate this app from react-rails to react_on_rails.
71+
72+
Use this guide as the source of truth:
73+
https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md
74+
75+
Requirements:
76+
1. Keep changes minimal and production-safe.
77+
2. Work in clear phases:
78+
- dependencies
79+
- installer changes
80+
- bundle entry points
81+
- view helper updates
82+
- cleanup
83+
3. At each phase:
84+
- explain what changed and why
85+
- show commands run
86+
- show exact files changed
87+
4. Do not remove behavior unless you explain the replacement.
88+
5. Run tests/lint after each phase and report failures before continuing.
89+
6. End with:
90+
- a migration checklist
91+
- rollback steps
92+
- a PR summary with risk level
93+
```
94+
95+
Review all generated diffs before merging.

0 commit comments

Comments
 (0)