docs/pro/upgrading-to-pro.md
Already using React on Rails? Upgrading to Pro is straightforward: swap the gem and npm package with their Pro equivalents, then run the Pro generator. The upgrade is safe, reversible, and free to evaluate.
[!NOTE] Summary for AI agents: Use this page when the user already has OSS React on Rails and wants to upgrade to Pro. The upgrade is three steps: swap the gem, swap the npm package, run the generator. Remember the pairing rule:
react_on_rails_progem pairs withreact-on-rails-pronpm package (never with the basereact-on-rails).
Pro adds performance and rendering features on top of everything in React on Rails OSS:
config.prerender_caching) - Cache JavaScript evaluation results across requestsPro includes core React on Rails as a dependency — just swap the packages and everything continues to work.
Version note: Replace
VERSIONbelow with the latest version from the CHANGELOG. React on Rails requires exact gem/npm version parity — use=for the gem and--save-exact/--exactfor npm. After upgrading to 16.5.0+, runbundle exec rake react_on_rails:sync_versionsto verify versions are aligned.RC versions: RubyGems and npm use different pre-release separators — e.g.,
VERSION.rc.9on RubyGems (dots) vsVERSION-rc.9on npm (hyphen).
Replace react_on_rails with react_on_rails_pro in your Gemfile. Pro depends on the core gem, so you only need the Pro entry:
gem "react_on_rails_pro", "= VERSION"
Then run bundle install.
Or use the command line, which handles both the Gemfile edits and install:
bundle remove react_on_rails
bundle add react_on_rails_pro --version="= VERSION"
Important:
bundle adddoes not remove existing gems. You must runbundle removefirst, otherwise both gems will appear in your Gemfile, which can cause Bundler warnings or version conflicts.
Replace react-on-rails with react-on-rails-pro:
# npm
npm uninstall react-on-rails && npm install react-on-rails-pro@VERSION --save-exact
# yarn
yarn remove react-on-rails && yarn add react-on-rails-pro@VERSION --exact
# pnpm
pnpm remove react-on-rails && pnpm add react-on-rails-pro@VERSION --save-exact
# bun
bun remove react-on-rails && bun add react-on-rails-pro@VERSION --exact
Then update your imports:
- import ReactOnRails from 'react-on-rails';
+ import ReactOnRails from 'react-on-rails-pro';
The Pro package re-exports everything from core, so no other import changes are needed.
bundle exec rails generate react_on_rails:pro
This adds the Pro initializer, configures webpack for Pro features, and sets up the Node renderer entry point and configuration.
After the generator runs, verify everything works:
bundle exec rails react_on_rails:doctor
bin/dev
That's it. Your app is now running React on Rails Pro.
If you're setting up a new app (not upgrading an existing one), use the --pro flag:
bundle add react_on_rails_pro --version="= VERSION"
bundle exec rails generate react_on_rails:install --pro
React on Rails Pro is free to try — no license token is needed for local development, testing, CI/CD, or staging environments. Install it, experiment with the features, and see the performance difference in your own app before making any purchasing decisions.
A paid license is required for all production deployments. Startups and small companies should contact [email protected] for discounted pricing. Visit pro.reactonrails.com for details. When you're ready, set the token as an environment variable:
export REACT_ON_RAILS_PRO_LICENSE="your-license-token-here"
If you're a startup or team with limited budget, don't let cost be a barrier — email [email protected] and we'll work something out. For larger companies, your license supports continued development of the open-source project.
See LICENSE_SETUP.md for complete license configuration.
Switching to Pro is safe to reverse. To go back to OSS:
react_on_rails_pro with react_on_rails in your Gemfile and run bundle installreact-on-rails-pro with react-on-rails in package.json and update importsconfig/initializers/react_on_rails_pro.rb)Pro-only features (fragment caching, Node renderer, RSC) will stop working, but all standard React on Rails functionality continues unchanged.