Show HN: Ajaxial – Painless, JavaScript-Free Ajax
1–3 of 3 posts
Re: Show HN: Ajaxial – Painless, JavaScript-Free Ajax
#2Re: Show HN: Ajaxial – Painless, JavaScript-Free Ajax
#3Is it something similar or how does it compare to htmx?
From a functional standpoint:
- HTMX is already tiny at 47.8kb minified, but Ajaxial is even tinier at just 5.0kb minified
- HTMX has more "batteries included" for things like history support and inline event handlers, where Ajaxial takes a more minimal approach with a heavy focus on extensibility, so that it's as easy as possible to add those batteries if you need them
- HTMX supports IE11 (until the currently-alpha v2.0) and has a lot of browser support-induced quirks as a result, where Ajaxial uses current modern web technology like fetch
The single biggest thing that sets Ajaxial apart is that it's designed to be as deeply extensible as possible. Where HTMX has more magic that makes things "just work" out of the box, Ajaxial leaves as much of the process as possible open to changes or additions, so that it can be trivially extended to support almost any use case. For example, here's a tiny extension that enables Mustache template support =)
Ajaxial.responseConverters.mustache = (body, template) => {
const template = document.querySelector(`template[name="${template}"]`).innerHTML
const rendered = Mustache.render(template, JSON.parse(body))
return Ajaxial.responseConverters.html(rendered)
}