This application demonstrates React on Rails v15's file-system-based automated bundle generation with intelligent bundle splitting and server-side rendering.
π Repository: https://github.com/shakacode/test-react-on-rails-v15-hello-world-on-rails-v8
- Clone:
git clone https://github.com/shakacode/test-react-on-rails-v15-hello-world-on-rails-v8.git - Install dependencies:
bundle && npm install - Generate component packs:
bundle exec rake react_on_rails:generate_packs - Start development server:
./bin/dev - Visit the demo: http://localhost:3000
- Installation Troubleshooting - Fix common setup issues including "package.json not found"
- Architecture Overview - System design, bundle splitting, and component patterns
- SSR + Dynamic Imports Guide - Solving FOUC with skeleton loaders and progressive enhancement
- Production Testing Guide - Testing production builds and CSS loading behavior
| Component | Bundle Size | Pattern | Use Case |
|---|---|---|---|
| HelloWorld | 12.5KB (10.0KB JS + 2.5KB CSS) | Full SSR | Lightweight UI components |
| HeavyMarkdownEditor | 1.1MB (32KB component + 1,081KB markdown libraries) | Progressive SSR | Rich interactive features |
β
Auto-Registration - Zero manual webpack configuration
β
Bundle Splitting - Intelligent separation of light/heavy dependencies
β
SSR Support - Server-side rendering with progressive enhancement
β
FOUC Prevention - Skeleton loaders eliminate layout shift
β
Performance Optimization - Fast initial loads with lazy loading
bundle exec rake react_on_rails:generate_packs- Regenerate webpack entries./bin/dev- Start Rails + webpack dev serversnpm run build- Build production bundlesrake lint- Run all linters (ESLint + RuboCop)
Based on browser dev tools measurements:
HelloWorld Page (Lightweight):
- Total resources: 1.1MB
- HelloWorld.js: 10.0KB
- HelloWorld.css: 2.5KB
- Shared runtime: ~1.1MB (React + webpack)
HeavyMarkdownEditor Page (Heavy):
- Total resources: 2.2MB
- HeavyMarkdownEditor.js: 26.5KB
- HeavyMarkdownEditor.css: 5.5KB
- Markdown libraries: 1,081KB additional
- Shared runtime: ~1.1MB (React + webpack)
Bundle Splitting Benefit: HelloWorld page loads 50% faster by avoiding the 1.1MB markdown libraries!
π Explore the demo to see React on Rails auto-registration in action with professional bundle splitting and SSR optimization!