Skip to content

ADR-008: UI Composition and Template Structure

Date: 2025-05-01

Superseded by ADR-017

The Alpine Go Performance Starter aims for a modern, maintainable, and accessible UI with minimal JS. The team needs a clear architectural approach for composing UI, structuring templates, and rendering dynamic content.

  • Use Go’s html/template for all HTML rendering, leveraging its built-in escaping for security.
  • Organize templates in /web/templates, with partials in /web/templates/partials.
  • Use HTMX for dynamic UI updates and partial rendering, enabling server-driven UI with minimal client JS.
  • Favor small, composable partials (e.g., _item.html, _error.html) for reuse.
  • All UI should be accessible and responsive by default (see ADR-009).
  • UI is modular and maintainable.
  • Progressive enhancement is easy; works with and without JS.
  • Security is improved via template escaping.
  • Not machine-checkable: Superseded by ADR-017 — the constraints in this ADR are no longer live. Enforcement of the successor pattern (templ, typed props, view layout) lives in ADR-017’s Enforcement section.
  • Graduation log: (empty)