Top
Best
New

Posted by iNic 12/18/2025

Please just try HTMX(pleasejusttryhtmx.com)
616 points | 515 commentspage 5
kgeist 12/19/2025|
I've used HTMX on a personal project of mine. Other than HTMX itself, it used Go templates + Tailwind for CSS. As a backend dev with almost no professional frontend experience, I was able to replicate a fairly large and feature rich React app (which I was inspired by) using htmx in a matter of weeks in free time.

The main problem for me was storing/passing state between too many fragments. At some point some pages can become too complex to be manageable by HTMX, unfortunately. Lots of little fragments depending on each other, I began struggling to maintain a clear mental map of what was going on.

I'd say if React is more like functional programming, HTMX sometimes feels like GOTO programming.

pawelduda 12/18/2025||
To prove the point, author mentions company that went from React to Htmx and saw positive change in relevant metrics. When you do that, it usually means your app has matured in a sense and you can be sure that htmx will be sufficient to handle all the functionality

I'm however more curious about going the other way, i.e. you start a project with Htmx which happily grows but after a while, a large feature is requested which inevitably changes the direction of the app into React use-case territory. I can't think of concrete example but you now have to work around it with htmx or commit to rewriting to React (or alternative). Wonder what are thoughts of people who had to deal with this

hakunin 12/18/2025||
For those who build in Ruby on Rails, does htmx have an advantage over Turbo/Stimulus? For me, the sense that it doesn't is why I've been avoiding it. Prefer to stick with vanilla stack unless there's a very compelling reason not to.
bondarchuk 12/18/2025||
>The "server" (mocked client-side for this demo

Hmmm.... I wonder why that is......

lkbm 12/18/2025|
I mean, I guess it's fine to mock stuff here, but when I tried clicking the button, I first opened the network tab of devtools, and was confused by the lack of any request being made. (The console explained, showing "[HTMX Demo Mock] fetch: POST /demo/clicked" and "[HTMX Demo Mock] Returning mock for: POST /demo/clicked")

Your demo shouldn't have explicit lies, such as "It worked. That was an actual HTMX POST request. The "server" returned this HTML and HTMX swapped it in."

I mean, I guess maybe it made an HTMX POST request, not an HTTP POST request? But this does reduce my trust in the article.

bondarchuk 12/18/2025||
I don't think it's fine, if even the "just fucking use htmx" page can't be arsed to just actually fucking use htmx then something must've gone wrong somewhere.
moggers123 12/20/2025||
What's the grug brain method of "live updating list with a search bar". I tried htmx sse but it turned out to be not that great. I was hoping I could model it as a single request/response cycle like a traditional page post, with the astericks that the single response is actually a stream of responses. Clicking search or whatever again "just" axes the old request and sends another one with the updated parameters. Perhaps the form being dirty would actually be what axes the stream.
yawaramin 12/21/2025|
https://htmx.org/examples/active-search/
themafia 12/18/2025||
No, I'm sorry. Life is too short to write code inside of HTML attributes.
didip 12/18/2025||
I love HTMX. It felt like a rebirth of PJAX. Server side template rendering is simply the best.

Too bad that the world insists on going nuts with JS everything.

Oh as a plus, AI agents are a lot more productive when dealing with server side logic.

recursivedoubts 12/18/2025|
huge fan of pjax, interviewed @defunkt here:

https://htmx.org/essays/interviews/chris-wanstrath/

H1Supreme 12/18/2025||
> But sometimes—and here's where it gets uncomfortable—you actually do need a button that updates part of a page without reloading the whole damn thing. You do need a search box that shows results as you type. You do need interactivity.

You can do this with plain old Javascript. Make a request, swap out the [inner | outer]HTML with the result. If you want a nice visual transition, wrap the swap in a startViewTransition(). Obviously, you need to be extra careful if you're using user-submitted HTML. Otherwise, it's fairly straight forward.

n4pw01f 12/18/2025||
I have used HTMX extensively with AI agents. It is fantastic for dynamic views.

Agent one: handles the request and does tool calls

Agent two: reads the result and decides on quality vs a re-drive if it’s low quality

Agent three: decides how to present the information to the user, creates a collection of HTMX elements

HTMX hx-get is reliably, and beautifully rendering the result of the Agentic Workflow without any react, etc.

Very happy and passing quality gates. I love not having security alerts every week to patch because of some buried react dependency library

embedding-shape 12/18/2025|

    <button hx-post="/clicked" hx-swap="outerHTML">
You know, I see logic/"programming" inside of templates and I'm out, gave up that life many years ago and never have I been eager to go back to it.

No, I'll keep using hiccup and similar things that are just data and nothing more, no syntax, just functions and built-in data structures, then give me HTML as a string which consumers can do whatever with, and we're golden.

recursivedoubts 12/18/2025|
how do you feel about this mixing of control logic and display information:

  <a href=“/clicked”>click me</a>
g947o 12/21/2025||
we call that HTML standard, and (in principle) works in any browser without the need to use JavaScript.
More comments...