Top
Best
New

Posted by iNic 6 days ago

Please just try HTMX(pleasejusttryhtmx.com)
614 points | 502 commentspage 6
n4pw01f 6 days ago|
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 6 days ago||

    <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 6 days ago|
how do you feel about this mixing of control logic and display information:

  <a href=“/clicked”>click me</a>
g947o 3 days ago||
we call that HTML standard, and (in principle) works in any browser without the need to use JavaScript.
kitd 6 days ago||
Ofc if you really want to lose bloat, there's always Htmz

https://leanrada.com/htmz/

nymanjon 1 hour ago|
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.

npn 6 days ago||
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 5 days ago||
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 5 days ago||
Thanks for this advice. I will never ever try HTMX now. I hate waiting. This makes me sick.
ramon156 6 days ago||
> 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 5 days ago|
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.

ncr0 6 days ago||
So we are almost back to using XSLT (and this is a good thing)
kitd 6 days ago||
Sorry, I'm struggling to see the comparison
kstrauser 6 days ago|||
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 6 days ago||
Does XSLT support making HTTP requests to load new content into an existing page?
arethuza 6 days ago||
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".

dev_l1x_be 5 days ago||
> 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)

davidhariri 6 days ago||
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 5 days ago||
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 6 days ago||
That's exactly what the article is saying.
karmakaze 6 days ago||
> 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 6 days ago|
You know, there was a time when returning Hypertext Markup Language over Hypertext Transfer Protocol was considered a normal thing.
simultsop 6 days ago|
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...