News for hackers. Stuff that matters.
Re:Show HN: µJS, a 5KB alternative to Htmx and Turbo with ze... by gaigalas on Saturday March 07, 2026 @12:13PM (#47289458)
I like the idea. DOM morphing is nice.

I've done this previously with morphdom to AJAXify a purely server-driven backoffice system in a company.

I would love something even smaller. No `mu-` attributes (just rely on `id`, `href`, `rel`, `rev` and standard HTML semantics).

There's a nice `resource` attribute in RDFa which makes a lot of sense for these kinds of things: https://www.w3.org/TR/rdfa-lite/#h-resource

Overall, I think old 2015-era microdata like RDFa and this approach would work very well. Instead of reinventing attributes, using a standard.

Re:Show HN: µJS, a 5KB alternative to Htmx and Turbo with ze... by 0x20cowboy on Saturday March 07, 2026 @02:33PM (#47290714)
Not exactly what you’re saying, but a bit closer. With this library you set what css classes on the page are “hot”, it fetches the next page state and replaces that part of the page with the new state: https://github.com/robrohan/diffy
Re:Show HN: µJS, a 5KB alternative to Htmx and Turbo with ze... by amaury_bouchard on Saturday March 07, 2026 @06:50PM (#47292697)
Thanks for the feedback! The RDFa `resource` attribute is an interesting angle I hadn't considered. That said, µJS's default behavior actually requires zero `mu-` attributes; it intercepts standard `href` links and `action` forms out of the box. The `mu-` attributes are only needed when you want to override the default behavior, use patch mode (updating multiple DOM fragments in a single request), or trigger requests from elements that are not links or forms. So in the simplest case, a single `mu.init()` call is all you need. That said, if you want something even more minimal, htmz takes that philosophy to the extreme.