720 B
720 B
ADR 0004 — UI render helper (escape + tagged templates + fragment + renderInto)
Date: 2025-09-02
Context
We want a tiny rendering utility with safe defaults (escaped HTML), raw opt-in, and convenient DOM insertion—without introducing a framework or build step.
Decision
- Add
src/ui/render.jsproviding:escapeHtml,raw,html(tagged template),fragment, andrenderInto.
- Cover with unit tests in
tests/ui.render.test.mjs. - Keep adoption optional and incremental; usage can be introduced in
script.jsat low risk.
Consequences
- Safer string rendering out of the box; clear opt-in for trusted HTML only.
- Simple, testable building block as we gradually refactor UI code.