Skip to content

Commit d187d68

Browse files
committed
Merge remote-tracking branch 'origin/main' into jg-codex/conflict-resolve-2835
* origin/main: Bump version to 16.5.1 Update CHANGELOG.md for 16.5.1 (#2873) fix: include lib/tasks/ in pro gem so rake tasks are available (#2872) docs: clarify how React on Rails compares to alternatives (#2856) docs: fix published setup guidance gaps (#2860) docs: refresh setup and runtime guidance (#2857) docs: refresh pro upgrade examples (#2859) docs: modernize dependency update commands (#2864) Update spec/dummy Gemfile.lock for async >= 2.29 (#2870) # Conflicts: # CHANGELOG.md
2 parents b8667ed + d058690 commit d187d68

43 files changed

Lines changed: 326 additions & 213 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS_USER_GUIDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
gem search react_on_rails --remote
3333

3434
# Verify prerequisites
35-
ruby -v # Should be 3.2+
36-
node -v # Should be 20+
35+
ruby -v # Should be 3.0+
36+
node -v # Should be 18+
3737
rails -v # Should be 7+ (5.2+ supported)
3838
```
3939

CHANGELOG.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ After a release, run `/update-changelog` in Claude Code to analyze commits, writ
3535
[justin808](https://github.com/justin808).
3636
Fixes [Issue 2522](https://github.com/shakacode/react_on_rails/issues/2522).
3737

38+
### [16.5.1] - 2026-03-27
39+
3840
#### Fixed
3941

42+
- **[Pro] Fixed missing rake tasks in published gem**: The Pro gemspec excluded `lib/tasks/` from packaged files, so all `react_on_rails_pro:*` rake tasks (`verify_license`, `pre_stage_bundle_for_node_renderer`, `copy_assets_to_remote_vm_renderer`, `process_v8_logs`) were unavailable after gem install. [PR 2872](https://github.com/shakacode/react_on_rails/pull/2872) by [justin808](https://github.com/justin808).
4043
- **[Pro] Fixed bundle duplication in remote node renderer asset uploads**: When RSC support is enabled, running `rake react_on_rails_pro:copy_assets_to_remote_vm_renderer` no longer duplicates bundle JS files across bundle directories. Previously, both the server bundle and RSC bundle were copied into every target directory; now each bundle is placed only in its own directory while shared assets (manifests, stats) are correctly distributed to all. [PR 2768](https://github.com/shakacode/react_on_rails/pull/2768) by [AbanoubGhadban](https://github.com/AbanoubGhadban). Fixes [Issue 2766](https://github.com/shakacode/react_on_rails/issues/2766).
4144

4245
### [16.5.0] - 2026-03-25
4346

44-
Stable release — no changes from 16.5.0.rc.0.
45-
46-
### [16.5.0.rc.0] - 2026-03-25
47-
4847
#### Added
4948

5049
- **`create-react-on-rails-app --pro` support**: Added explicit `--pro` mode to the CLI, including `react_on_rails_pro` gem installation and generator wiring for Pro-only setup (without requiring `--rsc`). [PR 2818](https://github.com/shakacode/react_on_rails/pull/2818) by [justin808](https://github.com/justin808).
@@ -55,6 +54,7 @@ Stable release — no changes from 16.5.0.rc.0.
5554
#### Changed
5655

5756
- **[Pro]** **Canonical env var for worker count is now `RENDERER_WORKERS_COUNT`**. The previous `NODE_RENDERER_CONCURRENCY` is still supported as a fallback. Worker count validation now accepts explicit `0` for single-process mode and warns on invalid values. [PR 2611](https://github.com/shakacode/react_on_rails/pull/2611) by [justin808](https://github.com/justin808).
57+
- **[Pro]** **Migrated from `Async::Variable` to `Async::Promise`**: The streaming helper internals now use `Async::Promise` for async v2.29+ compatibility while preserving pre-first-chunk error propagation behavior. [PR 2832](https://github.com/shakacode/react_on_rails/pull/2832) by [justin808](https://github.com/justin808). Fixes [Issue 2563](https://github.com/shakacode/react_on_rails/issues/2563).
5858

5959
#### Improved
6060

@@ -72,10 +72,6 @@ Stable release — no changes from 16.5.0.rc.0.
7272
- **[Pro]** **Minimum `async` gem version bumped to 2.29**: The streaming helper now requires `async >= 2.29` (previously `>= 2.6`) due to the migration from `Async::Variable` to `Async::Promise`. If your Gemfile pins the `async` gem below 2.29, you will need to update it before upgrading React on Rails Pro. Run `bundle update async` to pick up the new minimum.
7373
[PR 2832](https://github.com/shakacode/react_on_rails/pull/2832) by [justin808](https://github.com/justin808).
7474

75-
#### Changed
76-
77-
- **[Pro]** **Migrated from `Async::Variable` to `Async::Promise`**: The streaming helper internals now use `Async::Promise` for async v2.29+ compatibility while preserving pre-first-chunk error propagation behavior. [PR 2832](https://github.com/shakacode/react_on_rails/pull/2832) by [justin808](https://github.com/justin808). Fixes [Issue 2563](https://github.com/shakacode/react_on_rails/issues/2563).
78-
7975
### [16.4.0] - 2026-03-16
8076

8177
#### Fixed
@@ -2070,9 +2066,9 @@ such as:
20702066

20712067
- Fix several generator-related issues.
20722068

2073-
[unreleased]: https://github.com/shakacode/react_on_rails/compare/v16.5.0...main
2074-
[16.5.0]: https://github.com/shakacode/react_on_rails/compare/v16.5.0.rc.0...v16.5.0
2075-
[16.5.0.rc.0]: https://github.com/shakacode/react_on_rails/compare/v16.4.0...v16.5.0.rc.0
2069+
[unreleased]: https://github.com/shakacode/react_on_rails/compare/v16.5.1...main
2070+
[16.5.1]: https://github.com/shakacode/react_on_rails/compare/v16.5.0...v16.5.1
2071+
[16.5.0]: https://github.com/shakacode/react_on_rails/compare/v16.4.0...v16.5.0
20762072
[16.4.0]: https://github.com/shakacode/react_on_rails/compare/v16.3.0...v16.4.0
20772073
[16.3.0]: https://github.com/shakacode/react_on_rails/compare/v16.2.1...v16.3.0
20782074
[16.2.1]: https://github.com/shakacode/react_on_rails/compare/v16.2.0...v16.2.1

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,22 @@ Ready to try Pro? Visit [React on Rails Pro docs](https://reactonrails.com/docs/
160160
📖 **[Complete Documentation](https://reactonrails.com/docs/)** - Comprehensive guides and API reference
161161
🎮 **[Live Demo](https://reactrails.com)** - See it in action with [source code](https://github.com/shakacode/react-webpack-rails-tutorial)
162162

163+
## Choosing the Right Rails + Frontend Stack
164+
165+
These options solve different problems. If you want to keep Rails as your main app and use React where it adds the most value, React on Rails is the strongest integrated path.
166+
167+
| Stack | Best fit | React + Rails model | SSR / RSC story | Tradeoffs |
168+
| ------------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
169+
| **React on Rails** | Existing or new Rails apps that want React integrated into Rails views with strong Rails conventions | React components render directly in Rails views via `react_component` | Built-in SSR in OSS; Pro adds Node-rendered SSR, streaming SSR, and React Server Components | More opinionated than wiring React into Rails by hand |
170+
| **React on Rails Pro** | Teams that want the same Rails integration model plus higher-performance SSR and advanced rendering features | Same Rails app and view-helper model as OSS, with Pro-only APIs on top | Node-based SSR, streaming SSR, React Server Components, SSR caching, and TanStack Router SSR | Extra rendering features come with more moving parts than OSS-only setups |
171+
| **Inertia Rails + React** | Teams that want SPA-style React pages with Rails controllers and no separate JSON API | Rails controllers return Inertia pages instead of traditional Rails views | Optional SSR; no first-class RSC path | Less natural for incremental React inside existing Rails views |
172+
| **Vite Ruby + React** | Teams that want a lightweight bundler setup and are comfortable wiring the integration themselves | Rails + Vite asset helpers, with React mounted manually | DIY / experimental SSR path | Fewer Rails-specific React helpers and conventions out of the box |
173+
| **react-rails** | Teams that want a simpler, older React-in-Rails integration | React components render in Rails views with a smaller surface area | Basic ExecJS SSR | Less active modern React investment and fewer advanced features |
174+
| **Next.js + Rails API** | React-first teams that want Next.js conventions and are willing to split frontend/backend concerns | Next.js frontend talking to Rails as an API or backend service | Strong App Router / RSC / streaming story | Usually means giving up the one-Rails-app model |
175+
| **Hotwire / Turbo** | Rails-first teams that want minimal custom JavaScript | HTML-over-the-wire with Stimulus/Turbo instead of React | Not a React SSR/RSC stack | Different programming model and not the React ecosystem |
176+
177+
**Recommended default:** Start with React on Rails if you want React inside a Rails app. Upgrade to React on Rails Pro when you want Node-based SSR, streaming SSR, React Server Components, or advanced SSR performance features. For more detail, see [Comparison with Alternatives](https://reactonrails.com/docs/getting-started/comparison-with-alternatives/) and the [OSS vs Pro feature matrix](https://reactonrails.com/docs/getting-started/oss-vs-pro/).
178+
163179
## Project Objective
164180

165181
To provide a high-performance framework for integrating Ruby on Rails with React, especially regarding React Server-Side Rendering for better SEO and improved performance.
@@ -182,7 +198,7 @@ To provide a high-performance framework for integrating Ruby on Rails with React
182198

183199
> **Trusted by thousands** - See [real production sites](https://publicwww.com/websites/%22react-on-rails%22++-undeveloped.com+depth%3Aall/) using React on Rails
184200
185-
See [Rails/Shakapacker React Integration Options](https://reactonrails.com/docs/building-features/rails-webpacker-react-integration-options) for comparisons to other gems.
201+
See [Comparison with Alternatives](https://reactonrails.com/docs/getting-started/comparison-with-alternatives/) for a deeper look at Inertia, Vite Ruby, react-rails, Next.js, and Hotwire.
186202

187203
## Online demo
188204

@@ -200,8 +216,8 @@ _Requires creating a free account._
200216

201217
- Ruby on Rails >= 5
202218
- Shakapacker >= 6.0 (CI tested: 8.2.0 - 9.5.0; autobundling requires >= 7.0)
203-
- Ruby >= 3.2 (CI tested: 3.2 - 3.4)
204-
- Node.js >= 20 (CI tested: 20 - 22)
219+
- Ruby >= 3.0 (package minimum; CI tested: 3.2 - 3.4)
220+
- Node.js >= 18 (package minimum; CI tested: 20 - 22)
205221
- A JavaScript package manager (npm, yarn, pnpm, or bun)
206222

207223
# 🆘 Get Help & Support

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ React on Rails is one product with two tiers: open source for Rails + React inte
3333
- [API Reference](./oss/api-reference/view-helpers-api.md)
3434
- [Deployment and troubleshooting](./oss/deployment/README.md)
3535
- [Configuration](./oss/configuration/README.md)
36-
- [Changelog](./oss/upgrading/changelog.md)
36+
- [Changelog](https://github.com/shakacode/react_on_rails/blob/main/CHANGELOG.md)
3737

3838
## Pro features
3939

docs/oss/api-reference/generator-details.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ can pass the redux option if you'd like to have redux setup for you automaticall
5858
Passing the --rsc generator option sets up React Server Components support.
5959
This automatically includes Pro setup (--rsc implies --pro). Creates RSC
6060
webpack configuration, a HelloServer example component, and RSC routes.
61-
Requires React 19.0.x.
61+
Requires React 19 with a compatible `react-on-rails-rsc` version.
6262
6363
*******************************************************************************
6464
@@ -261,7 +261,7 @@ rails generate react_on_rails:install --rsc
261261
**Prerequisites:**
262262

263263
- React on Rails Pro gem installed (see Pro prerequisites above)
264-
- React 19.0.x (RSC is not yet supported on React 19.1.x or later)
264+
- React 19 with a compatible `react-on-rails-rsc` version
265265

266266
RSC builds on React on Rails Pro's Node rendering infrastructure. The generator adds a separate webpack entry point for server components, configures the `RSCWebpackPlugin` in both client and server webpack configs, and sets up the `RSC_BUNDLE_ONLY` environment variable handling in `ServerClientOrBoth.js` for independent RSC bundle compilation.
267267

docs/oss/building-features/i18n.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ By default, the locales are generated as JSON, but you can also generate them as
136136
config.i18n_output_format = "js"
137137
```
138138

139-
2. Add `react-intl` & `intl` to `client/package.json`, and remember to run `bundle install` and your package manager's install command (e.g., `npm install`, `yarn install`, or `pnpm install`). The minimum supported versions are:
139+
2. Add `react-intl` & `intl` to your root `package.json`, and remember to run `bundle install`
140+
and your package manager's install command (e.g., `npm install`, `yarn install`, or
141+
`pnpm install`). The minimum supported versions are:
140142

141143
```js
142144
"dependencies": {

docs/oss/building-features/images.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,18 @@ const assetLoaderRules = [
3030

3131
A full example can be found at [react_on_rails/spec/dummy/client/app/startup/ImageExample.jsx](https://github.com/shakacode/react_on_rails/tree/main/react_on_rails/spec/dummy/client/app/startup/ImageExample.jsx)
3232

33-
You are free to use images either in image tags or as background images in SCSS files. You can
34-
use a "global" location of /client/app/assets/images or a relative path to your JS or SCSS file, as
35-
is done with CSS modules.
33+
You are free to use images either in image tags or as background images in SCSS files. In current
34+
apps, prefer relative imports from files under `app/javascript`, or define your own webpack alias
35+
if you want a global asset path.
3636

37-
**images** is a defined alias, so "images/foobar.jpg" would point to the file at
38-
`/client/app/assets/images/foobar.jpg.`
37+
React on Rails does not define an `images` alias by default. If you want one, add it explicitly.
38+
For example, if your images live in `app/javascript/images`, then `"images/foobar.jpg"` can point
39+
to `app/javascript/images/foobar.jpg` with a custom alias like this:
3940

4041
```javascript
41-
resolve: {
42+
resolve: {
4243
alias: {
43-
images: join(process.cwd(), 'app', 'assets', 'images'),
44+
images: join(process.cwd(), 'app', 'javascript', 'images'),
4445
},
4546
},
4647
```

docs/oss/building-features/node-renderer/basics.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ For the most control over the setup, create a JavaScript file to start the NodeR
5555
mkdir renderer-app
5656
cd renderer-app
5757
```
58-
2. Make sure you have **Node.js** version **14** or higher and **Yarn** installed.
59-
3. Init node application and install the `react-on-rails-pro-node-renderer` package.
58+
2. Make sure you have **Node.js 18+** and a JavaScript package manager such as **npm**, **pnpm**, **Yarn**, or **bun**.
59+
3. Initialize a Node application and install the `react-on-rails-pro-node-renderer` package.
6060
```sh
61-
yarn init
62-
yarn add react-on-rails-pro-node-renderer
61+
npm init -y
62+
npm install react-on-rails-pro-node-renderer
63+
# or: pnpm add react-on-rails-pro-node-renderer
64+
# or: yarn add react-on-rails-pro-node-renderer
65+
# or: bun add react-on-rails-pro-node-renderer
6366
```
6467
4. Configure a JavaScript file that will launch the rendering server per the docs in [Node Renderer JavaScript Configuration](./js-configuration.md). For example, create a file `node-renderer.js`. Here is a simple example that uses all the defaults except for serverBundleCachePath:
6568

@@ -82,7 +85,7 @@ For the most control over the setup, create a JavaScript file to start the NodeR
8285
Create `config/initializers/react_on_rails_pro.rb` and configure the **renderer server**. See configuration values in [Configuration](../../configuration/configuration-pro.md). Pay attention to:
8386

8487
1. Set `config.server_renderer = "NodeRenderer"`
85-
2. Leave the default of `config.prerender_caching = true` and ensure your Rails cache is properly configured to handle the additional cache load.
88+
2. Decide whether to enable `config.prerender_caching = true`. The default is `false`; turn it on only if you want Rails cache-backed SSR result caching and your cache is configured for the additional load.
8689
3. Configure values beginning with `renderer_`
8790
4. Use ENV values for values like `renderer_url` so that your deployed server is properly configured. If the ENV value is unset, the default for the renderer_url is `localhost:3800`.
8891
5. Here's a tiny example using mostly defaults:

docs/oss/building-features/node-renderer/debugging.md

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,62 @@
55
66
Because the renderer communicates over a port to the server, you can start a renderer instance locally in your application and debug it.
77

8-
## Yalc vs Yarn Link
8+
## Monorepo Workflow
99

10-
The project is setup to use [yalc](https://github.com/whitecolor/yalc). This means that at the top level
11-
directory, `yalc publish` will send the node package files to the global yalc store. Running `yarn` in the
12-
`/spec/dummy/client` directory will copy the files from the global yalc store over to the local `node_modules`
13-
directory.
10+
For renderer debugging inside this repo, use the Pro dummy app at `react_on_rails_pro/spec/dummy`.
11+
It is a `pnpm` workspace app and already points at the local packages in this monorepo.
1412

1513
## Debugging the Node Renderer
1614

17-
1. cd to the top level of the project.
18-
1. `yarn` to install any libraries.
19-
1. To compile renderer files on changes, open console and run `yarn build:dev`.
20-
1. Open another console tab and run `RENDERER_LOG_LEVEL=debug yarn start`
21-
1. Reload the browser page that causes the renderer issue. You can then update the JS code, and restart the `yarn start` to run the renderer with the new code.
22-
1. Be sure to restart the rails server if you change any ruby code in loaded gems.
23-
1. Note, the default setup for spec/dummy to reference the pro renderer is to use yalc, which may or may not be using a link, which means that you have to re-run yarn to get the files updated when changing the renderer.
24-
1. Check out the top level nps task `nps renderer.debug` and `spec/dummy/package.json` which has script `"node-renderer-debug"`.
15+
### Quick start: debugging with the full stack running
16+
17+
If you already have the dummy app running via `bin/dev` (which uses `Procfile.dev`), the node renderer is already listening on port 3800 with `--inspect` enabled. To debug:
18+
19+
1. Open `chrome://inspect` in Chrome and connect to the renderer process.
20+
2. Use overmind to isolate renderer logs: `overmind connect node-renderer` (Ctrl-B to detach).
21+
3. After a code change, restart just the renderer: `overmind restart node-renderer`.
22+
23+
### Isolated debugging: manual per-terminal startup
24+
25+
Use this when you need full control over the renderer process — different flags, a specific bundle, or rebuilding just the renderer package.
26+
27+
1. From the repo root, install dependencies and build the local packages:
28+
```bash
29+
pnpm install
30+
pnpm run build
31+
```
32+
1. In one terminal, start the Pro dummy bundle watcher:
33+
```bash
34+
cd react_on_rails_pro/spec/dummy
35+
pnpm run build:dev:watch
36+
```
37+
1. In another terminal, start the renderer with verbose logging:
38+
```bash
39+
cd react_on_rails_pro/spec/dummy
40+
RENDERER_LOG_LEVEL=debug pnpm run node-renderer
41+
```
42+
1. If you want to attach a debugger instead, run:
43+
```bash
44+
cd react_on_rails_pro/spec/dummy
45+
pnpm run node-renderer-debug
46+
```
47+
1. Reload the page that triggers the SSR issue and reproduce the problem.
48+
1. If you change Ruby code in loaded gems, restart the Rails server.
49+
1. If you change code under `packages/react-on-rails-pro-node-renderer`, rebuild that package before restarting the renderer:
50+
```bash
51+
pnpm --filter react-on-rails-pro-node-renderer run build
52+
```
53+
1. If you are debugging an external app instead of the monorepo dummy app, refresh the installed renderer package using your local package workflow (for example `yalc`, `npm pack`, or a workspace link) before rerunning the renderer.
2554

2655
## Debugging Memory Leaks
2756

2857
If worker memory grows over time, use heap snapshots to find the source:
2958

3059
1. Start the renderer with `--expose-gc` to enable forced GC before snapshots:
3160
```bash
32-
node --expose-gc node-renderer.js
61+
cd react_on_rails_pro/spec/dummy
62+
# Adjust the port if your Rails app points at a different renderer URL.
63+
RENDERER_PORT=3800 node --expose-gc client/node-renderer.js
3364
```
3465
2. Take heap snapshots at different times using `v8.writeHeapSnapshot()` (triggered via `SIGUSR2` signal or a custom endpoint).
3566
3. Load both snapshots in Chrome DevTools (Memory tab → Load) and use the **Comparison** view to see which objects accumulated between snapshots.

0 commit comments

Comments
 (0)