Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a313542
Scope RSC client references to app source
justin808 Apr 30, 2026
e39d1df
Add changelog for RSC client reference scope
justin808 Apr 30, 2026
c8ddf9d
Harden RSC client reference generator transform
justin808 Apr 30, 2026
c4aef70
Avoid duplicate RSC webpack imports
justin808 Apr 30, 2026
504d59d
Harden RSC import guards
justin808 May 4, 2026
3412594
Tighten RSC resolve import detection
justin808 May 4, 2026
732b200
Upgrade existing RSC plugin references
justin808 May 4, 2026
24a6ff7
Guard RSC migration rewrites
justin808 May 4, 2026
aee391f
Handle customized RSC migration guards
justin808 May 4, 2026
6cbab25
Strengthen RSC client reference generator spec
justin808 May 8, 2026
9435c9c
Harden RSC client reference rewrites
justin808 May 8, 2026
d86b3e0
Handle existing RSC clientReferences robustly
justin808 May 8, 2026
fd755d9
Harden RSC plugin option rewrites
justin808 May 8, 2026
b9071fb
fix: keep RSC migration dry runs complete
justin808 May 9, 2026
595915d
fix: handle indented RSC migration imports
justin808 May 9, 2026
02222cb
fix: stop RSC plugin scanner from misreading post-options block comments
justin808 May 11, 2026
101bcd6
Fix RSC client reference review issues
justin808 May 12, 2026
caab60a
Tighten RSC migration scanner and helper detection
justin808 May 20, 2026
9599d25
Harden RSC migration detection and comma splice
justin808 May 21, 2026
16b2fbb
Address RSC migration review: depth-aware splice + comment skipping
justin808 May 21, 2026
e43f48b
Make RSC plugin clientReferences gating depth-aware
justin808 May 21, 2026
d736035
Address RSC migration review (round 2)
justin808 May 22, 2026
948f175
Address RSC migration review (round 3)
justin808 May 22, 2026
26c5d74
Address RSC migration review (round 4)
justin808 May 22, 2026
d63660b
Address RSC migration review (round 5)
justin808 May 22, 2026
b6a2c78
Address RSC migration review (round 6)
justin808 May 22, 2026
0b311c3
Fix RSC import binding detection
justin808 May 24, 2026
6893b89
Fix RSC helper migration review gaps
justin808 May 24, 2026
1bf95a0
Handle mixed RSC client reference helpers
justin808 May 24, 2026
381ae67
Refactor RSC setup helpers
justin808 May 24, 2026
992378d
Fix RSC client reference scanner edge cases
justin808 May 24, 2026
16cea95
Fix RSC scanner comment-aware regex detection
justin808 May 25, 2026
cef2123
Handle RSC scanner review edge cases
justin808 May 25, 2026
074523c
Harden RSC client reference migration
justin808 May 25, 2026
7ae03d3
Handle RSC setup readiness in skip mode
justin808 May 25, 2026
0f621b8
Warn when RSC plugin setup is skipped
justin808 May 25, 2026
3b129f0
Tighten RSC client reference setup checks
justin808 May 25, 2026
f05bbb3
Handle shorthand RSC client references
justin808 May 25, 2026
ea674c4
Close RSC client reference migration gaps
justin808 May 25, 2026
7d77557
Close RSC client reference review gaps
justin808 May 25, 2026
b94f4f1
Clarify RSC migration rollback path
justin808 May 25, 2026
60c9d4f
Guard incomplete RSC plugin setup
justin808 May 25, 2026
fb030d5
Detect RSC plugin invocations in JS code only
justin808 May 26, 2026
e06da8e
Allow whitespace variants in RSC plugin detection
justin808 May 26, 2026
76d981c
Share RSC plugin invocation regex with partition scanner
justin808 May 26, 2026
d74e827
Dedup RSCWebpackPlugin import in injection paths
justin808 May 26, 2026
9e32584
Guard fresh inject path against existing rscClientReferences
justin808 May 26, 2026
eff6ffa
Document RSC migration verification change and clarify invariants
justin808 May 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ After a release, run `/update-changelog` in Claude Code to analyze commits, writ
- **`bin/dev` now cleans copied runtime files before startup**: When you duplicate an app directory to run another local dev stack, `bin/dev` now removes copied stale Overmind sockets and stale `tmp/pids/server.pid` files that point to a Puma process running from another app directory. This prevents false startup failures in copied workspaces while still preserving active local sockets and pid files for the current app. [PR 3142](https://github.com/shakacode/react_on_rails/pull/3142) by [justin808](https://github.com/justin808).
- **`bin/dev kill` is more thorough and Pro-aware under base-port mode**: `ServerManager.kill_processes` no longer short-circuits after the first successful step — pattern-based kills, port-based kills, and socket/pid cleanup all run unconditionally so a stale renderer port-binding or socket file cannot survive a `bin/dev kill`. In base-port mode, the derived renderer port (`base+2`) is now always included in port-based killing when `react_on_rails_pro` is loaded, even if `RENDERER_PORT` / `REACT_RENDERER_URL` are unset in the current shell (an informational message is printed so the wider scan is not silent). `ProcessManager` also now preserves the legacy `RENDERER_URL` env var alongside `REACT_RENDERER_URL` across Bundler's env reset so mid-migration users keep a consistent renderer URL in spawned subprocesses. [PR 3274](https://github.com/shakacode/react_on_rails/pull/3274) by [justin808](https://github.com/justin808).
- **CI change detection handles shallow clones with long-lived branches**: `script/ci-changes-detector` and `script/check-docs-sidebar` now resolve an actual merge base before diffing, deepening shallow `origin/main` and current-branch history as needed. `ci-changes-detector` now fails visibly when it cannot compute a safe diff instead of treating git failures as no changes. Fixes [Issue 3108](https://github.com/shakacode/react_on_rails/issues/3108). [PR 3224](https://github.com/shakacode/react_on_rails/pull/3224) by [justin808](https://github.com/justin808).
- **[Pro]** **RSC setup now scopes client-reference discovery to app source**: Generated RSC webpack configs now pass `clientReferences` based on Shakapacker's `source_path`, avoiding CI failures where the plugin could scan vendored gem templates under `vendor/bundle`. Fixes [Issue 3201](https://github.com/shakacode/react_on_rails/issues/3201). [PR 3219](https://github.com/shakacode/react_on_rails/pull/3219) by [justin808](https://github.com/justin808).
- **[Pro]** **Node renderer now exposes `performance` when `supportModules: true`**: React 19's development build of `React.lazy` calls `performance.now()`, which previously threw `ReferenceError: performance is not defined` inside the node renderer's VM context unless users manually added `performance` via `additionalContext`. `performance` is now included in the default globals alongside `Buffer`, `process`, etc. Fixes [Issue 3154](https://github.com/shakacode/react_on_rails/issues/3154). [PR 3158](https://github.com/shakacode/react_on_rails/pull/3158) by [justin808](https://github.com/justin808).
- **Scaffolded CI workflow pins a pnpm version when `packageManager` is absent**: The generated `.github/workflows/ci.yml` now emits `with: version:` for `pnpm/action-setup@v4` when pnpm is detected from `pnpm-lock.yaml` alone, preventing the setup step from failing before dependency install. When `packageManager` is declared in `package.json`, the version key is omitted so the action reads the pin from there. Note: `GeneratorMessages.detect_package_manager(package_json: nil)` now treats `nil` as "caller cached that the file is absent" and skips disk fallback, instead of re-reading `package.json`; the previous fallthrough behavior is now the default (omit the keyword) and is documented on `read_package_json`. Fixes [Issue 3172](https://github.com/shakacode/react_on_rails/issues/3172). [PR 3174](https://github.com/shakacode/react_on_rails/pull/3174) by [justin808](https://github.com/justin808).
- **Client startup now recovers if initialization begins during `interactive` after `DOMContentLoaded` already fired**: React on Rails now still initializes the page when the client bundle starts in the browser timing window after `DOMContentLoaded` but before the document reaches `complete`. Fixes [Issue 3150](https://github.com/shakacode/react_on_rails/issues/3150). [PR 3151](https://github.com/shakacode/react_on_rails/pull/3151) by [ihabadham](https://github.com/ihabadham).
Expand Down
6 changes: 5 additions & 1 deletion docs/oss/migrating/rsc-preparing-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ module.exports = {
};
Comment thread
justin808 marked this conversation as resolved.
```

> **`clientReferences`**: If omitted, the plugin defaults to scanning the entire project root recursively (`{ directory: ".", recursive: true, include: /\.(js|ts|jsx|tsx)$/ }`), which works but is slow on large codebases. Setting `directory` to your app's source directory (e.g., `'./client/app'`) limits the scan to only the files that could contain `'use client'` directives.
> **`clientReferences`**: Always point this at your application source directory. If omitted, the plugin defaults to scanning the entire project root recursively (`{ directory: ".", recursive: true, include: /\.(js|ts|jsx|tsx)$/ }`). That can accidentally discover vendored gem templates under paths such as `vendor/bundle` in CI and make webpack compile files that are not part of your app. Setting `directory` to your app's source directory (e.g., `'./client/app'`) limits the scan to only the files that could contain `'use client'` directives.

> **Generator note (CommonJS only):** The `rails generate react_on_rails:rsc` migration only rewrites webpack configs that use CommonJS (`require`-style) imports. If your config has been converted to ESM (`import`/`export`) syntax, the generator emits an "expected webpack import anchor was not found" warning and you must add `clientReferences` manually as shown above.

> **Upgrade note for apps already on RSC:** `verify_rsc_webpack_transforms` (and the `rails generate react_on_rails:rsc` doctor check) now requires that `RSCWebpackPlugin` be invoked with `clientReferences: rscClientReferences` pointing at `resolve(config.source_path)`. Existing apps that have the plugin without a scoped `clientReferences` option were previously passing verification and will now report `"generated scoped clientReferences in {client,server}WebpackConfig.js"` as a missing transform. To remediate, either (a) re-run `rails generate react_on_rails:rsc` and accept the in-place migration, or (b) manually add the helper and option as shown above — declare `const rscClientReferences = { directory: resolve(config.source_path), recursive: true, include: /\.(js|mjs|cjs|ts|mts|cts|jsx|tsx)$/ };` at module scope and pass `clientReferences: rscClientReferences` into every `RSCWebpackPlugin` invocation.

### 4c. Add RSCWebpackPlugin to the client webpack config

Expand Down
Loading
Loading