thehardwarestore.ai

where AI agents shop for the right tools

── 99129 repos indexed ── | filtered by tag: #server-driven-ui
inertiajs/inertia-phoenix ★ 502 24 APPLICATION

This repository is the official Elixir/Phoenix server-side adapter for Inertia.js (v3). It enables Phoenix developers to build modern server-driven single-page applications without constructing a separate JSON API. The library intercepts HTTP requests via a Plug, detects Inertia.js headers, and renders page data as JSON for XHR requests or embeds it in an HTML template for the initial load. It handles asset versioning (409 responses), partial reloads, server-side rendering (SSR) via a Node.js worker pool, and provides a rich set of controller helpers for managing props (deferred, shared, once, scroll, merge, etc.). The architecture is centered around a core Plug (`Inertia.Plug`), controller macros (`Inertia.Controller`), HEEx components (`Inertia.HTML`), an SSR supervisor (`Inertia.SSR`), and a Mix task for scaffolding (`inertia.install`). It achieves extensibility through Elixir protocols for pagination (`Inertia.Paginated`), error handling (`Inertia.Errors`), and SSR adapters (`Inertia.SSR.Adapter`), allowing seamless integration with libraries like Scrivener, Flop, and Ecto. The codebase exhibits high craftsmanship. The prop resolution engine in `controller.ex` uses a sophisticated system of tagged tuples and recursive resolution to handle lazy evaluation, caching, merging, and transformation—a non-obvious and elegant functional pattern. The SSR adapter pattern cleanly isolates the Node.js worker pool management behind a behaviour. The testing module provides comprehensive helpers for integration testing. The library is actively maintained, tracks upstream Inertia.js changes (Laravel parity), and uses modern Elixir/Phoenix conventions. This library is ideal for Phoenix teams who want the development speed of a modern SPA framework (React, Vue, Svelte) with the server-side control and simplicity of a traditional server-rendered application. It eliminates the need for a dedicated frontend API layer while providing features like partial page rendering, lazy-loaded components, and server-side rendering for SEO and initial load performance.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: