fix: address deferred review items from PR #2849#3093
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughUpdates server webpack configuration to use source maps instead of eval-based devtools, refactors browser-opening logic to distinguish explicit versus automatic opens with WSL detection, improves marker file handling, and updates related tests and documentation strings. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~28 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Overall this is a well-structured cleanup. The motivations are sound (lazy marker resolution, narrowed exception handling, WSL support, explicit-vs-auto TTY distinction). A few items worth addressing before merge. |
Greptile SummaryThis PR addresses deferred review items from #2849 by cleaning up the browser-open thread in Confidence Score: 5/5Safe to merge — all findings are P2 style suggestions with no correctness impact. All three changed files are logically correct. The thread refactor, WSL support, lazy marker path, and narrowed exception handling are all well-reasoned and pass the 93-example spec suite. The only gaps are a missing spec for the No files require special attention.
|
| Filename | Overview |
|---|---|
| react_on_rails/lib/react_on_rails/dev/server_manager.rb | Refactors browser-open thread logic: removes non-idiomatic next/report_on_exception = false, adds WSL launcher support, makes explicit bypass TTY gating for --open-browser, lazily resolves the once-marker path with Dir.pwd, and narrows socket exception rescues — all logically correct. |
| react_on_rails/spec/react_on_rails/dev/server_manager_spec.rb | Tests updated to match new signatures (adds explicit: false kwarg, stubs open_browser_once_marker method instead of stub_const); missing a spec for the --open-browser explicit-bypass path through schedule_browser_open_if_requested. |
| react_on_rails/lib/generators/react_on_rails/base_generator.rb | Corrects misleading generator note that implied Pro works without a license; replacement text accurately directs users to docs and a license before enabling Pro. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[schedule_browser_open_if_requested] --> B{open_browser or open_browser_once?}
B -- No --> Z[return]
B -- Yes --> C["explicit = open_browser && !open_browser_once"]
C --> D["schedule_browser_open(port, route, once, explicit)"]
D --> E{"browser_auto_open_allowed?(explicit)"}
E -- "explicit=true" --> G[Skip CI/TTY check → allowed]
E -- "explicit=false" --> F{"!CI && stdin.tty? && stdout.tty?"}
F -- No --> Z
F -- Yes --> G
G --> H[Thread.new]
H --> I{wait_for_app_route?}
I -- No/timeout --> Z
I -- Yes --> J[prepare_browser_open_once_marker]
J -- :already_opened --> Z
J -- :claimed/:not_requested --> K[open_browser url]
K -- success --> Z
K -- fail --> L[clear marker if claimed]
L --> M[warn user with URL]
Comments Outside Diff (1)
-
react_on_rails/spec/react_on_rails/dev/server_manager_spec.rb, line 79-84 (link)Missing spec for explicit
--open-browserpathThe spec at line 79 only verifies the
open_browser_once: truecase (which yieldsexplicit: false). There's no corresponding test checking thatopen_browser: true, open_browser_once: falsepropagatesexplicit: truetoschedule_browser_open, nor a unit test confirming thatbrowser_auto_open_allowed?(explicit: true)returnstrueeven whenCIis set or the streams are non-TTY. The explicit TTY-bypass is the core new behavior in this PR and would benefit from dedicated coverage.it "schedules an explicit browser open (bypasses TTY guard) when --open-browser is passed" do expect(described_class).to receive(:schedule_browser_open) .with(3000, route: "/", once: false, explicit: true) expect(ReactOnRails::Dev::ProcessManager).to receive(:run_with_process_manager).with("Procfile.dev") described_class.start(:development, nil, route: "/", open_browser: true) end
Reviews (1): Last reviewed commit: "fix: address deferred review items from ..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2e4efd05f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ReviewOverall this is a solid cleanup of the server manager browser-open code. The changes are well-motivated, the refactoring improves correctness (removing Must fix
Should add
Minor
Looks good
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
react_on_rails/spec/react_on_rails/dev/server_manager_spec.rb (1)
1083-1086: This no longer proves theDir.chdirregression fix.Stubbing
open_browser_once_markerkeeps the spec aligned with the new implementation, but it also stops testing the original failure mode. Please add one regression example that changes the working directory after load and asserts the marker path resolves from the new cwd.Also applies to: 1123-1123
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@react_on_rails/spec/react_on_rails/dev/server_manager_spec.rb` around lines 1083 - 1086, The current spec stubs open_browser_once_marker which masks the Dir.chdir regression; add a regression example that does not stub open_browser_once_marker but instead calls Dir.chdir to a new temporary directory after loading the class and then asserts described_class.open_browser_once_marker (or the produced marker_path) is resolved relative to the new working directory (i.e., create a temp dir, Dir.chdir into it, call the code that returns the marker path via described_class.open_browser_once_marker, and expect the returned path to start_with or equal File.join(Dir.pwd, "browser_opened_once")); apply the same change to the duplicate example area referenced around the second occurrence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@react_on_rails/spec/react_on_rails/dev/server_manager_spec.rb`:
- Around line 1083-1086: The current spec stubs open_browser_once_marker which
masks the Dir.chdir regression; add a regression example that does not stub
open_browser_once_marker but instead calls Dir.chdir to a new temporary
directory after loading the class and then asserts
described_class.open_browser_once_marker (or the produced marker_path) is
resolved relative to the new working directory (i.e., create a temp dir,
Dir.chdir into it, call the code that returns the marker path via
described_class.open_browser_once_marker, and expect the returned path to
start_with or equal File.join(Dir.pwd, "browser_opened_once")); apply the same
change to the duplicate example area referenced around the second occurrence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cf38d9e4-1460-4265-af3e-63a8736be96d
📒 Files selected for processing (8)
react_on_rails/lib/generators/react_on_rails/base_generator.rbreact_on_rails/lib/generators/react_on_rails/templates/base/base/config/webpack/serverWebpackConfig.js.ttreact_on_rails/lib/react_on_rails/dev/server_manager.rbreact_on_rails/spec/dummy/config/webpack/serverWebpackConfig.jsreact_on_rails/spec/react_on_rails/dev/server_manager_spec.rbreact_on_rails/spec/react_on_rails/support/generator_spec_helper.rbreact_on_rails_pro/spec/dummy/config/webpack/serverWebpackConfig.jsreact_on_rails_pro/spec/execjs-compatible-dummy/config/webpack/serverWebpackConfig.js
size-limit report 📦
|
|
Overall this is a solid set of fixes. The webpack 5.106+ regression fix, WSL browser support, narrowed exception handling, and generator copy update are all well-reasoned. See inline comments for specifics. |
Review feedback addressed in 1f04d40Fixed (5 items):
Declined with rationale (4 items):
All 12 review threads resolved. 104 specs passing, RuboCop clean. |
Review: fix: address deferred review items from PR #2849Overall this is a solid, well-reasoned set of fixes. The refactors are well-motivated and the test additions are thorough. A few targeted notes below. What works well
Issues (inline comments posted)
Minor / non-blocking
|
Review feedback addressed in 73b9415Fixed (2 items):
Declined with rationale (6 items):
All 8 review threads resolved. |
| schedule_browser_open(procfile_port(procfile), route: route, once: open_browser_once) | ||
| # --open-browser is an explicit user request and bypasses TTY gating. | ||
| # --open-browser-once is an auto-open and respects TTY/CI guards. | ||
| explicit = open_browser && !open_browser_once |
There was a problem hiding this comment.
When both open_browser: true and open_browser_once: true are supplied simultaneously (unusual, but possible through layered CLI option parsing), explicit evaluates to false and the TTY/CI guard is silently applied — the --open-browser-once semantics win. This is probably the right conservative choice, but the comment above only describes the individual flags, not this combined case.
Consider a one-line note or an early guard:
| explicit = open_browser && !open_browser_once | |
| # --open-browser is an explicit user request and bypasses TTY gating. | |
| # --open-browser-once is an auto-open and respects TTY/CI guards. | |
| # If both are passed, --open-browser-once semantics win (explicit = false). | |
| explicit = open_browser && !open_browser_once |
| # WSL_DISTRO_NAME is the authoritative indicator (set by the WSL kernel). | ||
| # WSLENV is a weaker signal — it can appear in non-WSL contexts (e.g. Docker | ||
| # images that inherit a Windows host env) but is included as a fallback. | ||
| ENV.key?("WSL_DISTRO_NAME") || ENV.key?("WSLENV") |
There was a problem hiding this comment.
The WSLENV false-positive is well-explained in the comment. One downstream consequence worth noting: if a Docker container inherits WSLENV from a Windows host (and --open-browser is used explicitly so the TTY guard is bypassed), wsl? returns true, wslview/wsl-open won't be found, and control falls through to xdg-open. If that also fails, the hint message reads "On WSL, install wslu…" — which is misleading for someone in Docker.
One option is to differentiate the hint based on WSL_DISTRO_NAME (authoritative) vs. the fallback WSLENV:
def authoritative_wsl?
ENV.key?("WSL_DISTRO_NAME")
end…and use that for the hint while keeping the broader wsl? for the launcher-preference order. Low priority given the narrow trigger conditions, but flagging for awareness.
| # which checks both NODE_ENV and RAILS_ENV. Checking NODE_ENV here surfaces | ||
| # misconfigurations (e.g. NODE_ENV=production + RAILS_ENV=development) at Rails boot | ||
| # time rather than waiting for the Node renderer to reject the request. | ||
| runtime_envs = [ENV.fetch("RAILS_ENV", nil), ENV.fetch("NODE_ENV", nil)].compact_blank.map(&:downcase) |
There was a problem hiding this comment.
Good use of compact_blank over compact — it correctly treats RAILS_ENV="" as unset rather than passing an empty string through to downcase and matching nothing. One note: the allowed_envs local freeze is harmless but unnecessary (the %w[] literal creates a new array every call; freezing it doesn't gain anything here since it's not stored). Minor style nit, not worth changing on its own.
| # time rather than waiting for the Node renderer to reject the request. | ||
| runtime_envs = [ENV.fetch("RAILS_ENV", nil), ENV.fetch("NODE_ENV", nil)].compact_blank.map(&:downcase) | ||
| allowed_envs = %w[development test].freeze | ||
| return if runtime_envs.any? && runtime_envs.all? { |e| allowed_envs.include?(e) } |
There was a problem hiding this comment.
The condition runtime_envs.any? && runtime_envs.all? { ... } is correct: an empty array (both envs unset) falls through to raise, matching the "fail-closed" spec. One edge case worth a spec: RAILS_ENV=test, NODE_ENV=staging — one allowed, one not. all? returns false → raises. That's the right call, but it might surprise someone who expected RAILS_ENV=test to be enough. The new test matrix in the error message covers this with the "(mixed envs)" row, so documentation is already there.
|
Review posted via inline comments. See discussion threads on server_manager.rb lines 864 and 1004, and configuration.rb lines 277 and 279 for specific observations. Overall the PR is well-structured with no blocking issues. |
Server manager browser-open improvements: - Refactor Thread.new block: remove non-idiomatic `next`, remove `report_on_exception = false` that suppressed genuine crashes - Add WSL browser support: detect WSL_DISTRO_NAME/WSLENV and try wslview/wsl-open before falling back to xdg-open - Warn user when no browser launcher is found (with WSL-specific hint) - Let explicit --open-browser bypass TTY/CI guard since the developer deliberately requested it; auto-opens still respect the guard - Resolve marker-file path lazily at call time instead of at constant-definition time to avoid wrong path when required before chdir into Rails root - Narrow rescued exceptions in http_get_localhost from broad StandardError to specific socket/connection error classes Generator fix: - Update misleading Pro note that said Pro works "without a license" (Pro raises on boot without one) Closes #2880 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…ck 5.106.0 regression webpack 5.106.0 introduced a regression where the 'eval' devtool causes "ReferenceError: __WEBPACK_DEFAULT_EXPORT__ is not defined" when bundling ESM modules with default exports for server-side rendering via ExecJS. Switch from 'eval' to 'cheap-module-source-map' which provides original line numbers in SSR error traces without using eval(). This affects the generator template, spec dummy apps, and the generator spec helper. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add EOFError, Errno::EPIPE, and Errno::EAFNOSUPPORT to LOCALHOST_CONNECT_ERRORS to prevent polling thread crash on transient boot-time errors (previously caught by broad rescue StandardError) - Fix double warning when no browser launcher is found by consolidating messages into the caller with WSL hint - Add comment clarifying WSLENV is a weaker WSL signal than WSL_DISTRO_NAME - Add spec coverage for explicit: true path (--open-browser bypasses TTY/CI gating) - Add spec coverage for WSL detection and linux_browser_command fallback ordering Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Use ENV.key?("WSL_DISTRO_NAME") instead of wsl? for WSL install hint
to avoid false-positive advice in Docker-in-WSL containers where
WSLENV is inherited from the Windows host
- Add xdg-open to the WSL hint since it works on WSLg environments
- Add install guidance for non-WSL Linux when no browser launcher found
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Use wsl? helper for WSL hint instead of raw ENV check, so WSLENV-only environments also see the WSL install guidance - Consolidate duplicate browser warnings: remove early warning from linux_browser_command and enrich the single diagnostic in schedule_browser_open with platform-specific install hints - Fix test ENV["CI"] cleanup to restore original value using around block instead of unconditionally deleting (matches existing WSL test pattern) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Initialize `saved = {}` before ENV.to_h.slice in WSL detection spec
to prevent NameError if the ensure block runs before assignment
- Scope cheap-module-source-map devtool to development only; disable
devtool in production to avoid generating .map files while still
avoiding the webpack 5.106+ eval regression in all environments
- Use regex matcher in browser-open warning spec to handle
platform-specific hint text on Linux CI
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
73b9415 to
2929a8b
Compare
Code ReviewOverall this is a clean, well-structured PR. The changes are well-scoped, the test coverage is solid, and the reasoning in the PR description and inline comments is clear. A few observations worth addressing: Substantive items
In
The lazy
The code comment already calls this out. Worth noting: the false-positive path (Docker-on-Windows with Minor items
|
| schedule_browser_open(procfile_port(procfile), route: route, once: open_browser_once) | ||
| # --open-browser is an explicit user request and bypasses TTY gating. | ||
| # --open-browser-once is an auto-open and respects TTY/CI guards. | ||
| explicit = open_browser && !open_browser_once |
There was a problem hiding this comment.
When both --open-browser and --open-browser-once are passed together, explicit becomes false (true && !true), so the TTY/CI guard is respected even though the user explicitly passed --open-browser. The once-semantics silently wins. This is likely the intended behaviour, but a comment here would make it explicit:
| explicit = open_browser && !open_browser_once | |
| explicit = open_browser && !open_browser_once | |
| # Note: when both flags are set, once-semantics takes precedence and the | |
| # TTY/CI guard is respected (explicit is false). This is intentional. |
Alternatively, consider emitting a warning if both flags are supplied so the user knows which behaviour they get.
|
|
||
| # Resolved lazily at call time so the path is correct even when this file | ||
| # is required before the process has chdir'd into the Rails app root. | ||
| def open_browser_once_marker |
There was a problem hiding this comment.
Dir.pwd is evaluated freshly on each call, which means prepare_browser_open_once_marker and clear_browser_open_once_marker_if_claimed may resolve to different absolute paths if Dir.pwd is mutated between calls (unlikely in production, but possible in concurrent test runs). The Errno::ENOENT rescue makes this safe, but it silently leaves the marker file behind in that edge case.
Consider capturing the path once before the thread enters the wait loop and passing it through:
# In schedule_browser_open, before Thread.new:
marker_path = open_browser_once_marker
Thread.new do
# … use marker_path directly instead of calling open_browser_once_marker
endThis keeps the lazy-resolution benefit (path is correct at spawn time, not at class-load time) while avoiding the double evaluation.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
| schedule_browser_open(procfile_port(procfile), route: route, once: open_browser_once) | ||
| # --open-browser is an explicit user request and bypasses TTY gating. | ||
| # --open-browser-once is an auto-open and respects TTY/CI guards. | ||
| explicit = open_browser && !open_browser_once |
There was a problem hiding this comment.
Edge case: when both open_browser: true and open_browser_once: true are passed together, explicit evaluates to false and TTY/CI guards apply — even though the user explicitly requested a browser open with --open-browser. If these flags are intended to be mutually exclusive at the CLI level this is fine, but it's worth adding a guard or a comment clarifying that assumption.
| explicit = open_browser && !open_browser_once | |
| explicit = open_browser && !open_browser_once | |
| # Note: passing both --open-browser and --open-browser-once simultaneously | |
| # is not a supported combination; --open-browser-once takes precedence. |
| # WSL_DISTRO_NAME is the authoritative indicator (set by the WSL kernel). | ||
| # WSLENV is a weaker signal — it can appear in non-WSL contexts (e.g. Docker | ||
| # images that inherit a Windows host env) but is included as a fallback. | ||
| ENV.key?("WSL_DISTRO_NAME") || ENV.key?("WSLENV") |
There was a problem hiding this comment.
The comment here acknowledges the risk correctly, but there's a downstream UX consequence worth noting: when WSLENV is set in a non-WSL Linux context (e.g. a Docker container inheriting a Windows host env) and no browser launcher is found, the user receives the WSL-specific hint ("On WSL, install wslu…") rather than the Linux hint ("Install xdg-utils…"). This is misleading.
Consider only relying on WSL_DISTRO_NAME (the authoritative kernel-set indicator) and dropping WSLENV as a fallback, or at least checking that wslview/wsl-open are actually available before treating the environment as WSL in the error path.
| end | ||
|
|
||
| describe "WSL detection" do | ||
| saved = {} |
There was a problem hiding this comment.
The saved = {} at the describe block level is dead code — it's immediately overwritten by the saved = {} assignment at the start of the around block (Ruby blocks are closures, so the outer variable is mutated). The describe-level initialiser can be removed.
| saved = {} | |
| describe "WSL detection" do |
| files = Dir.children(template_bin_path).reject { |filename| filename == "dev" } | ||
| files << "dev" unless preserve_existing_bin_dev? | ||
| files.map { |filename| "bin/#{filename}" } | ||
| files.map { |filename| File.join(destination_root, "bin/#{filename}") } |
There was a problem hiding this comment.
Minor style nit: prefer passing path components as separate arguments to File.join so the intent is clearer and interpolation isn't needed.
| files.map { |filename| File.join(destination_root, "bin/#{filename}") } | |
| files.map { |filename| File.join(destination_root, "bin", filename) } |
Review summaryOverall this is a solid, well-motivated set of changes. The refactoring is clear, the new tests are thorough, and the webpack devtool fix addresses a real regression. A few items worth addressing: Medium
Low
Positive notes
|
…ages * origin/main: Fix initial page startup race for late-loading client bundles (#3151) chore: apply prettier formatting to tracked docs files (#3153) docs: comprehensive RSC API documentation and registration consolidation (#3140) Split rspec-package-tests into parallel generator/unit shards (#3134) fix: add concurrency groups to long-running CI workflows (#3133) refactor: add RenderRequest, JsCodeBuilder, and RenderingStrategy abstractions (#3094) fix: address deferred review items from PR #2849 (#3093) Add complimentary OSS license policy for React on Rails Pro (#3123) fix: centralize CI docs-only detection and add CLI flag validation (#3091) refactor: replace stub-throw + Object.assign with capability-based composition (#3096) Enhance address-review with parallel fixes, self-review, and Greptile verification (#3121) fix: Doctor no longer fails custom projects for missing bin/dev (#3117) fix: cap webpack <5.106.0 to prevent ExecJS SSR breakage (#3095) Add Rspack + RSC compatibility tests and documentation (#1828) (#3120) Add error scenarios hub and test pages (#2497) docs: document polyfill requirements for web-targeted server bundles (#3092) docs: RSC integration pitfalls from tutorial app (#3087) docs: fix render function/helper API documentation (#3088) Doctor: accept TS/TSX server bundle suffixes (#3111) feat: add CI guard requiring sidebar updates when adding docs (#3089)
## Summary - Refactor server manager browser-open: remove non-idiomatic `next` in Thread.new, remove `report_on_exception = false` that suppressed genuine crashes, add WSL browser support (wslview/wsl-open), let explicit `--open-browser` bypass TTY guard, resolve marker path lazily, narrow rescued socket exceptions - Fix misleading Pro note that said Pro works "without a license" ## Details ### Server manager (`server_manager.rb`) - **Thread.new refactor**: Replaced `next` (non-idiomatic in Thread.new) with standard conditionals; removed `report_on_exception = false` so genuine crashes surface in development - **WSL support**: Detects WSL via `WSL_DISTRO_NAME`/`WSLENV` env vars and tries `wslview`/`wsl-open` before `xdg-open` - **Platform diagnostic**: Warns user when no browser launcher is found (with WSL-specific install hint) - **Explicit vs auto-open TTY gating**: `--open-browser` (deliberate user request) now bypasses TTY/CI guard; `--open-browser-once` (auto-open) still respects it - **Lazy marker path**: Replaced `OPEN_BROWSER_ONCE_MARKER` constant (resolved at class-load time) with `open_browser_once_marker` method (resolved at call time) to avoid wrong path when file is required before chdir into Rails root - **Narrowed exception handling**: `http_get_localhost` now rescues specific socket/connection errors instead of broad `StandardError` ### Generator (`base_generator.rb`) - Updated `home_page_pro_note_for_oss_app` to not claim Pro works "without a license" (Pro raises on boot when unlicensed) Closes #2880 ## Test plan - [x] `bundle exec rspec spec/react_on_rails/dev/server_manager_spec.rb` — 93 examples, 0 failures - [x] `bundle exec rspec spec/react_on_rails/generators/install_generator_spec.rb:73` — passes - [x] `bundle exec rubocop` on all changed files — no offenses - [ ] Verify WSL browser detection in WSL environment - [ ] Verify `--open-browser` works in non-TTY context (e.g., Docker) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes development process management and SSR webpack configuration, which can affect local workflows and server-bundle debugging/stack traces across platforms. > > **Overview** > **Stabilizes development ergonomics across environments.** `ServerManager` browser auto-open was refactored to distinguish explicit `--open-browser` from guarded auto-open (`--open-browser-once`), add WSL launcher support (`wslview`/`wsl-open`), improve failure warnings, lazily resolve the once-marker path, and narrow localhost polling exception handling. > > **Avoids a webpack 5.106+ SSR regression.** Server webpack configs switch away from `devtool = 'eval'` to `cheap-module-source-map` in development (and `false` in production) to prevent ESM default-export issues and improve SSR stack trace mapping. > > Also updates generator messaging to remove the claim that Pro can be evaluated without a license, fixes generator `chmod` to use `destination_root`, adds `.playwright-cli/` to `.gitignore`, and adds a Jest assertion ensuring `scriptSanitizedVal` keeps a stable function name for webpack compatibility. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bd84af3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed server-side rendering (SSR) error stack traces to accurately map line numbers by updating source map configuration. * Improved browser auto-open functionality on WSL systems with better launcher detection and fallback handling. * **Documentation** * Updated Pro licensing guidance to clarify users must review upgrade documentation and obtain proper licenses before enabling Pro features. * **Tests** * Added test coverage for function naming stability and browser auto-open behavior across different environments. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Summary
nextin Thread.new, removereport_on_exception = falsethat suppressed genuine crashes, add WSL browser support (wslview/wsl-open), let explicit--open-browserbypass TTY guard, resolve marker path lazily, narrow rescued socket exceptionsDetails
Server manager (
server_manager.rb)next(non-idiomatic in Thread.new) with standard conditionals; removedreport_on_exception = falseso genuine crashes surface in developmentWSL_DISTRO_NAME/WSLENVenv vars and trieswslview/wsl-openbeforexdg-open--open-browser(deliberate user request) now bypasses TTY/CI guard;--open-browser-once(auto-open) still respects itOPEN_BROWSER_ONCE_MARKERconstant (resolved at class-load time) withopen_browser_once_markermethod (resolved at call time) to avoid wrong path when file is required before chdir into Rails roothttp_get_localhostnow rescues specific socket/connection errors instead of broadStandardErrorGenerator (
base_generator.rb)home_page_pro_note_for_oss_appto not claim Pro works "without a license" (Pro raises on boot when unlicensed)Closes #2880
Test plan
bundle exec rspec spec/react_on_rails/dev/server_manager_spec.rb— 93 examples, 0 failuresbundle exec rspec spec/react_on_rails/generators/install_generator_spec.rb:73— passesbundle exec rubocopon all changed files — no offenses--open-browserworks in non-TTY context (e.g., Docker)🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes development process management and SSR webpack configuration, which can affect local workflows and server-bundle debugging/stack traces across platforms.
Overview
Stabilizes development ergonomics across environments.
ServerManagerbrowser auto-open was refactored to distinguish explicit--open-browserfrom guarded auto-open (--open-browser-once), add WSL launcher support (wslview/wsl-open), improve failure warnings, lazily resolve the once-marker path, and narrow localhost polling exception handling.Avoids a webpack 5.106+ SSR regression. Server webpack configs switch away from
devtool = 'eval'tocheap-module-source-mapin development (andfalsein production) to prevent ESM default-export issues and improve SSR stack trace mapping.Also updates generator messaging to remove the claim that Pro can be evaluated without a license, fixes generator
chmodto usedestination_root, adds.playwright-cli/to.gitignore, and adds a Jest assertion ensuringscriptSanitizedValkeeps a stable function name for webpack compatibility.Reviewed by Cursor Bugbot for commit bd84af3. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests