Building the Worst HTMX Clone in Just 40 Lines of Code
Let's make the worst Htmx

I continue my series on building tiny clones of popular web frameworks by creating a minimal version of HTMX. Starting with basic event triggers and AJAX requests, I progressively add features like custom swap modes, advanced target resolution, and server-side event handling. The goal is to replicate the core functionality of HTMX in under 40 lines of JavaScript, demonstrating how backend developers can build dynamic apps without complex frontend tooling.
As long as your backend can send HTML templates you can go pretty far with it and build complete apps without a single line of JavaScript.
- wren6991
Huh, so every interactive event has a network request in the loop, with perceptible latency? And you still end up obligating client-side JS for the plumbing? I'd been meaning to look into HTMX but based on the content of this post it seems like a worst-of-all-worlds technical solution. Is it at least pleasant to work with?
- htmxxx
We already have the naughtiest htmx
- sparse-Matrix
Bravo! I never would have thought this would be so simple. As a direct consequence of this exercise: I now know something about what, precisely, htmx does.
cheers