Menu

Let's make the worst htmx ever!
📰
0

Let's make the worst htmx ever!

Hacker News·Let's make the worst htmx ever!·about 2 months ago
#NccNyMWh
#zserge#parent#const#target#swap#response
Reading 0:00
15s threshold

This is a continuation of a series of posts about building tiny “clones” of popular web frameworks. Web is changing rapidly, and so the tools we use to build web apps (yet, I’m sincerely happy that my React/Vue posts are now seven years old, and those frameworks are still popular and relevant). Today the hot topic is htmx , basically a frontend library for backend developers who couldn’t care less about JavaScript. HTMX started as intercooler , then evolved and grown more features, and is there is some beauty to it: < button hx - post = "/clicked" hx - trigger = "click" hx - target = "#parent-div" hx - swap = "outerHTML" > Click Me ! < /button> In a declarative manner, it says: when the button is clicked, send a POST request to /clicked , and replace the outer HTML of the element with id #parent-div with the response data. HTMX wires together events, AJAX requests, and DOM updates hiding away frontend complexity.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More