Socket
Book a DemoInstallSign in
Socket

react-on-rails-pro-node-renderer

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-on-rails-pro-node-renderer

react-on-rails-pro JavaScript for react_on_rails_pro Ruby gem

Source
npmnpm
Version
16.2.0-beta.12
Version published
Weekly downloads
166
-76.85%
Maintainers
1
Weekly downloads
Β 
Created
Source

React on Rails Pro

License Build Integration Tests Build Lint Build Package Tests

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:

  • Visit https://shakacode.com/react-on-rails-pro
  • Register with your email
  • Receive your license token immediately
  • Set environment variable:
    export REACT_ON_RAILS_PRO_LICENSE="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
    

πŸ“– 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

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

FeatureOpen SourcePro
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.

# Cache component output with automatic cache key from props
<%= cached_react_component("UserProfile", cache_key: [@user]) do
  { user_id: @user.id }
end %>

# Lazy evaluation of props - only evaluated on cache miss
<%= 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.

# In config/initializers/react_on_rails_pro.rb
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:

// react-on-rails-pro/react-on-rails-pro-node-renderer.js
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, // Required for loadable-components
});

πŸ“– Learn more: docs/node-renderer/basics.md

4. React Server Components (RSC)

Full support for React 18+ Server Components with streaming.

# Stream React Server Components
<%= stream_react_component("MyServerComponent", props: @props) %>

# Or with caching
<%= 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|
  # Run JavaScript before each render to clear global state
  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

React on Rails ProReact on RailsRailsRubyReact
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

# Add to .env or your shell profile
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:

# Gemfile
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|
  # Enable prerender caching for performance
  config.prerender_caching = true
end

5. Verify Installation

rails console
> ReactOnRails::Utils.react_on_rails_pro?
# => true

πŸŽ‰ 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:

# From the monorepo root
cd react_on_rails_pro/spec/dummy
bundle install
yarn install

# Start the Rails app
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

ShakaCode

Keywords

react

FAQs

Package last updated on 21 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts