Superglue is a library for building React and Redux applications within classic Rails without requiring separate APIs or client-side routing.
The library solves the problem of maintaining productivity when adding rich client-side interactivity to Rails applications. Rather than building separate API layers, Superglue leverages Rails' built-in ability to respond to different MIME types on the same route, serving HTML to browsers and JSON to the client-side application from identical controller actions. PropsTemplate, a JSON templating DSL inspired by JBuilder, powers these JSON responses and allows selective data fetching by specifying keypaths through the response tree, skipping execution of unneeded nodes. The tool handles SPA navigation patterns through UJS attributes reminiscent of Turbolinks, enabling page transitions without full reloads, and supports partial updates where specific sections of the Redux store can be updated and re-rendered without fetching entire page state.
Superglue suits teams already invested in Rails who want to add React and Redux capabilities while preserving Rails conventions and helpers like flash messages, cookie authentication, and URL helpers. It eliminates the need to build and maintain separate API layers, serializers, and versioning strategies. The tool is positioned as an alternative to Hotwire and Turbo for teams preferring Redux state management and React components over simpler server-driven approaches. Server-side rendering is supported through integration with Humid.
The project maintains active engagement with its codebase through regular commits and responsive issue management. Development follows a structured contribution process with documented guidelines. The maintainers demonstrate commitment to documentation quality, hosting comprehensive guides on GitHub pages alongside the repository.