Top
Best
New

Posted by iNic 12/18/2025

Please just try HTMX(pleasejusttryhtmx.com)
616 points | 515 commentspage 6
beders 12/19/2025|
Can someone who's adapted HTMX for a larger app report about front-end-server costs?

HTMX serves fully baked HTML that needs to be created on the back-end (or front-end-facing servers)

That is more processing than sending the raw data to the front-end and baking the HTML there.

It is also more bandwidth (unless the JSON is more verbose than the HTML generated).

Lastly, I can generate different HTML fragments on the front-end from the same client-side state with the data only being transported once. How is that working out?

listenallyall 12/19/2025|
> That is more processing

Not necessarily. Often it is less. Template engines can be very, very efficient and fast.

Returning JSON almost always requires data/object serialization on the server, this is often slower than direct data/object -> template rendering.

Further, it's not your server but keep in mind the client must de-serialize JSON and render some HTML every time.

Modifying layouts as a result of non-persistent state (light/dark mode, sorting, etc) can usually be handled relatively easily with styles and data- attributes and sprinkles of JS. HTMX works very well with Alpine.JS and similar libraries for more complex situations.

HTMX isn't for every scenario, but it works very very well in many scenarios.

kitd 12/18/2025||
Ofc if you really want to lose bloat, there's always Htmz

https://leanrada.com/htmz/

nymanjon 12/24/2025|
I took that idea and made it actually usable.

https://github.com/jon49/htmz-be

It's amazing how much further you can go when you flip the server as the one deciding where what should be updated on the page.

This was originally conceived by datastar and nomini also implements it this way. And HTMX 4.0 will have this as a first class citizen.

ncr0 12/18/2025||
So we are almost back to using XSLT (and this is a good thing)
kitd 12/18/2025||
Sorry, I'm struggling to see the comparison
kstrauser 12/18/2025|||
No, and it wouldn’t be, respectively.

(Also, I don’t think we can go back to XSLT in the same sense that I can’t go back to the moon.)

vaylian 12/18/2025||
Does XSLT support making HTTP requests to load new content into an existing page?
arethuza 12/18/2025||
My first reaction, having done a fair bit of XSLT in ancient times, was "I hope not".

After a bit of searching all the examples I could see use JavaScript to glue the HTTP request making part and then invoke the XSLT processor so it looks like the answer is "no".

npn 12/18/2025||
This is a retarded advice. Author clearly never tried to develop any serious web development.

> the build time is over 30 seconds!

that's silly. 30 seconds building time is nothing compare to the accumulated time you wait for micro changes to your frontend.

for typical web development using react/vue/svelte you have hot code reloading, which can reload the current website < 1 seconds after you hit [Save] on your favorite editor.

for htmx to update, you have to wait for your whole server to reload (which can be way slower even you use interpreted languages like ruby or python, due to complexity of the framework you use).

not to mention it does not keep any state of the current website, make debugging way more troublesome compare to a js mature framework.

only people who never have to improve their website incrementally think htmx is a viable option. or insane people.

obviously, for some small websites with minimal interactions or no need to change the content very often, then htmx can be good, but for that case, vanilla js also works, and they do not need 14kb of excess baggage.

0xblinq 12/19/2025||
This.

Only backend developers that think frontend is trivial and we’re all just idiots think that HTMX is the solution. They saw it working in their hello world side project and think they discovered gold.

Aldipower 12/18/2025||
Thanks for this advice. I will never ever try HTMX now. I hate waiting. This makes me sick.
ramon156 12/18/2025||
> Option B: React (or Vue, or Svelte, or Angular if you're being punished for something).

> And suddenly you've got:

> A package.json with 847 dependencies

> A build step that takes 45 seconds (if the CI gods are merciful)

> State management debates polluting your pull requests

> Junior devs losing their minds over why useEffect runs twice

> A bundle size that would make a 56k modem weep

No? React is surprisingly small, and if you're in dependency hell then fix that. The alternative is another idiom.

hu3 12/18/2025|
React only renders. You need a lot more than that for an app.

And if you glue packages together you're basically reinventing frameworks. This can be a good thing or a bad thing.

Regardless of your choice between glueing libs or a framework, you'll end up with tons of dependencies for most non-trivial projects anyway.

dev_l1x_be 12/19/2025||
> No fetch(). No setState()

Just pure eval(). [1]

1. htmx.config.allowEval: defaults to true, can be used to disable htmx’s use of eval for certain features (e.g. trigger filters)

joeevans1000 12/20/2025||
Weird, Safari reloads the page on the demo button clicks and Chrome does not.

UPDATE: the second visit to the page on Safari didn't have the issue. It's interesting to note that some people might have that effect though... reloads on Safari occasionally for whatever reason. Or it could be something rare on my end.

davidhariri 12/18/2025||
HTMX is a great choice for an app that only needs forms, validation and partial template rendering, though CSS view transitions are making partials less relevant for server side web applications.

For things with heavy interaction (drag and drop, chat etc.), I find the code to make it work with HTMX is just too clumsy to work with as a mental model.

adamzwasserman 12/18/2025||
multicardz is heavy drag-drop ui. totally based on htmx (I still need to get data from a backend, I use htmx to do it for a number of reasons.)
yawaramin 12/18/2025||
That's exactly what the article is saying.
karmakaze 12/18/2025||
> Any HTML element can make an HTTP request

> The server just returns HTML (not JSON, actual HTML)

I like to separate presentation HTML from the data (returned from HTTP request). Some like to make backends that do nothing but serve the (singular) frontend, even running templates to make the HTML they return for easy consumption. That's not where I draw the line.

yawaramin 12/18/2025|
You know, there was a time when returning Hypertext Markup Language over Hypertext Transfer Protocol was considered a normal thing.
simultsop 12/18/2025|
As the op may read along the other comments, we are tired trying the new shiny thing. Now it is AI's turn to get tired or never.

Dx resources must aim AI's attention having enormous technical documentation and be AI efficient in order to become mainstream.

I believe no other shiniest thing will ever make cognitive nest in humans. We are overloaded.

More comments...