Skip to content

docs: clarify railsContext.rorPro semantics#2590

Merged
justin808 merged 15 commits intomasterfrom
jg-codex/fix-2453-clarify-rorpro
Mar 13, 2026
Merged

docs: clarify railsContext.rorPro semantics#2590
justin808 merged 15 commits intomasterfrom
jg-codex/fix-2453-clarify-rorpro

Conversation

@justin808
Copy link
Copy Markdown
Member

@justin808 justin808 commented Mar 11, 2026

Summary

  • clarify in Ruby and TypeScript that railsContext.rorPro signals Pro installation, not license validity
  • rename a local variable in ClientSideRenderer from hasProLicense to hasProGemInstalled for semantic accuracy
  • update OSS and Pro docs to reflect the same meaning

Fixes #2453

Test Plan

  • bundle exec rubocop react_on_rails/lib/react_on_rails/utils.rb react_on_rails/lib/react_on_rails/helper.rb
  • pnpm run eslint packages/react-on-rails-pro/src/ClientSideRenderer.ts packages/react-on-rails/src/types/index.ts

Note

Low Risk
Low risk documentation/comment and naming clarification; runtime behavior is unchanged aside from a local variable rename used in immediate hydration gating.

Overview
Clarifies across OSS docs, Pro licensing docs, Ruby rails_context construction, and the TS RailsContext type that railsContext.rorPro is only a signal that the Pro gem/package is installed, not that a license token is valid.

Renames the client-side immediate hydration gating variable in ClientSideRenderer from hasProLicense to hasProGemInstalled (with an explanatory comment) to match the updated semantics.

Written by Cursor Bugbot for commit 15978ab. Configure here.

Summary by CodeRabbit

  • Documentation
    • Clarified that the rorPro signal denotes server-side Pro gem installation (not license validity) and updated docs and license guidance.
  • New Features
    • Client runtime now recognizes a Pro-installed signal from the server and updates installation-related warnings and messaging accordingly.
  • Tests
    • Updated test descriptions and expectations to reference Pro gem installation instead of a Pro license.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 11, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Clarifies that railsContext.rorPro signals the React on Rails Pro gem is installed (not that a Pro license is validated). Changes update docs, type defs, client variable naming and warnings, Ruby utils/messages, and tests; no runtime control-flow or license-validation behavior changed.

Changes

Cohort / File(s) Summary
Documentation
docs/oss/core-concepts/render-functions-and-railscontext.md, react_on_rails_pro/LICENSE_SETUP.md
Wording and headers updated to state railsContext.rorPro indicates Pro gem installation (not license validity); added note that the browser package does not perform independent license validation.
Type Definitions
packages/react-on-rails/src/types/index.ts
Added rorPro: boolean to RailsContext with comments clarifying it reflects Pro gem installation rather than license validation.
Client-side
packages/react-on-rails-pro/src/ClientSideRenderer.ts
Renamed local boolean hasProLicensehasProInstalled; updated comments and immediate-hydration warning text to reference Pro gem installation. No control-flow changes.
Ruby — Helpers & Utils
react_on_rails/lib/react_on_rails/helper.rb, react_on_rails/lib/react_on_rails/utils.rb
Added/clarified comment above rorPro in Rails context; renamed immediate_hydration_pro_license_warningimmediate_hydration_pro_install_warning and adjusted messages/comments to emphasize gem presence checks (license validity remains unchecked).
Tests
react_on_rails/spec/dummy/spec/helpers/react_on_rails_helper_spec.rb, react_on_rails/spec/react_on_rails/react_component/render_options_spec.rb, react_on_rails/spec/react_on_rails/utils_spec.rb
Updated test contexts, descriptions, and expected warning strings to reference the Pro gem being installed (text-only expectations changes).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through docs and code so spry,
"Pro installed" I whisper, not a license lie.
A tiny rename, a clearer sign,
Signals snug as carrots in a line,
I thump for clarity — bright and spry 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: clarifying that railsContext.rorPro indicates Pro gem installation, not license validity.
Linked Issues check ✅ Passed All code changes directly address issue #2453: clarifying rorPro semantics, renaming hasProLicense to hasProInstalled, and updating documentation and comments throughout.
Out of Scope Changes check ✅ Passed All changes are scoped to clarifying rorPro semantics and renaming related variables; no unrelated modifications detected.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jg-codex/fix-2453-clarify-rorpro
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 11, 2026

Greptile Summary

This PR is a pure semantics/documentation clarification: railsContext.rorPro signals that the React on Rails Pro gem is installed, not that a license token is valid. The change is propagated consistently across Ruby source comments, TypeScript type definitions, a local variable rename in ClientSideRenderer.ts, and two documentation files.

Key changes:

  • react_on_rails/lib/react_on_rails/utils.rb: Consolidates a confusingly duplicated (and partially contradictory) comment on react_on_rails_pro? into a single, accurate description.
  • packages/react-on-rails/src/types/index.ts: Adds a two-line clarifying comment above rorPro: boolean in RailsContext.
  • packages/react-on-rails-pro/src/ClientSideRenderer.ts: Renames local variable hasProLicensehasProInstalled; however, the adjacent comment on line 105 still reads "without Pro license" and was not updated to match the new semantics.
  • react_on_rails_pro/LICENSE_SETUP.md: Updates the "License Validation" list to state the browser package receives a Pro-installed signal — but the section heading still implies all three items perform license validation, creating a minor inconsistency.

Confidence Score: 5/5

  • This PR is safe to merge — it contains no logic changes, only comment/documentation clarifications and a local variable rename.
  • All changes are non-functional: comments, documentation, and a local variable rename with no exported API impact. No tests need updating, no behavior is altered. Two minor style inconsistencies remain (a stale comment and a misleading section heading in the docs) but neither blocks correctness.
  • No files require special attention; minor wording follow-ups in packages/react-on-rails-pro/src/ClientSideRenderer.ts (line 105) and react_on_rails_pro/LICENSE_SETUP.md (line 84) are the only items worth addressing before merge.

Important Files Changed

Filename Overview
packages/react-on-rails-pro/src/ClientSideRenderer.ts Renames local variable hasProLicensehasProInstalled and adds a clarifying comment; one stale comment ("without Pro license") remains inconsistent with the new semantics.
packages/react-on-rails/src/types/index.ts Adds two clarifying JSDoc-style comments above the rorPro field in the RailsContext type explaining it signals installation, not license validity. No functional change.
react_on_rails/lib/react_on_rails/utils.rb Consolidates a confusingly duplicated and contradictory method comment into a single, accurate description ("checks gem presence only, not license validity"). No logic change.
react_on_rails/lib/react_on_rails/helper.rb Adds an inline comment clarifying the semantic meaning of the rorPro key in the Rails context hash. No logic change.
docs/oss/core-concepts/render-functions-and-railscontext.md Adds an inline comment in the railsContext example snippet clarifying that rorPro signals package installation, not license validity.
react_on_rails_pro/LICENSE_SETUP.md Updates item 3 in the "License Validation" list to reflect that the browser package receives a Pro-installed signal rather than performing license validation; minor semantic inconsistency remains between the section heading and item 3.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Rails Server] -->|"react_on_rails_pro? (gem presence check)"| B{Pro gem installed?}
    B -- Yes --> C["rorPro: true\n(installation signal only)"]
    B -- No --> D["rorPro: false"]
    C --> E[railsContext serialized to client]
    D --> E
    E --> F[Browser: ClientSideRenderer]
    F --> G{isImmediateHydrationRequested\n&& !hasProInstalled?}
    G -- Yes --> H[console.warn + fallback to standard hydration]
    G -- No --> I[Normal hydration / rendering flow]

    style C fill:#d4edda,stroke:#28a745
    style D fill:#f8d7da,stroke:#dc3545
    style H fill:#fff3cd,stroke:#ffc107
Loading

Last reviewed commit: 15978ab

Comment thread packages/react-on-rails-pro/src/ClientSideRenderer.ts Outdated
Comment thread react_on_rails_pro/LICENSE_SETUP.md
Comment thread packages/react-on-rails-pro/src/ClientSideRenderer.ts Outdated
Comment thread packages/react-on-rails/src/types/index.ts Outdated
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 11, 2026

Overall this is a clean, well-scoped clarification. The rename of hasProLicensehasProInstalled and the comment consolidation in utils.rb are the most valuable changes. A couple of small nits:

  1. Stale comment in ClientSideRenderer.ts (inline): The // Handle immediate_hydration feature usage without Pro license comment on line 105 wasn't updated alongside the variable rename, so it still says "license" instead of "installed."

  2. Slight ambiguity in types/index.ts (inline): // This is not a signal that the current license token is valid can be read as "rorPro carries no meaningful signal" rather than "it signals installation, not license state." Suggested rewording in the inline comment.

  3. LICENSE_SETUP.md section context (nit, no inline needed): The entry sits under a ## License Validation heading but now explicitly calls out that rorPro is not a license-validation mechanism. Worth keeping in mind — if the section is ever restructured, this bullet would fit better under a "Pro detection" heading. Not a blocker.

Otherwise LGTM — no runtime behaviour is changed, and the semantics are now accurately documented across Ruby, TypeScript, and docs.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 11, 2026

size-limit report 📦

Path Size
react-on-rails/client bundled (gzip) 62.63 KB (0%)
react-on-rails/client bundled (gzip) (time) 62.63 KB (0%)
react-on-rails/client bundled (brotli) 53.74 KB (0%)
react-on-rails/client bundled (brotli) (time) 53.74 KB (0%)
react-on-rails-pro/client bundled (gzip) 63.65 KB (+0.04% 🔺)
react-on-rails-pro/client bundled (gzip) (time) 63.65 KB (+0.04% 🔺)
react-on-rails-pro/client bundled (brotli) 54.68 KB (+0.11% 🔺)
react-on-rails-pro/client bundled (brotli) (time) 54.68 KB (+0.11% 🔺)
registerServerComponent/client bundled (gzip) 127.46 KB (+0.02% 🔺)
registerServerComponent/client bundled (gzip) (time) 127.46 KB (+0.02% 🔺)
registerServerComponent/client bundled (brotli) 61.64 KB (+0.07% 🔺)
registerServerComponent/client bundled (brotli) (time) 61.64 KB (+0.07% 🔺)
wrapServerComponentRenderer/client bundled (gzip) 122.02 KB (0%)
wrapServerComponentRenderer/client bundled (gzip) (time) 122.02 KB (0%)
wrapServerComponentRenderer/client bundled (brotli) 56.77 KB (0%)
wrapServerComponentRenderer/client bundled (brotli) (time) 56.77 KB (0%)

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 11, 2026

This is a clean, well-scoped documentation and naming clarification with no runtime behavior changes. Critical fix in utils.rb: the old comment block was self-contradictory — the first line said 'Checks if React on Rails Pro is installed and licensed' while the next two lines contradicted it. The new consolidated comment is accurate. The variable rename (hasProLicense to hasProInstalled) is semantically correct, and the TypeScript type comment clearly states both what the field means and what it does not mean. Changes are consistent across Ruby, TypeScript, and docs. Minor nit: the comment added in render-functions-and-railscontext.md uses terse phrasing ('Pro package installed (not license-valid state)') — something like 'True if the React on Rails Pro gem is installed (not a license-validity check)' would be slightly clearer for docs readers. Overall, worthwhile fix for a genuine semantic confusion.

Comment thread react_on_rails/lib/react_on_rails/utils.rb
Comment thread docs/oss/core-concepts/render-functions-and-railscontext.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@react_on_rails/lib/react_on_rails/utils.rb`:
- Around line 254-258: The predicate react_on_rails_pro? is now defined as an
install-only signal, so update any messaging and docstrings that treat it as a
license check: revise the warning method immediate_hydration_pro_license_warning
and the docs/comments for normalize_immediate_hydration to refer to "Pro gem
installed" or "Pro gem presence" rather than "valid license" or "license check",
and ensure the text emitted by immediate_hydration_pro_license_warning reflects
installation status (e.g., suggests installing/uninstalling the Pro gem) and not
license validity; keep the predicate implementation unchanged but make the
string literals and method comments consistent with the install-only meaning.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74b9bec9-6e5b-4973-838c-5d6e28d8e520

📥 Commits

Reviewing files that changed from the base of the PR and between aff3b88 and a72632f.

📒 Files selected for processing (6)
  • docs/oss/core-concepts/render-functions-and-railscontext.md
  • packages/react-on-rails-pro/src/ClientSideRenderer.ts
  • packages/react-on-rails/src/types/index.ts
  • react_on_rails/lib/react_on_rails/helper.rb
  • react_on_rails/lib/react_on_rails/utils.rb
  • react_on_rails_pro/LICENSE_SETUP.md

Comment thread react_on_rails/lib/react_on_rails/utils.rb
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 12, 2026

Review

Overall this is a clean, low-risk documentation/naming clarification. One issue will break CI and a few minor nits are worth addressing.


Bug: test spec regex no longer matches the renamed warning message

react_on_rails/spec/react_on_rails/utils_spec.rb line 1050 still expects the old text:

.with(/immediate_hydration: true requires a React on Rails Pro license/)

But the renamed method in utils.rb now produces:

immediate_hydration: true requires the React on Rails Pro gem to be installed

These strings do not match, so this spec will fail on CI. The fix is to update the matcher to:

.with(/immediate_hydration: true requires the React on Rails Pro gem to be installed/)

Minor: spec context labels are semantically stale

The two describe blocks at lines 1014 and 1043 of utils_spec.rb are still labelled "with Pro license" and "without Pro license". Updating them to "with Pro installed" / "without Pro installed" would keep them consistent with the rest of the PR.


Minor: comment placement in helper.rb

The new comment was inserted before the existing TODO, separating the TODO from the field it refers to. Suggest placing it after the TODO, or consolidating both into a single comment block.


The rename itself and all docs/type updates look accurate and consistent.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 12, 2026

PR Review: docs: clarify railsContext.rorPro semantics

Overall Assessment: This is a well-scoped, low-risk documentation and naming clarification. The intent — distinguishing "Pro is installed" from "license is valid" — is correct and the changes are consistently applied across Ruby, TypeScript types, tests, and documentation.

What's done well:

  • The old immediate_hydration_pro_license_warning method name is fully replaced by immediate_hydration_pro_install_warning with no missed references in the codebase.
  • Test expectations are updated to match the new warning text string.
  • The TypeScript type comment addition in RailsContext is clear and accurate.
  • LICENSE_SETUP.md section update correctly clarifies the browser package behavior.

One inconsistency to address:
The IMMEDIATE_HYDRATION_PRO_WARNING constant in ClientSideRenderer.ts (lines 31–33) still uses "license" language — "requires a React on Rails Pro license" and "to get a license". This constant is emitted precisely when hasProInstalled is false (i.e., Pro is not installed), so the message directly contradicts the semantic clarification introduced elsewhere in this PR. The message should be updated to say something like "requires the React on Rails Pro package to be installed" for consistency.

No other issues found.

Comment thread packages/react-on-rails-pro/src/ClientSideRenderer.ts
@justin808
Copy link
Copy Markdown
Member Author

Updated to align with package-install semantics (no license-validity wording).

@justin808
Copy link
Copy Markdown
Member Author

Updated the immediate_hydration warning text to describe Pro package installation requirements (instead of license-validity wording).

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 12, 2026

Review

The intent of this PR is clear and the direction is correct. The test updates are thorough and consistent. A couple of things worth addressing:

1. Potentially confusing warning message in ClientSideRenderer.ts

The updated warning says the 'immediate_hydration' feature requires the React on Rails Pro package to be installed. But this warning fires when railsContext.rorPro is false, meaning the server-side Ruby gem is not installed. The file emitting the warning is itself inside the react-on-rails-pro JS package, so the package clearly IS installed from the user's perspective. The Ruby-side warning in utils.rb correctly says 'gem'. The TS message should be aligned, e.g.: 'requires the React on Rails Pro gem to be installed on the server.'

2. Comment ordering in helper.rb

The new comment is inserted between the rorVersion line and an existing TODO. The TODO is specifically about rorPro (replace boolean with version string in v13). Having the new explanatory comment sandwiched between them makes the TODO look like a continuation of the new comment. Moving the new comment after the TODO, or merging them, would read more naturally.

3. CHANGELOG

This PR renames a public-facing Ruby method (immediate_hydration_pro_license_warning to immediate_hydration_pro_install_warning) and changes warning message strings that third-party code might match against. A brief entry under [Unreleased] > Changed would be helpful.

Comment thread packages/react-on-rails-pro/src/ClientSideRenderer.ts
Comment thread react_on_rails/lib/react_on_rails/helper.rb Outdated
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 12, 2026

Overall: Clean, low-risk docs/naming clarification — no behavior change, all call sites updated, tests aligned. Three minor points: (1) URL inconsistency — Ruby warning uses www.shakacode.com/react-on-rails-pro/ while TypeScript uses shakacode.com/react-on-rails-pro (both touched in this PR, easy to align). (2) immediate_hydration_pro_install_warning is a module-level self. method so technically public — consider private_class_method since it is an internal helper. (3) No CHANGELOG entry — the renamed public Ruby method and updated user-visible warning text arguably merit a short Unreleased entry per project conventions.

Comment thread react_on_rails/lib/react_on_rails/utils.rb
Comment thread react_on_rails/lib/react_on_rails/utils.rb
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 12, 2026

Review: docs: clarify railsContext.rorPro semantics

Overall: This is a clean, well-scoped documentation and semantic-clarity PR. The changes are low-risk (no behavioral changes, only comment/warning-text/local-variable updates), and the naming alignment across Ruby and TypeScript is a clear improvement.

A few small observations:

Backward-compatible alias (immediate_hydration_pro_license_warning)

The alias is preserved in utils.rb, which is a good safety net — but a quick search shows the old method name has no external callers in the codebase (only the alias definition itself and the new test for it). If this method is considered internal API, the alias adds maintenance surface without real benefit. If it is kept (e.g. for downstream gems or private forks), a @deprecated YARD tag would guide callers toward the new name before it's eventually removed.

rorProVersion comment placement

The new comment on rorProVersion in types/index.ts is helpful and accurate. One micro-nit: the comment sits between two closely related fields (rorPro / rorProVersion), so placing both comments above rorPro (and making the relationship explicit there) would read more naturally — though this is purely stylistic.

Tests

The new test for the backward-compat alias (utils_spec.rb:1013–1020) validates the return-value equality, which is correct. It would be marginally stronger to verify the delegation with expect(described_class).to receive(:immediate_hydration_pro_install_warning)..., but given the simplicity of the alias the current approach is fine.

All CI test updates match the new warning text correctly. No security, performance, or correctness issues found.

# Backward-compatible alias for callers using the prior method name.
def self.immediate_hydration_pro_license_warning(name, type = "Component")
immediate_hydration_pro_install_warning(name, type)
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alias is preserved for backward compatibility, but since immediate_hydration_pro_license_warning has no external callers in this codebase (only the alias definition and the new spec), consider adding a @deprecated YARD annotation so tooling and future contributors know this name is being phased out:

Suggested change
end
# Backward-compatible alias for callers using the prior method name.
# @deprecated Use {immediate_hydration_pro_install_warning} instead.
def self.immediate_hydration_pro_license_warning(name, type = "Component")
immediate_hydration_pro_install_warning(name, type)
end

expect(warning).to eq(
described_class.immediate_hydration_pro_install_warning("TestComponent", "Component")
)
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests return-value equality, which is correct. If you want stronger coverage that the alias actually delegates (rather than duplicating logic), you could do:

it "delegates to the installation warning method for backward compatibility" do
  expect(described_class).to receive(:immediate_hydration_pro_install_warning)
    .with("TestComponent", "Component").and_call_original

  described_class.immediate_hydration_pro_license_warning("TestComponent", "Component")
end

Not a blocking concern — the current test is sufficient for a simple one-liner alias.

…icense_warning

The alias has no external callers — the old method name is only referenced
by its own definition and the test for it. Removing the alias and its test
reduces maintenance surface without any behavioral change.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 13, 2026

PR Review: docs: clarify railsContext.rorPro semantics

Overall this is a clean, well-scoped documentation/naming PR. The semantic distinction between "Pro gem installed" vs. "Pro license valid" is important and the changes accurately reflect it across Ruby, TypeScript, docs, and tests.

One factual inaccuracy in CHANGELOG.md that needs correction (see inline comment):

The changelog entry claims: "added a backward-compatible alias for the previous warning helper method name", but no alias was added. The method immediate_hydration_pro_license_warning was simply renamed to immediate_hydration_pro_install_warning with no backward-compatible shim. Since the method is a public self. method on ReactOnRails::Utils, any external caller using the old name would get a NoMethodError.

A quick grep confirms no external callers exist within this repo (neither OSS nor Pro), so there is no actual breakage here — but the CHANGELOG entry should be corrected to remove the alias claim to avoid confusion.

Everything else looks good:

  • Variable rename hasProLicensehasProGemInstalled in ClientSideRenderer.ts is accurate.
  • Warning messages are updated consistently in both Ruby and TypeScript.
  • Test descriptions and expected strings all match the renamed method's output.
  • LICENSE_SETUP.md clarification adds useful context for users wondering why the browser package doesn't independently validate licenses.
  • No runtime behavior changes — this is purely documentation and naming.

Comment thread CHANGELOG.md Outdated

#### Changed

- **Clarified Pro-installation signaling for immediate hydration warnings**: Updated Ruby/TypeScript warning text and related docs to state that `railsContext.rorPro` indicates Pro gem installation (not license validity), and added a backward-compatible alias for the previous warning helper method name. [PR 2590](https://github.com/shakacode/react_on_rails/pull/2590) by [justin808](https://github.com/justin808).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The claim "added a backward-compatible alias for the previous warning helper method name" does not match the code. The method immediate_hydration_pro_license_warning was renamed to immediate_hydration_pro_install_warning — no alias was introduced. There are no external callers within this repo so no breakage occurs, but the changelog entry should be corrected to avoid misleading readers.

Suggested change
- **Clarified Pro-installation signaling for immediate hydration warnings**: Updated Ruby/TypeScript warning text and related docs to state that `railsContext.rorPro` indicates Pro gem installation (not license validity), and added a backward-compatible alias for the previous warning helper method name. [PR 2590](https://github.com/shakacode/react_on_rails/pull/2590) by [justin808](https://github.com/justin808).
- **Clarified Pro-installation signaling for immediate hydration warnings**: Updated Ruby/TypeScript warning text and related docs to state that `railsContext.rorPro` indicates Pro gem installation (not license validity), and renamed the Ruby warning helper from `immediate_hydration_pro_license_warning` to `immediate_hydration_pro_install_warning`. [PR 2590](https://github.com/shakacode/react_on_rails/pull/2590) by [justin808](https://github.com/justin808).

The previous entry said a backward-compatible alias was added, but it
was removed in the latest commit. Update to accurately describe the
rename from immediate_hydration_pro_license_warning to
immediate_hydration_pro_install_warning with no alias retained.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
i18nLocale: string;
i18nDefaultLocale: string;
rorVersion: string;
// True when React on Rails Pro is installed on the server.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor wording nit: "Present when rorPro is true" implies the field is always defined when rorPro is true, but the field is typed as optional (rorProVersion?: string). A clearer phrasing might be:

Suggested change
// True when React on Rails Pro is installed on the server.
// Set when the React on Rails Pro gem is installed; contains the installed Pro version string.

@@ -29,8 +29,8 @@ import * as ComponentRegistry from './ComponentRegistry.ts';

const REACT_ON_RAILS_STORE_ATTRIBUTE = 'data-js-react-on-rails-store';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor inconsistency: the Ruby-side warning (in utils.rb) says "requires the React on Rails Pro gem to be installed" without "on the server". Since this is client-side code the extra qualifier is useful, but it's worth keeping the two messages aligned so both surfaces give developers the same signal. Not blocking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 13, 2026

PR Review: railsContext.rorPro semantics clarification

Clean, low-risk PR. Changes are internally consistent and semantically correct. A few minor observations (two posted as inline comments).

No issues found:

  • No stale references to old method/variable names in the codebase
  • No backward-compat concerns (renamed Ruby method has no external callers)
  • All tests updated to match new warning text
  • Runtime behaviour unchanged

Minor observations:

  1. Wording inconsistency between Ruby and TS warnings (inline): The TS warning says 'on the server' but the Ruby warning does not. Helpful context in client-side code, but aligning them would be consistent. Not blocking.

  2. rorProVersion comment phrasing (inline): 'Present when rorPro is true' implies the field is always defined when rorPro is true, but it is optional. 'Set when the Pro gem is installed' is slightly more precise. Not blocking.

  3. CHANGELOG placement: The entry is under Changed (OSS section) above the Pro section. Since this also touches Pro-specific code, a cross-reference in the Pro section could help Pro users. Not blocking.

Overall: LGTM with the above as optional polish.

@justin808 justin808 merged commit 4d69217 into master Mar 13, 2026
40 checks passed
@justin808 justin808 deleted the jg-codex/fix-2453-clarify-rorpro branch March 13, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify railsContext.rorPro semantics (Pro installed vs license validity)

1 participant