Skip to content

feat(serve-htmx): add HtmlContent terminal send, decouple from base-template#32

Merged
deer merged 1 commit intomainfrom
htmx_improvements
Apr 22, 2026
Merged

feat(serve-htmx): add HtmlContent terminal send, decouple from base-template#32
deer merged 1 commit intomainfrom
htmx_improvements

Conversation

@deer
Copy link
Copy Markdown
Owner

@deer deer commented Apr 22, 2026

Adds HtmlContent — a @FunctionalInterface in serve-template that produces a rendered HTML string — and wires it into HtmxResponse.send(HtmlContent) as the terminal step of the fluent chain. This removes the direct dependency on base.build's base-template module that was introduced when the send overload was first drafted. serve-htmx now depends on serve-template (transitive, so HtmlContent is on callers' module path automatically) and is otherwise ignorant of any specific template engine. Callers using base-template templates adapt with a one-liner () -> { var out = new HtmlOut(); t.render(out); return out.toString(); }, which belongs in the module that knows about that engine. Tests cover the status/content-type/body contract and the preservation of HX-* headers set before the terminal send.

@deer deer merged commit 520ef57 into main Apr 22, 2026
2 checks passed
@deer deer deleted the htmx_improvements branch April 22, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant