finds.dev← search

// the find

angelofallars/htmx-go

★ 807 · Go · MIT · updated Nov 2024

</> Build awesome HTMX + Go projects faster.

A thin Go wrapper that gives you typed constants and a fluent builder for HTMX request/response headers. Solves a real annoyance: hand-writing HX-Trigger JSON and swap modifier strings is error-prone and the library handles the serialization correctly. Aimed at Go devs building server-rendered apps with HTMX who want compiler help instead of stringly-typed header values.

Type-safe swap modifiers with method chaining (SwapBeforeEnd.Scroll(htmx.Bottom)) catch typos at compile time instead of runtime. Trigger serialization is genuinely useful — building HX-Trigger JSON by hand with multiple events is the kind of thing that silently breaks. The Clone() pattern for reusable global response writers is well thought out. Templ integration via RenderTempl() is a nice touch that avoids the ordering bug where writing headers after the body is already started gets silently ignored.

807 stars but only 22 forks and last push November 2024 — this project looks effectively unmaintained. No support for HX-Push-Url with false (disable push), and LocationObject for HX-Location with source/handler/select fields isn't covered. The library is also extremely thin: you could implement everything here in an afternoon, so the dependency might not be worth it for a long-lived project if the author stops cutting releases for new HTMX versions. No middleware helpers for common patterns like full-page vs partial rendering based on HX-Request.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →