Skip to content

docs: fix incorrect license configuration option in Pro docs#2276

Merged
ihabadham merged 1 commit intomasterfrom
ihabadham/fix/remove-nonexistent-license-token-config
Jan 4, 2026
Merged

docs: fix incorrect license configuration option in Pro docs#2276
ihabadham merged 1 commit intomasterfrom
ihabadham/fix/remove-nonexistent-license-token-config

Conversation

@ihabadham
Copy link
Copy Markdown
Collaborator

@ihabadham ihabadham commented Jan 3, 2026

Summary

  • Removes references to config.license_token which doesn't exist in the codebase
  • Replaces with correct config file method (config/react_on_rails_pro_license.key)
  • Adds link to LICENSE_SETUP.md for complete instructions

Background

The config.license_token option was incorrectly documented in PR #1901 but was never actually implemented in PR #1857. The LicenseValidator only supports two methods:

  1. Environment variable: REACT_ON_RAILS_PRO_LICENSE
  2. Config file: config/react_on_rails_pro_license.key

There is no license_token attribute in the ReactOnRailsPro::Configuration class.

Files Changed

  • react_on_rails_pro/docs/installation.md - Fixed license configuration section
  • react_on_rails_pro/docs/updating.md - Fixed license configuration section

Test Plan

  • Verified the config file method matches what LICENSE_SETUP.md documents
  • Verified config.license_token does not exist in the codebase

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • License configuration now uses file-based setup instead of environment variables.
    • New license key file requires .gitignore configuration.
    • Comprehensive setup guidance available in LICENSE_SETUP.md.

✏️ Tip: You can customize this high-level summary in your review settings.

Remove references to `config.license_token` which doesn't exist in the
codebase. The LicenseValidator only supports:
1. Environment variable: REACT_ON_RAILS_PRO_LICENSE
2. Config file: config/react_on_rails_pro_license.key

The incorrect `config.license_token` option was introduced in PR #1901
but was never implemented in the actual code (PR #1857).

Updated both installation.md and updating.md to document the config
file method instead, which is the correct alternative to the
environment variable approach.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

coderabbitai Bot commented Jan 3, 2026

Walkthrough

Documentation updates to react_on_rails_pro licensing configuration, replacing environment-variable-based setup with a file-based approach at config/react_on_rails_pro_license.key. Security guidance updated to reflect adding the license file to .gitignore and cross-references new LICENSE_SETUP.md documentation.

Changes

Cohort / File(s) Summary
License Configuration Documentation
react_on_rails_pro/docs/installation.md, react_on_rails_pro/docs/updating.md
Replaced environment-variable configuration steps with file-based license key setup. Updated code examples from Ruby initializer blocks to bash file-writing commands. Added .gitignore guidance for the new license key file and cross-references to LICENSE_SETUP.md for complete setup instructions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

review-needed

Suggested reviewers

  • justin808
  • AbanoubGhadban
  • alexeyr-ci2

Poem

🐰 A license key in a file so fine,
No env vars cluttering the line,
To .gitignore it must go,
Secure and tidy, don't you know!
Our documentation hops along with glee ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing incorrect license configuration documentation by removing references to a non-existent config.license_token option.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ihabadham/fix/remove-nonexistent-license-token-config

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d864f66 and 69538c4.

📒 Files selected for processing (2)
  • react_on_rails_pro/docs/installation.md
  • react_on_rails_pro/docs/updating.md
🧰 Additional context used
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1875
File: lib/react_on_rails/utils.rb:112-124
Timestamp: 2025-10-23T17:22:01.074Z
Learning: In React on Rails, when Pro is installed but not licensed, the intended behavior is to raise an error on boot. The `react_on_rails_pro?` method validates licenses and should raise errors early (including during path resolution in methods like `server_bundle?`) to enforce licensing requirements rather than failing later with obscure errors.
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.
Learnt from: Romex91
Repo: shakacode/react_on_rails PR: 1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG_PRO.md : Update `/CHANGELOG_PRO.md` for user-visible changes in the Pro-only react_on_rails_pro gem and npm packages

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /CHANGELOG.md : Update `/CHANGELOG.md` for user-visible changes in the open-source react_on_rails gem and npm package (features, bug fixes, breaking changes, deprecations, performance improvements)

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-10-23T17:22:01.074Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1875
File: lib/react_on_rails/utils.rb:112-124
Timestamp: 2025-10-23T17:22:01.074Z
Learning: In React on Rails, when Pro is installed but not licensed, the intended behavior is to raise an error on boot. The `react_on_rails_pro?` method validates licenses and should raise errors early (including during path resolution in methods like `server_bundle?`) to enforce licensing requirements rather than failing later with obscure errors.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-04-26T21:55:55.874Z
Learnt from: alexeyr-ci2
Repo: shakacode/react_on_rails PR: 1732
File: spec/dummy/client/app-react16/startup/ReduxSharedStoreApp.client.jsx:40-44
Timestamp: 2025-04-26T21:55:55.874Z
Learning: In the react_on_rails project, files under `app-react16` directories are copied/moved to corresponding `/app` directories during the conversion process (removing the `-react16` suffix), which affects their relative import paths at runtime.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to sig/react_on_rails/**/*.rbs : RBS signatures in `sig/react_on_rails/` should be added for new Ruby files in `lib/react_on_rails/`, included in Steepfile, validated with `bundle exec rake rbs:validate`, and type-checked with `bundle exec rake rbs:steep`

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-09-16T08:01:11.146Z
Learnt from: justin808
Repo: shakacode/react_on_rails PR: 1770
File: lib/generators/react_on_rails/templates/base/base/app/javascript/src/HelloWorld/ror_components/HelloWorld.client.jsx:2-2
Timestamp: 2025-09-16T08:01:11.146Z
Learning: React on Rails uses webpack CSS Modules configuration with namedExports: true, which requires the import syntax `import * as style from './file.module.css'` rather than the default export pattern. This configuration enables better tree shaking and bundle size optimization for CSS modules.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-02-12T16:38:06.537Z
Learnt from: Romex91
Repo: shakacode/react_on_rails PR: 1697
File: package-scripts.yml:28-28
Timestamp: 2025-02-12T16:38:06.537Z
Learning: The file `node_package/lib/ReactOnRails.full.js` is autogenerated during the build process and should not be present in the repository.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-09-15T21:24:48.207Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1781
File: node_package/src/ClientSideRenderer.ts:82-95
Timestamp: 2025-09-15T21:24:48.207Z
Learning: In React on Rails, the force_load feature includes both explicit `data-force-load="true"` usage and the ability to hydrate components during the page loading state (`document.readyState === 'loading'`). Both capabilities require a Pro license, so the condition `!railsContext.rorPro && (isComponentForceLoaded || document.readyState === 'loading')` correctly gates both scenarios.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-02-18T13:08:01.477Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: lib/react_on_rails/helper.rb:190-197
Timestamp: 2025-02-18T13:08:01.477Z
Learning: RSC support validation in React on Rails Pro is handled through a chain of validations:
1. Pro version check in `run_stream_inside_fiber`
2. RSC support check during pack generation via `ReactOnRailsPro.configuration.enable_rsc_support`
3. RSC support validation during component registration
This makes additional validation in the helper methods unnecessary.

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to /{CHANGELOG.md,CHANGELOG_PRO.md} : Use format `[PR 1818](https://github.com/shakacode/react_on_rails/pull/1818) by [username](https://github.com/username)` in changelog entries (no hash in PR number)

Applied to files:

  • react_on_rails_pro/docs/updating.md
  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-02-13T16:50:26.861Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1644
File: node_package/src/turbolinksUtils.ts:34-36
Timestamp: 2025-02-13T16:50:26.861Z
Learning: In React on Rails, when checking for Turbolinks version 5 using `turbolinksVersion5()`, always ensure `Turbolinks` exists first by checking `turbolinksInstalled()` to prevent TypeError when accessing properties.

Applied to files:

  • react_on_rails_pro/docs/updating.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to react_on_rails/spec/dummy/e2e/playwright/e2e/**/*.spec.js : Use Playwright E2E tests in `react_on_rails/spec/dummy/e2e/playwright/` for React component integration testing. Tests automatically start Rails server on port 5017 before running

Applied to files:

  • react_on_rails_pro/docs/updating.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: Applies to lib/react_on_rails/engine.rb : In Rails Engine code, DO NOT use `rake_tasks` block to explicitly load rake files from `lib/tasks/` - Rails::Engine automatically loads them. Only use `rake_tasks` block if tasks are in non-standard location, need programmatic generation, or need to pass context

Applied to files:

  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-12-19T18:57:59.314Z
Learnt from: CR
Repo: shakacode/react_on_rails PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-19T18:57:59.314Z
Learning: In IDE configuration, exclude these directories to prevent slowdowns: /coverage, /tmp, /gen-examples, /packages/react-on-rails/lib, /node_modules, /react_on_rails/spec/dummy/node_modules, /react_on_rails/spec/dummy/tmp, /react_on_rails/spec/dummy/app/assets/webpack, /react_on_rails/spec/dummy/log, /react_on_rails/spec/dummy/e2e/playwright-report, /react_on_rails/spec/dummy/test-results

Applied to files:

  • react_on_rails_pro/docs/installation.md
📚 Learning: 2025-07-08T05:57:29.630Z
Learnt from: AbanoubGhadban
Repo: shakacode/react_on_rails PR: 1745
File: node_package/src/RSCRequestTracker.ts:8-14
Timestamp: 2025-07-08T05:57:29.630Z
Learning: The global `generateRSCPayload` function in React on Rails Pro (RORP) is provided by the framework during rendering requests, not implemented in application code. The `declare global` statements are used to document the expected interface that RORP will inject at runtime.

Applied to files:

  • react_on_rails_pro/docs/installation.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Greptile Review
  • GitHub Check: claude-review
🔇 Additional comments (2)
react_on_rails_pro/docs/installation.md (1)

44-58: Documentation changes align with PR objectives—LGTM!

The license configuration section correctly documents both supported methods (environment variable and file-based), provides clear security guidance about .gitignore, and cross-references LICENSE_SETUP.md for comprehensive setup instructions. The bash command syntax is correct and the removal of the non-existent config.license_token option is properly reflected.

react_on_rails_pro/docs/updating.md (1)

165-182: Consistent with installation.md and properly positioned in migration flow—LGTM!

The license configuration approach in the upgrading guide mirrors the installation guide, providing both environment variable and file-based options with consistent security guidance and cross-references to LICENSE_SETUP.md. Step 5 placement is logical within the migration workflow.


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.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 3, 2026

Code Review ✅

Summary

Excellent documentation fix! This PR correctly removes references to a non-existent config.license_token configuration option and replaces it with the actual supported methods.

Verification

I've verified the claims in this PR:

Confirmed: config.license_token does NOT exist in ReactOnRailsPro::Configuration (react_on_rails_pro/lib/react_on_rails_pro/configuration.rb:65-73)

Confirmed: LicenseValidator only supports two methods (react_on_rails_pro/lib/react_on_rails_pro/license_validator.rb:154-167):

  1. Environment variable: REACT_ON_RAILS_PRO_LICENSE
  2. Config file: config/react_on_rails_pro_license.key

Confirmed: The LICENSE_SETUP.md documentation correctly documents these methods

Code Quality

Strengths:

  • ✅ Accurate correction of misleading documentation
  • ✅ Consistent changes across both affected files (installation.md and updating.md)
  • ✅ Adds helpful reference link to LICENSE_SETUP.md
  • ✅ Improves security warning by mentioning .gitignore
  • ✅ Clear and informative PR description with historical context

Documentation Quality:

  • ✅ The new config file method uses proper bash syntax
  • ✅ Security warnings are enhanced (mentions .gitignore explicitly)
  • ✅ Links to comprehensive LICENSE_SETUP.md for details

Potential Issues

None found - This is a straightforward documentation correction with no code changes.

Security Considerations

Improved: The updated security warning now explicitly mentions adding the config file to .gitignore, which is more actionable than the previous generic warning.

Performance Considerations

N/A - Documentation-only changes

Test Coverage

N/A - Documentation-only changes. The documented methods are already tested as part of the LicenseValidator implementation.

Recommendations

None - This PR is ready to merge. The changes are accurate, well-documented, and improve the user experience by removing confusion about a non-existent configuration option.

Historical Context

Good catch on the discrepancy! PR #1901 incorrectly documented config.license_token which was never implemented in PR #1857's license validation system. This PR fixes that documentation bug.


Verdict: LGTM 🚀 - Ready to merge

Reviewed using project conventions from CLAUDE.md

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jan 3, 2026

Greptile Summary

This PR fixes incorrect documentation that referenced a non-existent config.license_token configuration option. The documentation previously instructed users to configure the license using ReactOnRailsPro.configure { |config| config.license_token = ... }, but this attribute was never implemented in the ReactOnRailsPro::Configuration class.

What changed:

  • Removed all references to the fictional config.license_token option
  • Replaced with the correct config file method: config/react_on_rails_pro_license.key
  • Added link to LICENSE_SETUP.md for complete instructions
  • Updated security warnings to mention .gitignore for the config file

Why this matters:
The LicenseValidator (react_on_rails_pro/lib/react_on_rails_pro/license_validator.rb:154-167) only supports two methods for loading licenses:

  1. Environment variable: REACT_ON_RAILS_PRO_LICENSE
  2. Config file: config/react_on_rails_pro_license.key

The ReactOnRailsPro::Configuration class has no license_token attribute, so following the old documentation would have resulted in a NoMethodError.

Confidence Score: 5/5

  • This PR is completely safe to merge with no risk
  • This is a documentation-only fix that corrects factually incorrect information. The changes were thoroughly verified against the codebase: ReactOnRailsPro::Configuration indeed has no license_token attribute, and LicenseValidator.load_license_string only checks ENV var and config file. The fix prevents users from following non-working instructions that would cause runtime errors.
  • No files require special attention

Important Files Changed

Filename Overview
react_on_rails_pro/docs/installation.md Corrected license configuration from non-existent config.license_token to valid config file method
react_on_rails_pro/docs/updating.md Corrected license configuration from non-existent config.license_token to valid config file method

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Docs as Documentation
    participant Validator as LicenseValidator
    participant Env as Environment Variable
    participant File as Config File

    Note over Dev,Docs: Before (Incorrect)
    Dev->>Docs: Read installation instructions
    Docs-->>Dev: Use config.license_token ❌
    Dev->>Validator: Try config.license_token
    Validator-->>Dev: ERROR: Attribute doesn't exist

    Note over Dev,Docs: After (Corrected)
    Dev->>Docs: Read installation instructions
    Docs-->>Dev: Use ENV var OR config file ✅
    
    alt Environment Variable Method
        Dev->>Env: Set REACT_ON_RAILS_PRO_LICENSE
        Validator->>Env: Read license
        Env-->>Validator: Return license token
    else Config File Method
        Dev->>File: Create config/react_on_rails_pro_license.key
        Validator->>File: Read license file
        File-->>Validator: Return license token
    end
    
    Validator->>Validator: Validate JWT signature
    Validator-->>Dev: License validated ✅
Loading

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jan 3, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@ihabadham ihabadham merged commit 619cb78 into master Jan 4, 2026
5 of 6 checks passed
@ihabadham ihabadham deleted the ihabadham/fix/remove-nonexistent-license-token-config branch January 4, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant