React on Rails Pro

Performance enhancements and advanced features for React on Rails.
See the CHANGELOG for release updates and upgrade details.
π Table of Contents
π― What is React on Rails Pro?
React on Rails Pro is a commercial extension to the open-source React on Rails gem that provides advanced performance optimizations and enterprise features for Rails applications using React.
Key Points:
- Requires: React on Rails (open-source) as a foundation
- Location: Part of the React on Rails monorepo at
react_on_rails_pro/
- Free for: Non-commercial use, development, testing, and evaluation (with registration)
- Commercial license: Required for production deployments
How It Relates to React on Rails
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β React on Rails Pro (this package) β
β β’ SSR performance enhancements β
β β’ React Server Components β
β β’ Advanced caching β
β β’ Node.js rendering pool β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β React on Rails (open-source, required) β
β β’ Basic SSR β
β β’ Component registration β
β β’ Rails integration β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
π License & Pricing
License Types
π Free License (Non-Commercial)
- Duration: 3 months (renewable)
- Usage: Personal projects, evaluation, development, testing, CI/CD
- Restrictions: NOT for production deployments
- Cost: FREE - just register with your email
- Get it: https://shakacode.com/react-on-rails-pro
β οΈ Important: All environments (development, test, CI) require a valid license. The free license is perfect for these use cases!
πΌ Commercial License (Production)
- Duration: 1 year subscription (or longer)
- Usage: Production deployments and commercial applications
- Support: Professional support included
- Contact: justin@shakacode.com for pricing
Quick License Setup
Get your FREE license in 30 seconds:
π Detailed setup instructions: See LICENSE_SETUP.md for complete configuration guide, team setup, CI/CD integration, and troubleshooting.
π Why Use Pro?
Real-World Performance Gains
React on Rails Pro delivers measurable performance improvements for production applications:
Case Study: Popmenu
- 73% decrease in average response times
- 20-25% reduction in Heroku costs
- Tens of millions of SSR requests served daily
- Read the full case study β
When You Need Pro
Consider React on Rails Pro if you:
- β
Need faster server-side rendering for SEO and initial page loads
- β
Want advanced caching to reduce server load
- β
Require React Server Components (RSC) support
- β
Need streaming SSR for progressive rendering
- β
Want code splitting with React Router or loadable-components
- β
Have high-traffic applications where performance matters
- β
Need professional support for your Rails + React stack
Pro vs. Open Source
| Basic SSR | β
| β
|
| Component Registration | β
| β
|
| Rails Integration | β
| β
|
| Fragment Caching | β | β
|
| Prerender Caching | β | β
|
| Proper Node Renderer | β | β
|
| React Server Components | β | β
|
| Streaming SSR | β | β
|
| Code Splitting (SSR) | β | β
|
| Bundle Caching | β | β
|
| Professional Support | β | β
|
β¨ Key Features
1. Fragment Caching
Cache React components at the Rails view layer with intelligent cache key generation.
<%= cached_react_component("UserProfile", cache_key: [@user]) do
{ user_id: @user.id }
end %>
<%= cached_react_component("ExpensiveComponent", cache_key: [@user, @post]) do
expensive_calculation
end %>
Benefits:
- Reduces server rendering time by 80%+ for repeated renders
- Automatic cache invalidation based on props
- Works with Rails fragment caching infrastructure
π Learn more: docs/caching.md
2. Prerender Caching
Cache the JavaScript evaluation results on the Node.js side.
ReactOnRailsPro.configure do |config|
config.prerender_caching = true
end
Benefits:
- Dramatically reduces Node.js CPU usage
- Caches across multiple requests
- Complements fragment caching for maximum performance
π Learn more: docs/caching.md
3. React on Rails Pro Node Renderer
High-performance standalone Node.js server for server-side rendering with connection pooling and automatic worker management.
Key Advantages:
- Parallel rendering: Multiple worker processes for concurrent SSR
- Memory management: Automatic worker restarts to prevent leaks
- Better performance: Up to 10x faster than ExecJS for high-traffic sites
- Loadable Components: Full support for code splitting with SSR
Example Configuration:
const { reactOnRailsProNodeRenderer } = require('@shakacode-tools/react-on-rails-pro-node-renderer');
reactOnRailsProNodeRenderer({
bundlePath: path.resolve(__dirname, '../app/assets/webpack'),
port: 3800,
workersCount: 4,
supportModules: true,
});
π Learn more: docs/node-renderer/basics.md
4. React Server Components (RSC)
Full support for React 18+ Server Components with streaming.
<%= stream_react_component("MyServerComponent", props: @props) %>
<%= cached_stream_react_component("MyServerComponent", props: @props) %>
Benefits:
- Reduce JavaScript bundle size
- Fetch data on the server
- Progressive rendering with Suspense
- Automatic code splitting
π Learn more: Contact justin@shakacode.com for RSC documentation
5. Bundle Caching
Speed up webpack rebuilds by caching unchanged bundles.
Benefits:
- Faster CI/CD: Skip rebuilding unchanged bundles
- Faster development: Hot reload only what changed
- Lower costs: Reduce build server time
π Learn more: docs/bundle-caching.md
6. Global State Management
Prevent state leaks between SSR requests.
ReactOnRailsPro.configure do |config|
config.ssr_pre_hook_js = "global.myLeakyLib && global.myLeakyLib.reset();"
end
π Learn more: docs/configuration.md
π Requirements
Prerequisites
- Ruby: >= 3.0
- Rails: >= 6.0 (recommended: 7.0+)
- React on Rails: >= 11.0.7 (recommended: latest)
- Node.js: >= 18 (for Node Renderer)
- React: >= 16.8 (recommended: 18+ for RSC/Streaming)
Compatibility Matrix
| 4.x | >= 16.0 | >= 7.0 | >= 3.2 | >= 18 |
| 3.x | >= 13.0 | >= 6.0 | >= 3.0 | >= 16.8 |
π Check compatibility: See CHANGELOG.md for version-specific requirements
π Getting Started
Quick Start (5 Minutes)
1. Get a License
Visit https://shakacode.com/react-on-rails-pro to get your FREE license (takes 30 seconds).
2. Set License Environment Variable
export REACT_ON_RAILS_PRO_LICENSE="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
3. Install the Gem
Since React on Rails Pro is part of the public monorepo, you can install it directly from GitHub:
gem 'react_on_rails_pro', '~> 4.0'
Or use a specific version/tag:
gem 'react_on_rails_pro', git: 'https://github.com/shakacode/react_on_rails.git',
glob: 'react_on_rails_pro/*.gemspec',
tag: 'v4.0.0'
Then run:
bundle install
4. Configure (Optional)
Create config/initializers/react_on_rails_pro.rb:
ReactOnRailsPro.configure do |config|
config.prerender_caching = true
end
5. Verify Installation
rails console
> ReactOnRails::Utils.react_on_rails_pro?
π Done! You're now using React on Rails Pro.
Next Steps
π Documentation
Installation & Setup
Features
API Reference
- Ruby API - Helper methods and utilities
- CHANGELOG - Version history and upgrade notes
Upgrading
π‘ Examples
Example Application
The Pro dummy app demonstrates all features in action:
Location: spec/dummy (in this monorepo)
Features Demonstrated:
- β
Fragment caching with
cached_react_component
- β
Prerender caching configuration
- β
Node Renderer with loadable-components
- β
Streaming SSR (React 18+)
- β
React Server Components
- β
Code splitting with SSR
- β
HMR with loadable-components
Running the Example:
cd react_on_rails_pro/spec/dummy
bundle install
yarn install
bin/dev
Visit http://localhost:3000 to see the examples.
π Learn more: See spec/dummy/README.md
Real-World Examples
Check out these production applications using React on Rails Pro:
- Popmenu - Restaurant digital marketing platform (case study)
π¬ Support & Contact
Getting Help
Professional Services
Need help with your React on Rails project?
ShakaCode offers:
- π Performance optimization
- β¬οΈ React on Rails upgrades
- ποΈ Architecture consulting
- π Team training
- π§ Custom development
Book a consultation β with Justin Gordon, creator of React on Rails.
About ShakaCode
React on Rails Pro is developed and maintained by ShakaCode, the team behind:
β FAQ
Licensing Questions
Q: Is React on Rails Pro free?
A: Yes for non-commercial use! You get a FREE 3-month license (renewable) for:
- Personal projects
- Evaluation and testing
- Development environments
- CI/CD
Production deployments require a commercial license. Learn more β
Q: Do I need a license for development?
A: Yes, but it's FREE! Register at shakacode.com/react-on-rails-pro to get your free 3-month license in 30 seconds (no credit card required).
Q: Can multiple developers share one license?
A: Yes! All developers in an organization can share the same license. You can use a shared license via environment variable or configuration file. See team setup β
Q: What happens when my free license expires?
A:
- Development/Test: Application fails to start immediately (helps catch expiration early)
- Production: 1-month grace period with warnings, then fails to start
- Solution: Get a new free license or purchase a commercial license
Q: How much does a commercial license cost?
A: Pricing is customized based on your needs. Contact justin@shakacode.com for a quote.
Technical Questions
Q: What's the difference between Pro and open-source React on Rails?
A: Pro adds performance features on top of the open-source gem:
- Advanced caching (fragment + prerender)
- Proper Node.js rendering pool
- React Server Components
- Streaming SSR
- Immediate hydration
- Code splitting with SSR support
See full comparison β
Q: Do I need the Node Renderer?
A: No, it's optional but recommended. The Node Renderer provides the best performance for high-traffic sites and is required for:
- Loadable-components with SSR
- React Server Components
- Streaming SSR
For apps that do not require advanced performance features, ExecJS (the default) works fine.
Q: Is React on Rails Pro compatible with my React version?
A: Pro works with React 16.8+. For React Server Components and Streaming SSR, you need React 18+. See requirements β
Q: Can I use Pro with Vite instead of Webpack/Shakapacker?
A: The Node Renderer currently expects webpack bundles. For Vite support, contact justin@shakacode.com.
Q: Does Pro work with TypeScript?
A: Yes! Pro works seamlessly with TypeScript applications.
Q: How do I upgrade from an older Pro version?
A: Check the CHANGELOG for breaking changes and migration steps. For major upgrades, we recommend professional support: justin@shakacode.com
Getting Started Questions
Q: Where do I start?
A: Follow our Quick Start guide - you can be up and running in 5 minutes!
Q: Can I try Pro before buying?
A: Yes! Get a FREE 3-month license to evaluate all features. No credit card required. Get started β
Q: Is there a demo application?
A: Yes! The spec/dummy app demonstrates all Pro features. See examples β
π License
React on Rails Pro is commercial software. See LICENSE for the complete license agreement.
Summary:
- β
Free for non-commercial use (personal, evaluation, development, testing)
- πΌ Commercial license required for production deployments
- π§ Questions? Contact justin@shakacode.com
Get your FREE license: https://shakacode.com/react-on-rails-pro
π€ Contributing
React on Rails Pro is part of the React on Rails monorepo. For contribution guidelines, see:
Note: Pro features are developed by the ShakaCode team and licensed customers only.
Made with β€οΈ by ShakaCode