What problem does it solve?
SSR for Inertia Rails apps pre-renders pages on the server to improve SEO, deliver faster initial content, and enable basic navigation when JavaScript is unavailable.
Core Features & Use Cases
- Create an SSR entry point (app/frontend/ssr/ssr.js) for Vue 3 or React to render pages server-side.
- Configure Vite Ruby and Rails to enable SSR, hydration, and SSR head injection for meta tags.
- Use Case: SEO-critical pages load pre-rendered HTML, enabling search indexing and JS-disabled scenarios; deployment guidance is included for production SSR.
Quick Start
Install and configure the required tools in your Rails project, then add the SSR entry point and enable SSR in Rails:
- Create app/frontend/ssr/ssr.js with the server setup for Vue 3 or React.
- Update config/vite.json and config/initializers/inertia_rails.rb to enable SSR.
- Update client entry points for hydration and include inertia_ssr_head in your layout.
- Build and run SSR alongside Rails (bin/vite build --ssr and bin/vite ssr).