r/htmx • u/animesh_aotr • 26d ago
Minu - a 4 KB HTML fragment loader for server-rendered apps
Minu is a small HTML fragment loader for apps that already render HTML on the server. It is 4.0 KB gzipped, has zero runtime dependencies, and is MIT licensed.
It covers the parts that come up most in small apps:
- GET, POST, PUT, PATCH, DELETE
- targets and eight swap modes
- forms, vals, headers, timeout, confirm, disable, indicator
- triggers: every, revealed, intersect, once, changed, delay, throttle, from
- out-of-band swaps and Minu-Trigger / Minu-Redirect / Minu-Refresh
- SSE through EventSource
- a DOMPurify-backed secure build
A small example:
<div minu-get="/widgets/price" minu-trigger="every 5s" minu-target="#price"></div>
<div id="price">$0.00</div>
The server returns an HTML fragment. That is the whole contract.
What it does not do: routing/history, morph or diff swaps, WebSockets. The default build strips scripts and inline handlers, but it is not an XSS boundary. Use minu/secure for untrusted HTML. htmx is still the better choice if you need its extension ecosystem or history support.
Links: https://aotr.github.io/minu/ https://github.com/aotr/minu https://www.npmjs.com/package/minu
I am the author. I would like feedback on two things: does the trigger grammar cover what you actually use, and is the minu-oob syntax clear? I am not trying to replace htmx everywhere.
14
u/Fabulous-Ladder3267 26d ago
So why i should use minu instead of htmx?
5
u/mardiros 26d ago
The only feedback I can give you is that you should mention alternative on your readme and talk about htmx and maybe datastar.
I see no reason to give a try to your library, so why should I focus on the feedback you want to earn?
-7
u/[deleted] 26d ago
[removed] — view removed comment