ADR-008: UI Composition and Template Structure
Date: 2025-05-01
Status
Section titled “Status”Superseded by ADR-017
Context
Section titled “Context”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.
Decision
Section titled “Decision”- Use Go’s
html/templatefor 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).
Consequences
Section titled “Consequences”- UI is modular and maintainable.
- Progressive enhancement is easy; works with and without JS.
- Security is improved via template escaping.
Enforcement
Section titled “Enforcement”- 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)