From 781121fd3b7e5c958cb1e80df6628b8c17007e5c Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 00:12:56 +0200 Subject: [PATCH 1/9] Switch Pro packages to public distribution Remove GitHub Packages configuration to publish Pro packages publicly on npmjs.org and RubyGems.org. Changes: - Remove publishConfig from react_on_rails_pro/package.json (node-renderer) - Update release script to publish Pro gem to RubyGems.org (remove --key github --host) - Update all messaging from PRIVATE/GitHub Packages to PUBLIC/npmjs.org/RubyGems.org - Update script documentation to reflect all packages are now public - Update success message for unified public distribution This follows Bob's pattern from react-on-rails-pro NPM package (already configured for public). Runtime enforcement via JWT license validation remains unchanged. --- rakelib/release.rake | 37 ++++++++++++--------------------- react_on_rails_pro/package.json | 3 --- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/rakelib/release.rake b/rakelib/release.rake index 205a534c35..184bdca3a0 100644 --- a/rakelib/release.rake +++ b/rakelib/release.rake @@ -29,9 +29,8 @@ This will update and release: PUBLIC (npmjs.org + rubygems.org): - react-on-rails NPM package - react-on-rails-pro NPM package - - react_on_rails RubyGem - PRIVATE (GitHub Packages): - @shakacode-tools/react-on-rails-pro-node-renderer NPM package + - react_on_rails RubyGem - react_on_rails_pro RubyGem 1st argument: Version (patch/minor/major OR explicit version like 16.2.0) @@ -208,24 +207,15 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| sh_in_dir(gem_root, "yarn workspace react-on-rails-pro publish --new-version #{actual_npm_version} #{npm_publish_args}") - # Publish node-renderer NPM package (to Verdaccio or GitHub Packages depending on mode) + # Publish node-renderer NPM package (PUBLIC on npmjs.org) puts "\n#{'=' * 80}" - if use_verdaccio - puts "Publishing node-renderer to Verdaccio (local)..." - else - puts "Publishing PRIVATE node-renderer to GitHub Packages..." - end + puts "Publishing PUBLIC node-renderer to #{use_verdaccio ? 'Verdaccio (local)' : 'npmjs.org'}..." puts "=" * 80 # Publish react-on-rails-pro-node-renderer NPM package - node_renderer_registry = if use_verdaccio - "Verdaccio (http://localhost:4873/)" - else - "GitHub Packages" - end node_renderer_name = "@shakacode-tools/react-on-rails-pro-node-renderer" - puts "\nPublishing #{node_renderer_name}@#{actual_npm_version} to #{node_renderer_registry}..." - puts "Ensure you're authenticated with GitHub Packages (see ~/.npmrc)" unless use_verdaccio + puts "\nPublishing #{node_renderer_name}@#{actual_npm_version}..." + puts "Carefully add your OTP for NPM when prompted." unless use_verdaccio sh_in_dir(pro_gem_root, "yarn publish --new-version #{actual_npm_version} --no-git-tag-version #{npm_publish_args}") @@ -241,14 +231,13 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| sh_in_dir(gem_root, "gem release") puts "\n#{'=' * 80}" - puts "Publishing PRIVATE Ruby gem to GitHub Packages..." + puts "Publishing PUBLIC Pro Ruby gem to RubyGems.org..." puts "=" * 80 - # Publish react_on_rails_pro Ruby gem to GitHub Packages - puts "\nPublishing react_on_rails_pro gem to GitHub Packages..." - puts "Ensure you have GitHub token in ~/.gem/credentials" - sh_in_dir(pro_gem_root, - "gem release --key github --host https://rubygems.pkg.github.com/shakacode-tools") + # Publish react_on_rails_pro Ruby gem to RubyGems.org + puts "\nPublishing react_on_rails_pro gem to RubyGems.org..." + puts "Carefully add your OTP for Rubygems when prompted." + sh_in_dir(pro_gem_root, "gem release") end end @@ -290,9 +279,9 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| MSG unless use_verdaccio - msg += "\n Ruby Gems:\n" - msg += " - react_on_rails #{actual_gem_version} (RubyGems.org)\n" - msg += " - react_on_rails_pro #{actual_gem_version} (GitHub Packages)\n" + msg += "\n Ruby Gems (RubyGems.org):\n" + msg += " - react_on_rails #{actual_gem_version}\n" + msg += " - react_on_rails_pro #{actual_gem_version}\n" end if skip_push diff --git a/react_on_rails_pro/package.json b/react_on_rails_pro/package.json index 5ba903499d..668d15bbda 100644 --- a/react_on_rails_pro/package.json +++ b/react_on_rails_pro/package.json @@ -17,9 +17,6 @@ "bin": { "react-on-rails-pro-node-renderer": "packages/node-renderer/dist/default-node-renderer.js" }, - "publishConfig": { - "registry": "https://npm.pkg.github.com" - }, "directories": { "doc": "docs" }, From 417b92de7dab6c18c15000d71e666274af772476 Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 21:11:06 +0200 Subject: [PATCH 2/9] Remove @shakacode-tools scope from node-renderer package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change package name from @shakacode-tools/react-on-rails-pro-node-renderer to react-on-rails-pro-node-renderer (unscoped). Rationale: - @shakacode-tools scope was only needed for GitHub Packages (requires scoping) - Now publishing to public npmjs.org where scoping is optional - Matches naming pattern of react-on-rails and react-on-rails-pro (both unscoped) - Unscoped packages are public by default (no --access public flag needed) - @shakacode-tools npm org doesn't exist on npmjs.org Migration impact: Small number of Pro customers will need to update their node-renderer.js imports when upgrading (Justin will handle directly). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- rakelib/release.rake | 8 ++++---- react_on_rails_pro/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rakelib/release.rake b/rakelib/release.rake index 184bdca3a0..4e3d98dcf0 100644 --- a/rakelib/release.rake +++ b/rakelib/release.rake @@ -29,7 +29,7 @@ This will update and release: PUBLIC (npmjs.org + rubygems.org): - react-on-rails NPM package - react-on-rails-pro NPM package - - @shakacode-tools/react-on-rails-pro-node-renderer NPM package + - react-on-rails-pro-node-renderer NPM package - react_on_rails RubyGem - react_on_rails_pro RubyGem @@ -213,7 +213,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| puts "=" * 80 # Publish react-on-rails-pro-node-renderer NPM package - node_renderer_name = "@shakacode-tools/react-on-rails-pro-node-renderer" + node_renderer_name = "react-on-rails-pro-node-renderer" puts "\nPublishing #{node_renderer_name}@#{actual_npm_version}..." puts "Carefully add your OTP for NPM when prompted." unless use_verdaccio sh_in_dir(pro_gem_root, @@ -275,7 +275,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| Published to #{npm_registry_note}: - react-on-rails@#{actual_npm_version} - react-on-rails-pro@#{actual_npm_version} - - @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version} + - react-on-rails-pro-node-renderer@#{actual_npm_version} MSG unless use_verdaccio @@ -302,7 +302,7 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| To test installation: npm install --registry http://localhost:4873/ react-on-rails@#{actual_npm_version} npm install --registry http://localhost:4873/ react-on-rails-pro@#{actual_npm_version} - npm install --registry http://localhost:4873/ @shakacode-tools/react-on-rails-pro-node-renderer@#{actual_npm_version} + npm install --registry http://localhost:4873/ react-on-rails-pro-node-renderer@#{actual_npm_version} Note: Ruby gems were not published (Verdaccio is NPM-only) diff --git a/react_on_rails_pro/package.json b/react_on_rails_pro/package.json index 668d15bbda..e501780e37 100644 --- a/react_on_rails_pro/package.json +++ b/react_on_rails_pro/package.json @@ -1,5 +1,5 @@ { - "name": "@shakacode-tools/react-on-rails-pro-node-renderer", + "name": "react-on-rails-pro-node-renderer", "version": "16.2.0-beta.4", "protocolVersion": "2.0.0", "description": "react-on-rails-pro JavaScript for react_on_rails_pro Ruby gem", From c1b54f66dc09a58b60b0127119f53e30f314ed5f Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 23:02:08 +0200 Subject: [PATCH 3/9] Update documentation for public distribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove all references to GitHub Packages and private distribution. Update package name from @shakacode-tools/react-on-rails-pro-node-renderer to react-on-rails-pro-node-renderer throughout documentation. Changes: - Completely rewrite installation.md to remove GitHub PAT authentication - Simplify to standard gem install and npm install commands - Add JWT license token configuration section - Update all code examples with unscoped package name - Remove GitHub Packages authentication instructions - Update contributor documentation to reflect all packages are public - Update CONTRIBUTING.md files to remove private package sections Documentation files updated: - react_on_rails_pro/docs/installation.md (major rewrite) - react_on_rails_pro/docs/node-renderer/basics.md - react_on_rails_pro/docs/node-renderer/js-configuration.md - react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md - react_on_rails_pro/docs/code-splitting-loadable-components.md - docs/contributor-info/releasing.md - react_on_rails_pro/docs/contributors-info/releasing.md - CONTRIBUTING.md - react_on_rails_pro/CONTRIBUTING.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CONTRIBUTING.md | 2 +- docs/contributor-info/releasing.md | 6 +- react_on_rails_pro/CONTRIBUTING.md | 15 +- .../code-splitting-loadable-components.md | 2 +- .../docs/contributors-info/releasing.md | 4 +- react_on_rails_pro/docs/installation.md | 206 +++++++++--------- .../docs/node-renderer/basics.md | 6 +- .../error-reporting-and-tracing.md | 16 +- .../docs/node-renderer/js-configuration.md | 2 +- 9 files changed, 122 insertions(+), 137 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e15046049..0758f399d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -129,7 +129,7 @@ Package react-on-rails@12.0.0-12070fd1 added ==> /Users/justin/shakacode/react-o Don't forget you may need to run yarn after adding packages with yalc to install/update dependencies/bin scripts. ``` -Of course, you can do the same with `react-on-rails-pro` and `@shakacode-tools/react-on-rails-pro-node-renderer` packages. +Of course, you can do the same with `react-on-rails-pro` and `react-on-rails-pro-node-renderer` packages. This is the approach `spec/dummy` apps use, so you can also look at their implementation. diff --git a/docs/contributor-info/releasing.md b/docs/contributor-info/releasing.md index 1c1833d070..2538635c6f 100644 --- a/docs/contributor-info/releasing.md +++ b/docs/contributor-info/releasing.md @@ -58,9 +58,9 @@ The release task publishes 5 packages with unified versioning: 1. **react-on-rails** - NPM package 2. **react-on-rails-pro** - NPM package -3. **react_on_rails** - RubyGem - -**PRIVATE (GitHub Packages):** 4. **@shakacode-tools/react-on-rails-pro-node-renderer** - NPM package 5. **react_on_rails_pro** - RubyGem +3. **react-on-rails-pro-node-renderer** - NPM package +4. **react_on_rails** - RubyGem +5. **react_on_rails_pro** - RubyGem ### Version Synchronization diff --git a/react_on_rails_pro/CONTRIBUTING.md b/react_on_rails_pro/CONTRIBUTING.md index 402e06d752..98eaf8a9f8 100644 --- a/react_on_rails_pro/CONTRIBUTING.md +++ b/react_on_rails_pro/CONTRIBUTING.md @@ -347,24 +347,13 @@ Contact Justin Gordon, [justin@shakacode.com](mailto:justin@shakacode.com) for r ## Prerequisites -You need authentication for both public and private package registries: +You need authentication for public package registries: **Public packages (npmjs.org + rubygems.org):** - NPM: Run `npm login` - RubyGems: Standard credentials via `gem push` -**Private packages (GitHub Packages):** -- Get a GitHub personal access token with `write:packages` scope -- Configure `~/.npmrc`: - ```ini - //npm.pkg.github.com/:_authToken= - always-auth=true - ``` -- Configure `~/.gem/credentials`: - ```yaml - :github: Bearer - ``` -- Set environment variable: `export GITHUB_TOKEN=` +All React on Rails and React on Rails Pro packages are now published publicly to npmjs.org and RubyGems.org. ## Release Command diff --git a/react_on_rails_pro/docs/code-splitting-loadable-components.md b/react_on_rails_pro/docs/code-splitting-loadable-components.md index 3a520aca79..bd06ea4a59 100644 --- a/react_on_rails_pro/docs/code-splitting-loadable-components.md +++ b/react_on_rails_pro/docs/code-splitting-loadable-components.md @@ -245,7 +245,7 @@ In your `node-renderer.js` file which runs node renderer, you need to specify `s ```js const path = require('path'); const env = process.env; -const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); +const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer'); const config = { ... diff --git a/react_on_rails_pro/docs/contributors-info/releasing.md b/react_on_rails_pro/docs/contributors-info/releasing.md index 83378179a2..3e543c7038 100644 --- a/react_on_rails_pro/docs/contributors-info/releasing.md +++ b/react_on_rails_pro/docs/contributors-info/releasing.md @@ -35,6 +35,6 @@ rake release[17.0.0,false,verdaccio] This unified script releases all 5 packages together: - react-on-rails (NPM) - react-on-rails-pro (NPM) +- react-on-rails-pro-node-renderer (NPM) - react_on_rails (RubyGem) -- @shakacode-tools/react-on-rails-pro-node-renderer (NPM, GitHub Packages) -- react_on_rails_pro (RubyGem, GitHub Packages) +- react_on_rails_pro (RubyGem) diff --git a/react_on_rails_pro/docs/installation.md b/react_on_rails_pro/docs/installation.md index 62d46f0ef5..0d6e899ca4 100644 --- a/react_on_rails_pro/docs/installation.md +++ b/react_on_rails_pro/docs/installation.md @@ -1,108 +1,107 @@ # Installation -Since the repository is private, you will get a **GitHub Personal Access Token** and an account that can access the packages. Substitute that value in the commands below. If you dont' have this, ask [justin@shakacode.com](mailto:justin@shakacode.com) to give you one. +React on Rails Pro packages are published publicly on npmjs.org and RubyGems.org. Installation requires a valid **license token** for runtime validation. Contact [justin@shakacode.com](mailto:justin@shakacode.com) to purchase a license. -Check the [CHANGELOG](https://github.com/shakacode/react_on_rails_pro/blob/master/CHANGELOG.md) to see what version you want. +Check the [CHANGELOG](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md) to see what version you want. -# Version +## Version Format -For the below docs, find the desired `` in the CHANGELOG. Note, for pre-release versions, gems have all periods, and node packages uses a dash, like gem `3.0.0.rc.0` and node package `3.0.0-rc.0`. +For the below docs, find the desired `` in the CHANGELOG. Note that for pre-release versions: +- Gems use all periods: `16.2.0.beta.1` +- NPM packages use dashes: `16.2.0-beta.1` -# Ruby +# Ruby Gem Installation -## Gem Installation +## Prerequisites -1. Ensure your **Rails** app is using the **react_on_rails** gem, version greater than 11.0.7. -1. Add the `react_on_rails_pro` gem to your **Gemfile**. Substitute the appropriate version number. +Ensure your **Rails** app is using the **react_on_rails** gem, version 16.0.0 or higher. -## Gemfile Change +## Install react_on_rails_pro Gem -Replace the following in the snippet for the Gemfile - -1. `` for the api key -2. `` -3. `` desired +Add the `react_on_rails_pro` gem to your **Gemfile**: ```ruby -source "https://:@"\ - "rubygems.pkg.github.com/shakacode-tools" do - gem "react_on_rails_pro", "" -end +gem "react_on_rails_pro", "~> 16.1" ``` -## Alternate installation keeping the key out of your Gemfile +Then run: -```ruby -source "https://rubygems.pkg.github.com/shakacode-tools" do - gem "react_on_rails_pro", "" -end +```bash +bundle install ``` -Or use the `gem install` command: +Or install directly: ```bash -gem install react_on_rails_pro --version "> --source "https://rubygems.pkg.github.com/shakacode-tools" +gem install react_on_rails_pro --version "" ``` -Then edit your permissions for bundler at the command line: +## License Configuration -``` -bundle config set rubygems.pkg.github.com : -``` +Set your license token as an environment variable: -## Using a branch in your Gemfile +```bash +export REACT_ON_RAILS_PRO_LICENSE="your-license-token-here" +``` -Note, you should probably use an ENV value for the token so that you don't check this into your source code. +Or configure it in your Rails initializer (not recommended for production): ```ruby -gem "react_on_rails_pro", version: "", git: "https://[your-github-token]:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git", tag: "" +# config/initializers/react_on_rails_pro.rb +ReactOnRailsPro.configure do |config| + config.license_token = ENV["REACT_ON_RAILS_PRO_LICENSE"] +end ``` ## Rails Configuration -You don't need to create an initializer if you are satisfied with the default as described in -[Configuration](./configuration.md) +You don't need to create an initializer if you are satisfied with the defaults as described in [Configuration](./configuration.md). -# Node Package +For basic setup: -Note, you only need to install the Node Package if you are using the standalone node renderer, `NodeRenderer`. +```ruby +# config/initializers/react_on_rails_pro.rb +ReactOnRailsPro.configure do |config| + # Your configuration here + # See docs/configuration.md for all options +end +``` + +# Node Package Installation -## Installation +**Note:** You only need to install the Node Package if you are using the standalone node renderer (`NodeRenderer`). If you're using `ExecJS` (the default), skip this section. -1. Create a subdirectory of your rails project for the Node renderer. Let's use `react-on-rails-pro`. -2. Create a file `react-on-rails-pro/.npmrc` with the following +## Install react-on-rails-pro-node-renderer +### Using npm: + +```bash +npm install react-on-rails-pro-node-renderer ``` -always-auth=true -//npm.pkg.github.com/:_authToken= -@shakacode-tools:registry=https://npm.pkg.github.com + +### Using yarn: + +```bash +yarn add react-on-rails-pro-node-renderer ``` -3. Create a `react-on-rails-pro/package.json` +### Add to package.json: ```json { - "private": true, "dependencies": { - "@shakacode-tools/react-on-rails-pro-node-renderer": "" - }, - "scripts": { - "node-renderer": "echo 'Starting React on Rails Pro Node Renderer.' && node ./react-on-rails-pro-node-renderer.js" + "react-on-rails-pro-node-renderer": "16.1.1" } } ``` -4. Be sure to run `npm i` **and not** `yarn` as only npm seems to work with the private github packages. - -If you really want to use yarn, see [Yarn can't find private Github npm registry](https://stackoverflow.com/questions/58316109/yarn-cant-find-private-github-npm-registry) +## Node Renderer Setup -5. You can start the renderer with either the executable `node-renderer` or, preferably, with - a startup JS file, say called `react-on-rails-pro/react-on-rails-pro-node-renderer.js` with - these contents. \_Note the use of the namespaced **`@shakacode-tools/react-on-rails-pro-node-renderer`** for the package. +Create a JavaScript file to configure and launch the node renderer, for example `react-on-rails-pro-node-renderer.js`: ```js const path = require('path'); -const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); +const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer'); const env = process.env; @@ -112,34 +111,24 @@ const config = { // Listen at RENDERER_PORT env value or default port 3800 logLevel: env.RENDERER_LOG_LEVEL || 'debug', // show all logs - // See value in /config/initializers/react_on_rails_pro.rb. Should use env - // value in real app. - password: 'myPassword1', + // Password for Rails <-> Node renderer communication + // See value in /config/initializers/react_on_rails_pro.rb + password: env.RENDERER_PASSWORD || 'changeme', - // Save bundle to "tmp/bundles" dir of our dummy app - // This is the default port: env.RENDERER_PORT || 3800, // supportModules should be set to true to allow the server-bundle code to - // see require, exports, etc. - // `false` is like the ExecJS behavior - // this option is required to equal `true` in order to use loadable components + // see require, exports, etc. (`false` is like the ExecJS behavior) + // This option is required to equal `true` in order to use loadable components supportModules: true, // workersCount defaults to the number of CPUs minus 1 - workersCount: Number(process.env.NODE_RENDERER_CONCURRENCY || 3), - - // Next 2 params, allWorkersRestartInterval and - // delayBetweenIndividualWorkerRestarts must both should be set if you wish - // to have automatic worker restarting, say to clear memory leaks. - // time is in minutes between restarting all workers - // Enable next 2 if the renderer is running out of memory - // allWorkersRestartInterval: 15, - // time in minutes between each worker restarting when restarting all workers - // delayBetweenIndividualWorkerRestarts: 2, - // Also, you can set he parameter gracefulWorkerRestartTimeout to force the worker to restart - // If it's the time for the worker to restart, the worker waits until it serves all active requests before restarting - // If a worker stuck because of a memory leakage or an infinite loop, you can set a timeout that master waits for it before killing the worker + workersCount: Number(env.NODE_RENDERER_CONCURRENCY || 3), + + // Optional: Automatic worker restarting (for memory leak mitigation) + // allWorkersRestartInterval: 15, // minutes between restarting all workers + // delayBetweenIndividualWorkerRestarts: 2, // minutes between each worker restart + // gracefulWorkerRestartTimeout: undefined, // timeout for graceful worker restart; forces restart if worker stuck }; // Renderer detects a total number of CPUs on virtual hostings like Heroku @@ -152,50 +141,57 @@ if (env.CI) { reactOnRailsProNodeRenderer(config); ``` -## Instructions for using a branch - -Install the node-renderer executable, possibly globally. Substitute the branch name or tag for `master` +Add a script to your `package.json`: +```json +{ + "scripts": { + "node-renderer": "node ./react-on-rails-pro-node-renderer.js" + } +} ``` -yarn global add https://:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git\#master -``` - -This installs a binary `node-renderer`. -### Using Github packages - -Login into npm +Start the renderer: ```bash -npm install @shakacode-tools/react-on-rails-pro-node-renderer@ +npm run node-renderer ``` -or edit package.json directly +## Rails Configuration for Node Renderer -```json -"@shakacode-tools/react-on-rails-pro-node-renderer": "" -``` +Configure Rails to use the remote node renderer: -### Configuration +```ruby +# config/initializers/react_on_rails_pro.rb +ReactOnRailsPro.configure do |config| + config.server_renderer = "NodeRenderer" -See [NodeRenderer JavaScript Configuration](./node-renderer/js-configuration.md). + # Configure renderer connection + config.renderer_url = ENV["REACT_RENDERER_URL"] || "http://localhost:3800" + config.renderer_password = ENV["RENDERER_PASSWORD"] || "changeme" -#### Webpack Configuration + # Enable prerender caching (recommended) + config.prerender_caching = true +end +``` -Set your server bundle webpack configuration to use a target of `node` per the [Webpack docs](https://webpack.js.org/concepts/targets/#usage). +### Configuration Options -## Authentication when using Github packages +See [Rails Configuration Options](./configuration.md) for all available settings. -[Auth for the npm package](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm-for-use-with-github-packages#authenticating-to-github-packages) +Pay attention to: +- `config.server_renderer = "NodeRenderer"` - Required to use node renderer +- `config.renderer_url` - URL where your node renderer is running +- `config.renderer_password` - Shared secret for authentication +- `config.prerender_caching` - Enable caching (recommended) -Create a new ~/.npmrc file if one doesn't exist. +## Webpack Configuration -``` -//npm.pkg.github.com/:_authToken=TOKEN -``` +Set your server bundle webpack configuration to use a target of `node` per the [Webpack docs](https://webpack.js.org/concepts/targets/#usage). -To configure bundler if you don't want the token in your Gemfile: +## Additional Documentation -``` -bundle config https://rubygems.pkg.github.com/OWNER USERNAME:TOKEN -``` +- [Node Renderer Basics](./node-renderer/basics.md) +- [Node Renderer JavaScript Configuration](./node-renderer/js-configuration.md) +- [Rails Configuration Options](./configuration.md) +- [Error Reporting and Tracing](./node-renderer/error-reporting-and-tracing.md) diff --git a/react_on_rails_pro/docs/node-renderer/basics.md b/react_on_rails_pro/docs/node-renderer/basics.md index 1ad35caa73..84fdcffb1b 100644 --- a/react_on_rails_pro/docs/node-renderer/basics.md +++ b/react_on_rails_pro/docs/node-renderer/basics.md @@ -37,16 +37,16 @@ For the most control over the setup, create a JavaScript file to start the NodeR cd renderer-app ``` 2. Make sure you have **Node.js** version **14** or higher and **Yarn** installed. -3. Init node application and yarn add to install `@shakacode-tools/react-on-rails-pro-node-renderer` package. +3. Init node application and install the `react-on-rails-pro-node-renderer` package. ```sh yarn init - yarn add https://[your-github-token]:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git\#master + yarn add react-on-rails-pro-node-renderer ``` 4. Configure a JavaScript file that will launch the rendering server per the docs in [Node Renderer JavaScript Configuration](./js-configuration.md). For example, create a file `node-renderer.js`. Here is a simple example that uses all the defaults except for serverBundleCachePath: ```javascript import path from 'path'; - import reactOnRailsProNodeRenderer from '@shakacode-tools/react-on-rails-pro-node-renderer'; + import reactOnRailsProNodeRenderer from 'react-on-rails-pro-node-renderer'; const config = { serverBundleCachePath: path.resolve(__dirname, '../.node-renderer-bundles'), diff --git a/react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md b/react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md index 861afbb0fa..988c45bbc4 100644 --- a/react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md +++ b/react_on_rails_pro/docs/node-renderer/error-reporting-and-tracing.md @@ -14,10 +14,10 @@ It should initialize the services according to your requirements and then enable 3. Then load the integration: ```js - require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/sentry').init(); + require('react-on-rails-pro-node-renderer/integrations/sentry').init(); ``` - - Use `@shakacode-tools/react-on-rails-pro-node-renderer/integrations/sentry6` instead of `.../sentry` for versions of Sentry SDK older than 7.63.0. + - Use `react-on-rails-pro-node-renderer/integrations/sentry6` instead of `.../sentry` for versions of Sentry SDK older than 7.63.0. - For Sentry SDK v8+ you can use `.init({ fastify: true })` to capture additional Fastify-related information. ### Sentry Tracing @@ -40,7 +40,7 @@ To enable Sentry Tracing: 2. Then load the integration: ```js - require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/honeybadger').init(); + require('react-on-rails-pro-node-renderer/integrations/honeybadger').init(); ``` Use `init({ fastify: true })` to capture additional Fastify-related information. @@ -49,7 +49,7 @@ To enable Sentry Tracing: You can create your own integrations in the same way as the provided ones. If you have access to the React on Rails Pro repository, you can use [their implementations](https://github.com/shakacode/react_on_rails_pro/tree/master/packages/node-renderer/src/integrations) as examples. -Import these functions from `@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api`: +Import these functions from `react-on-rails-pro-node-renderer/integrations/api`: ### Error reporting services @@ -59,7 +59,7 @@ Import these functions from `@shakacode-tools/react-on-rails-pro-node-renderer/i For example, integrating with BugSnag can be as simple as ```js const Bugsnag = require('@bugsnag/js'); -const { addNotifier } = require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api'); +const { addNotifier } = require('react-on-rails-pro-node-renderer/integrations/api'); Bugsnag.start({ /* your options */ }); @@ -76,7 +76,7 @@ To track requests as [sessions](https://docs.bugsnag.com/platforms/javascript/ca the above example becomes ```js const Bugsnag = require('@bugsnag/js'); -const { addNotifier, setupTracing } = require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api'); +const { addNotifier, setupTracing } = require('react-on-rails-pro-node-renderer/integrations/api'); Bugsnag.start({ /* your options */ }); @@ -117,7 +117,7 @@ Bugsnag v7 is a bit more complicated: ```js const Bugsnag = require('@bugsnag/js'); -const { addNotifier, setupTracing } = require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api'); +const { addNotifier, setupTracing } = require('react-on-rails-pro-node-renderer/integrations/api'); Bugsnag.start({ /* your options */ }); @@ -142,7 +142,7 @@ If you want to report HTTP requests from Fastify, you can use `configureFastify` Extending the above example: ```js -const { configureFastify } = require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api'); +const { configureFastify } = require('react-on-rails-pro-node-renderer/integrations/api'); configureFastify((app) => { app.addHook('onError', (_req, _reply, error, done) => { diff --git a/react_on_rails_pro/docs/node-renderer/js-configuration.md b/react_on_rails_pro/docs/node-renderer/js-configuration.md index f90a24a934..86049efb38 100644 --- a/react_on_rails_pro/docs/node-renderer/js-configuration.md +++ b/react_on_rails_pro/docs/node-renderer/js-configuration.md @@ -57,7 +57,7 @@ Create a file './node-renderer.js' ```js import path from 'path'; -import { reactOnRailsProNodeRenderer } from '@shakacode-tools/react-on-rails-pro-node-renderer'; +import { reactOnRailsProNodeRenderer } from 'react-on-rails-pro-node-renderer'; const config = { // Save bundles to relative "./.node-renderer-bundles" dir of our app From ed816aa107fbf17fb161036be0ac9f64173b164b Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 23:11:36 +0200 Subject: [PATCH 4/9] Update test files and source code with unscoped package name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix ESLint errors from CI by updating all remaining references from @shakacode-tools/react-on-rails-pro-node-renderer to react-on-rails-pro-node-renderer. Files updated: - react_on_rails_pro/spec/dummy/client/node-renderer.js (3 requires) - react_on_rails_pro/packages/node-renderer/src/integrations/api.ts (JSDoc example) - react_on_rails_pro/spec/dummy/package.json (dependency + yalc link) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../packages/node-renderer/src/integrations/api.ts | 2 +- react_on_rails_pro/spec/dummy/client/node-renderer.js | 6 +++--- react_on_rails_pro/spec/dummy/package.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/react_on_rails_pro/packages/node-renderer/src/integrations/api.ts b/react_on_rails_pro/packages/node-renderer/src/integrations/api.ts index 62a94e8d04..88e2e2e14e 100644 --- a/react_on_rails_pro/packages/node-renderer/src/integrations/api.ts +++ b/react_on_rails_pro/packages/node-renderer/src/integrations/api.ts @@ -4,7 +4,7 @@ * @example * ```ts * import Bugsnag from '@bugsnag/js'; - * import { addNotifier, setupTracing } from '@shakacode-tools/react-on-rails-pro-node-renderer/integrations/api'; + * import { addNotifier, setupTracing } from 'react-on-rails-pro-node-renderer/integrations/api'; * Bugsnag.start({ ... }); * * addNotifier((msg) => { Bugsnag.notify(msg); }); diff --git a/react_on_rails_pro/spec/dummy/client/node-renderer.js b/react_on_rails_pro/spec/dummy/client/node-renderer.js index f5f2a5c400..67f390b45a 100644 --- a/react_on_rails_pro/spec/dummy/client/node-renderer.js +++ b/react_on_rails_pro/spec/dummy/client/node-renderer.js @@ -5,14 +5,14 @@ const Sentry = require('@sentry/node'); const { env } = process; // Use this for package installation test: -const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); +const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer'); Honeybadger.configure({ // This is a test account for React on Rails Pro. Substitute your own. apiKey: 'a602365c', environment: process.env.NODE_ENV ?? 'development', }); -require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/honeybadger').init(); +require('react-on-rails-pro-node-renderer/integrations/honeybadger').init(); // This is a test account for React on Rails Pro. // Substitute your own DSN. @@ -25,7 +25,7 @@ Sentry.init({ // Sentry recommends adjusting this value in production, or using tracesSampler for finer control tracesSampleRate: 1.0, }); -require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/sentry').init({ tracing: true }); +require('react-on-rails-pro-node-renderer/integrations/sentry').init({ tracing: true }); const config = { // This is the default but avoids searching for the Rails root diff --git a/react_on_rails_pro/spec/dummy/package.json b/react_on_rails_pro/spec/dummy/package.json index a85f8492b0..01accb61e7 100644 --- a/react_on_rails_pro/spec/dummy/package.json +++ b/react_on_rails_pro/spec/dummy/package.json @@ -17,7 +17,7 @@ "@loadable/server": "^5.16.2", "@loadable/webpack-plugin": "^5.15.2", "@sentry/node": "^7.120.0", - "@shakacode-tools/react-on-rails-pro-node-renderer": "link:.yalc/@shakacode-tools/react-on-rails-pro-node-renderer", + "react-on-rails-pro-node-renderer": "link:.yalc/react-on-rails-pro-node-renderer", "@shakacode/use-ssr-computation.macro": "^1.2.4", "@shakacode/use-ssr-computation.runtime": "^2.0.0", "@webpack-cli/serve": "^1.6.0", @@ -98,7 +98,7 @@ "test": "yarn run build:test && yarn run lint && rspec", "lint": "cd ../.. && nps lint", "e2e-test": "playwright test", - "preinstall": "yarn run link-source && yalc add --link react-on-rails-pro && cd .yalc/react-on-rails-pro && yalc add --link react-on-rails && cd ../.. && yalc add --link @shakacode-tools/react-on-rails-pro-node-renderer", + "preinstall": "yarn run link-source && yalc add --link react-on-rails-pro && cd .yalc/react-on-rails-pro && yalc add --link react-on-rails && cd ../.. && yalc add --link react-on-rails-pro-node-renderer", "link-source": "cd ../../.. && yarn && yarn run yalc:publish && cd react_on_rails_pro && yarn && yalc publish", "postinstall": "test -f post-yarn-install.local && ./post-yarn-install.local || true", "build:test": "rm -rf public/webpack/test && rm -rf ssr-generated && RAILS_ENV=test NODE_ENV=test bin/shakapacker", From 455cc4b4100a7262e41d673a7705df1ec3cb36ad Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 23:20:20 +0200 Subject: [PATCH 5/9] Fix package name in build script error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update error message from @shakacode-tools/react-on-rails-pro-node-renderer to react-on-rails-pro-node-renderer in package-scripts.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- react_on_rails_pro/package-scripts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react_on_rails_pro/package-scripts.yml b/react_on_rails_pro/package-scripts.yml index f9971f10a0..b075e8b745 100644 --- a/react_on_rails_pro/package-scripts.yml +++ b/react_on_rails_pro/package-scripts.yml @@ -47,7 +47,7 @@ scripts: [ -f packages/node-renderer/dist/ReactOnRailsProNodeRenderer.js ] || (nps build >/dev/null 2>&1 || true) && [ -f packages/node-renderer/dist/ReactOnRailsProNodeRenderer.js ] || - { echo 'Building @shakacode-tools/react-on-rails-pro-node-renderer seems to have failed!'; } + { echo 'Building react-on-rails-pro-node-renderer seems to have failed!'; } clean: description: Clean the project From 87c7877603efa24e298b9052100b504f05715975 Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 23:36:35 +0200 Subject: [PATCH 6/9] Update yarn.lock for unscoped node-renderer package name --- react_on_rails_pro/spec/dummy/yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/react_on_rails_pro/spec/dummy/yarn.lock b/react_on_rails_pro/spec/dummy/yarn.lock index 4474c54076..c82367c3a0 100644 --- a/react_on_rails_pro/spec/dummy/yarn.lock +++ b/react_on_rails_pro/spec/dummy/yarn.lock @@ -1228,10 +1228,6 @@ dependencies: "@sentry/types" "7.120.0" -"@shakacode-tools/react-on-rails-pro-node-renderer@link:.yalc/@shakacode-tools/react-on-rails-pro-node-renderer": - version "0.0.0" - uid "" - "@shakacode/use-ssr-computation.macro@^1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@shakacode/use-ssr-computation.macro/-/use-ssr-computation.macro-1.2.4.tgz#b247d683e3133126dbdb42060c26e1c34a8b625d" @@ -5461,6 +5457,10 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.7.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +"react-on-rails-pro-node-renderer@link:.yalc/react-on-rails-pro-node-renderer": + version "0.0.0" + uid "" + "react-on-rails-pro@link:.yalc/react-on-rails-pro": version "0.0.0" uid "" From b160ad7d3eeb00503139aebf801a227ee535bf42 Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 5 Nov 2025 23:57:04 +0200 Subject: [PATCH 7/9] Update repository URL and add license token security warning --- react_on_rails_pro/docs/installation.md | 2 ++ react_on_rails_pro/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/react_on_rails_pro/docs/installation.md b/react_on_rails_pro/docs/installation.md index 0d6e899ca4..61ca31cdf1 100644 --- a/react_on_rails_pro/docs/installation.md +++ b/react_on_rails_pro/docs/installation.md @@ -53,6 +53,8 @@ ReactOnRailsPro.configure do |config| end ``` +⚠️ **Security Warning**: Never commit your license token to version control. Always use environment variables or secure secret management systems (like Rails credentials, Heroku config vars, AWS Secrets Manager, etc.). + ## Rails Configuration You don't need to create an initializer if you are satisfied with the defaults as described in [Configuration](./configuration.md). diff --git a/react_on_rails_pro/package.json b/react_on_rails_pro/package.json index e501780e37..f60a47c8b9 100644 --- a/react_on_rails_pro/package.json +++ b/react_on_rails_pro/package.json @@ -116,7 +116,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/shakacode-tools/react_on_rails_pro.git" + "url": "git+https://github.com/shakacode/react_on_rails.git" }, "keywords": [ "react", From 0db08130f319aba4947af40dbca83285883a1ee0 Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 12 Nov 2025 20:48:37 +0200 Subject: [PATCH 8/9] Add migration guide and clarify release script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add comprehensive migration guide in react_on_rails_pro/docs/updating.md - Shows users their current GitHub Packages setup - Provides step-by-step migration to public distribution - Includes verification and troubleshooting sections - Add explanatory comment in release.rake for node-renderer publish command - Clarifies why plain 'yarn publish' is used instead of 'yarn workspace' Addresses code review feedback from Claude AI review 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- rakelib/release.rake | 2 + react_on_rails_pro/docs/updating.md | 224 ++++++++++++++++++++++++++-- 2 files changed, 211 insertions(+), 15 deletions(-) diff --git a/rakelib/release.rake b/rakelib/release.rake index 4e3d98dcf0..ce05a40fbd 100644 --- a/rakelib/release.rake +++ b/rakelib/release.rake @@ -213,6 +213,8 @@ task :release, %i[version dry_run registry skip_push] do |_t, args| puts "=" * 80 # Publish react-on-rails-pro-node-renderer NPM package + # Note: Uses plain `yarn publish` (not `yarn workspace`) because the node-renderer + # package.json is in react_on_rails_pro/ which is not defined as a workspace node_renderer_name = "react-on-rails-pro-node-renderer" puts "\nPublishing #{node_renderer_name}@#{actual_npm_version}..." puts "Carefully add your OTP for NPM when prompted." unless use_verdaccio diff --git a/react_on_rails_pro/docs/updating.md b/react_on_rails_pro/docs/updating.md index 4e761ee91d..aa7727b2e9 100644 --- a/react_on_rails_pro/docs/updating.md +++ b/react_on_rails_pro/docs/updating.md @@ -1,25 +1,219 @@ -# Using a Branch Rather Than a Published Package -_And Old Installation Instructions_ +# Upgrading React on Rails Pro -## Get the oauth token from justin@shakacode.com +## Upgrading from GitHub Packages to Public Distribution -* ShakaCode does: - * Creates a github user, like customer-rorp with email customer-rorp@shakacode.com created via a Google apps group. - * Confirm email for account - * Add user to have read-only access for shakacode/react_on_rails_pro - * Create an auth token for this user. +### Who This Guide is For +This guide is for existing React on Rails Pro customers who are: -## Update the Gemfile +- Currently using GitHub Packages authentication (private distribution) +- On version 16.2.0-beta.x or earlier +- Upgrading to version 16.2.0 or higher + +If you're a new customer, see [Installation](./installation.md) instead. + +### What's Changing + +React on Rails Pro packages are now **publicly distributed** via npmjs.org and RubyGems.org: + +- ✅ No more GitHub Personal Access Tokens (PATs) +- ✅ No more `.npmrc` configuration +- ✅ Simplified installation with standard `gem install` and `npm install` +- ✅ License validation now happens at **runtime** using JWT tokens + +Package names have changed: + +- **Scoped** (old): `@shakacode-tools/react-on-rails-pro-node-renderer` +- **Unscoped** (new): `react-on-rails-pro-node-renderer` + +### Your Current Setup (GitHub Packages) + +If you're upgrading, you currently have: + +**1. Gemfile with GitHub Packages source:** + +```ruby +source "https://rubygems.pkg.github.com/shakacode-tools" do + gem "react_on_rails_pro", "16.1.1" +end +``` + +**2. `.npmrc` file with GitHub authentication:** + +``` +always-auth=true +//npm.pkg.github.com/:_authToken=YOUR_TOKEN +@shakacode-tools:registry=https://npm.pkg.github.com +``` + +**3. Scoped package name in package.json:** + +```json +{ + "private": true, + "dependencies": { + "@shakacode-tools/react-on-rails-pro-node-renderer": "16.1.1" + } +} +``` + +**4. Scoped require statements:** + +```javascript +const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); +``` + +### Migration Steps + +#### Step 1: Update Gemfile + +**Remove** the GitHub Packages source and use standard gem installation: + +```diff +- source "https://rubygems.pkg.github.com/shakacode-tools" do +- gem "react_on_rails_pro", "16.1.1" +- end ++ gem "react_on_rails_pro", "~> 16.2" +``` + +Then run: + +```bash +bundle install +``` + +#### Step 2: Remove .npmrc Configuration + +If you have a `.npmrc` file with GitHub Packages authentication, **delete it** or remove the GitHub-specific lines: + +```bash +# Remove the entire file if it only contained GitHub Packages config +rm .npmrc + +# Or edit it to remove these lines: +# always-auth=true +# //npm.pkg.github.com/:_authToken=YOUR_TOKEN +# @shakacode-tools:registry=https://npm.pkg.github.com +``` + +#### Step 3: Update package.json + +Change the package name from **scoped** to **unscoped**: + +```diff +{ + "dependencies": { +- "@shakacode-tools/react-on-rails-pro-node-renderer": "16.1.1" ++ "react-on-rails-pro-node-renderer": "^16.2.0" + } +} +``` + +Then reinstall: + +```bash +npm install +# or +yarn install +``` + +#### Step 4: Update Require Statements + +Update all require/import statements to use the **unscoped** package name: + +**In your node renderer configuration file:** + +```diff +- const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer'); ++ const { reactOnRailsProNodeRenderer } = require('react-on-rails-pro-node-renderer'); +``` + +**If using integrations (Sentry, Honeybadger):** + +```diff +- require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/sentry').init(); ++ require('react-on-rails-pro-node-renderer/integrations/sentry').init(); + +- require('@shakacode-tools/react-on-rails-pro-node-renderer/integrations/honeybadger').init(); ++ require('react-on-rails-pro-node-renderer/integrations/honeybadger').init(); +``` + +#### Step 5: Configure License Token + +Add your React on Rails Pro license token as an environment variable: + +```bash +export REACT_ON_RAILS_PRO_LICENSE="your-license-token-here" +``` + +**Or** configure it in your Rails initializer: ```ruby -CUSTOMER_GITHUB_AUTH = '3f5fblahblahblah:x-oauth-basic' -gem "react_on_rails_pro", git: "https://#{CUSTOMER_GITHUB_AUTH}@github.com/shakacode/react_on_rails_pro.git", tag: '1.0.0' +# config/initializers/react_on_rails_pro.rb +ReactOnRailsPro.configure do |config| + config.license_token = ENV["REACT_ON_RAILS_PRO_LICENSE"] +end +``` + +⚠️ **Security Warning**: Never commit your license token to version control. Always use environment variables or secure secret management systems (Rails credentials, Heroku config vars, AWS Secrets Manager, etc.). + +**Where to get your license token:** Contact [justin@shakacode.com](mailto:justin@shakacode.com) if you don't have your license token. + +### Verify Migration + +#### 1. Verify Gem Installation + +```bash +bundle list | grep react_on_rails_pro +# Should show: react_on_rails_pro (16.2.0) or higher +``` + +#### 2. Verify NPM Package Installation + +```bash +npm list react-on-rails-pro-node-renderer +# or +yarn list --pattern react-on-rails-pro-node-renderer + +# Should show: react-on-rails-pro-node-renderer@16.2.0 or higher ``` -## Update the client/package.json +#### 3. Verify License Token + +Start your Rails server. You should see a success message in the logs: -```sh -CUSTOMER_GITHUB_AUTH=3f5fblahblahblah -yarn add https://${CUSTOMER_GITHUB_AUTH}:x-oauth-basic@github.com/shakacode/react_on_rails_pro.git\#1.0.0 ``` +React on Rails Pro license validated successfully +``` + +If the license is invalid or missing, you'll see an error with instructions. + +#### 4. Test Your Application + +- Start your Rails server +- Start the node renderer (if using): `npm run node-renderer` +- Verify that server-side rendering works correctly + +### Troubleshooting + +#### "Could not find gem 'react_on_rails_pro'" + +- Ensure you removed the GitHub Packages source from your Gemfile +- Run `bundle install` again +- Check that you have the correct version specified + +#### "Cannot find module 'react-on-rails-pro-node-renderer'" + +- Verify you updated all require statements to the unscoped name +- Delete `node_modules` and reinstall: `rm -rf node_modules && npm install` +- Check that package.json has the correct unscoped package name + +#### "License validation failed" + +- Ensure `REACT_ON_RAILS_PRO_LICENSE` environment variable is set +- Verify the token string is correct (no extra spaces or quotes) +- Contact [justin@shakacode.com](mailto:justin@shakacode.com) if you need a new token + +### Need Help? + +If you encounter issues during migration, contact [justin@shakacode.com](mailto:justin@shakacode.com) for support. From 65e8d3729434c803a1331bf2bd434f2d2fffc45f Mon Sep 17 00:00:00 2001 From: ihabadham Date: Wed, 12 Nov 2025 21:17:13 +0200 Subject: [PATCH 9/9] Fix repository URLs and update Pro installation docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix bugs/homepage URLs in package.json to point to monorepo - Add prominent link to upgrading guide in installation.md - Update version examples to 16.2 for consistency with release Addresses Claude AI review feedback on PR #1901 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- react_on_rails_pro/docs/installation.md | 8 ++++++-- react_on_rails_pro/package.json | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/react_on_rails_pro/docs/installation.md b/react_on_rails_pro/docs/installation.md index 61ca31cdf1..e5f61a211d 100644 --- a/react_on_rails_pro/docs/installation.md +++ b/react_on_rails_pro/docs/installation.md @@ -2,11 +2,14 @@ React on Rails Pro packages are published publicly on npmjs.org and RubyGems.org. Installation requires a valid **license token** for runtime validation. Contact [justin@shakacode.com](mailto:justin@shakacode.com) to purchase a license. +**Upgrading from GitHub Packages?** See the [Upgrading Guide](./updating.md) for migration instructions. + Check the [CHANGELOG](https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md) to see what version you want. ## Version Format For the below docs, find the desired `` in the CHANGELOG. Note that for pre-release versions: + - Gems use all periods: `16.2.0.beta.1` - NPM packages use dashes: `16.2.0-beta.1` @@ -21,7 +24,7 @@ Ensure your **Rails** app is using the **react_on_rails** gem, version 16.0.0 or Add the `react_on_rails_pro` gem to your **Gemfile**: ```ruby -gem "react_on_rails_pro", "~> 16.1" +gem "react_on_rails_pro", "~> 16.2" ``` Then run: @@ -92,7 +95,7 @@ yarn add react-on-rails-pro-node-renderer ```json { "dependencies": { - "react-on-rails-pro-node-renderer": "16.1.1" + "react-on-rails-pro-node-renderer": "^16.2.0" } } ``` @@ -182,6 +185,7 @@ end See [Rails Configuration Options](./configuration.md) for all available settings. Pay attention to: + - `config.server_renderer = "NodeRenderer"` - Required to use node renderer - `config.renderer_url` - URL where your node renderer is running - `config.renderer_password` - Shared secret for authentication diff --git a/react_on_rails_pro/package.json b/react_on_rails_pro/package.json index f60a47c8b9..e7b85fb568 100644 --- a/react_on_rails_pro/package.json +++ b/react_on_rails_pro/package.json @@ -129,9 +129,9 @@ "author": "justin@shakacode.com", "license": "UNLICENSED", "bugs": { - "url": "https://github.com/shakacode/react_on_rails_pro/issues" + "url": "https://github.com/shakacode/react_on_rails/issues" }, - "homepage": "https://github.com/shakacode/react_on_rails_pro#readme", + "homepage": "https://github.com/shakacode/react_on_rails/tree/master/react_on_rails_pro#readme", "jest": { "clearMocks": true, "collectCoverageFrom": [