7 ms·
HTMX sets up an underlying network traffic pattern: 1. The user interacts with the page. 2. The page sends a request to the server. 3. The server returns one
by cjs_ac 1y ago
HTMX sets up an underlying network traffic pattern:
1. The user interacts with the page.
2. The page sends a request to the server.
3. The server returns one response to the client, containing HTML, which the client inserts into the page.
4. (Optional) If the response includes references to other resources, like images or fonts, the client makes more requests for these.
The consequence of the 'one request, one response' thing is that the whole thing is fast. All the HTML arrives in one go. None of this request-one-thing-then-run-some-JS-on-the-client-to-decide-whether-to-request-another-thing nonsense that you can watch happening in real time that happens in an alleged productivity tool I have to use at my day job.
- cyanydeez 1y agoso as long as you dont expect to scale, it works? Is the connection atleast long lived?
- sgt 1y agoHtmx can scale. It's very basic and Htmx isn't the only technology to use that approach.
- uh_uh 1y agoIt cannot scale because it doesn't have a solution for reusable components. That's why I have abandoned it. Frameworks like React solve this in a much saner way.
- renerick 1y agoReusable components are prerogative of the templating system, such as React, or Vue, or server side templates that the framework of your choice uses. Htmx works with already rendered HTML fragments from the back end and doesn't do templating on its own, so there's simply no room for it to "solve" reusable components
- zenmac 1y agowell now we got Web Components baked in. People don't want to give up React cause it is where many paying job is coming from. It is the age old problem between better tech or better pay? What is even worse younger dev come in wanting to learn React cause it is the one that most job post is looking for. We end up negative economic to tech quality.
- deleted 1y ago[deleted]
- victorbjorklund 1y agoYou make the reuseable components in the server templating language. It is like saying PHP, Django, Go etc does not scale
- librasteve 1y agohttps://harcstack.org https://harcstack.org does components like this https://rakujourney.wordpress.com/2025/07/06/harc-stack-componenting/ https://rakujourney.wordpress.com/2025/07/06/harc-stack-comp... class Counter does Component { has Int $.count = 0; method increment is controller { $!count++; self } method HTML { input :id("counter-$.id"), :name("counter"), :value($!count) } }
- AstroBen 1y agoserver-side templating languages solved this decades ago
- Multicomp 1y ago/sarcasm/ Which is so much worse than the current paradigm where we have a client side SPA deciding to do all sorts of state syncing and react hooks and tracking pixels and auto pop ups all doing their own thing all over the place! /end sarcasm/ I think for a side project, not immediately expecting your front end's first version to not horizontally scale to the moon is ok.
- nine_k 1y agoWat would prevent a HTMX frontend from scaling horizontally? Maybe the backend, if it cannot scale horizontally. Otherwise, a million pages can be served the same way as a dozen. (A million is actually not so much, one average API box could suffice.) Where HTMX would run into trouble is complicated frontend logic, where updates of one area may trigger changes in another, etc.
- exiguus 1y agoIs it basically like Ajax?
- hmry 1y agoYeah it's exactly AJAX. Except instead of writing Javascript to send requests and insert the response into the document, you use declarative HTML attributes to describe what you want to happen.
- redwall_hp 1y agoYes. The cycle has completed and the old new things are new again. But they're still too new and unproven for the React-embroiled companies to switch just yet. HTMX is basically a framework for AJAX that lets you more quickly set up interactions in the markup instead of having to write scripts to manipulate the DOM yourself. It also tells on sending HTML fragments over the asynchronous request instead of JSON that has to be "rendered."
- zero_shift 1y ago> But they're still too new and unproven for the React-embroiled companies to switch just yet. I've seen a few of HTMX projects attempted in production, at my previous employer. Decently sized, moderately complex web products for serious commercial purposes I will say though, all three were complete disasters.
- recursivedoubts 1y agoNothing magic about htmx or hypermedia: you still need to organize your code properly, and there are tasks for which it is not suited: https://htmx.org/essays/when-to-use-hypermedia/ https://htmx.org/essays/when-to-use-hypermedia/ However, in many case, it can be much simpler architecture than alternative approaches: https://htmx.org/essays/a-real-world-react-to-htmx-port/ https://htmx.org/essays/a-real-world-react-to-htmx-port/
- mnemonk 1y ago