
Hello everyone! In this article we will consider such a javascript module as HMPL and how it can replace HTMX in a project. Also consider their dif...
For further actions, you may consider blocking this person and/or reporting abuse
Wait, we already need an alternative to HTMX? I thought HTMX was going to replace all the frontend frameworks?
you may have been the victim of a scam π€ͺ
I understand why XMLHTTPRequest in 2025 is due to
overrideMimeType
, but it would seem that behind such a convenience lies the fact that the route can send you any type, and it will be overwritten instead of an error. Well, and we shouldn't forget about backward compatibility and other things either.I respect htmx, but with all the desire to say that it will replace, it would not be entirely correct. I just see what is being replaced (XMLHTTPRequest requests without almost any customization), especially when it comes to working with a server in 2025. I understand why this is so, because that's the whole point. In a certain simplicity and functionality, but, in my opinion, there are also disadvantages to this approach.
xkcd.com/927/
is alternative to alternative to alternative...
Is possible to work with a component in HMPL, and how?
I don't quite understand in what sense the word component is used here. If it is in the understanding of React a type of function that returns jsx markup (everything is conditional, because it returns a regular object), then HMPL is not connected with React and other frameworks and libraries. But, this does not mean that it cannot be used in conjunction with them. In React you can easily work through
ref
and there will be no problems.In bare simple HTML if I need to create a component ( repeated url element ), I wrote as template tag and a I used that clone for a greater speed.
If we take regular HTML, then HMPL with
template
is definitely good)Wait, these are all strings?
HTMX is all HTML.Vue and HMPL - js code with template strings. It was possible to show HMPL via HTML when a request object is simply passed, but I wanted to demonstrate the customization possibilities
Good article! I would also like to say something about PHP and compare.
Thank you! What does this have to do with anything now?)
I would also add online examples on codepen, but I think the code there is small, so it seems ok.
Thx for this article. When I need to choose between HTMX and HMPL according this article, my favorite is HTMX, because HTMX can use much more simpler. I just need to copy this HTML code to FE part to work it, and do not need further state or DOM handling, because HTMX solve that "problem".
Imho: a real raw level to make any webpage (FE perspective):
Well, according to the description of your task, maybe HTMX will be advantageous because it is easier to set up - I do not argue. But, if you still want to send custom requests and more fully control the process, then, as described in the article, I can offer you HMPL as an alternative. Trivially, if you just need to quickly transfer part of the code to HTML, then HTMX, yes, in principle, is the choice that is needed, but if we are talking about more or less complete work with js with process control, then, again, you can consider HMPL.
Don't make mistake, I never used a HTMX. Even I don't think that is a best way, because just a hide a lot of things, and you right a certain point you will be need to use external JS function for it.
My perspective of point is a multi page simple HTML with a minimal JS. Maybe a better than relally obviously page ( like a game where a custom realtime interaction is take a place ) I use some JSX based setup ( even without FW ).
I'm not discouraging anyone from using something. I'm just offering an alternative. HTMX is simpler from the start - yes. That's its feature. But I think that simplifying everything is not worth it either. For me, the golden mean is better, which is implemented in HMPL, when you don't write very big code, and have the ability to control the process of sending a request and work in js fully.
Thanks very much for the write up. You did a good job! Since I use it everyday at work, I would opine that HTMX is much more natural and much easier to read. It also has way more features than other alternatives.
Yes, more features. But you can't send custom requests to the server, and you also depend on the DOM. I don't argue that HTMX is easy to read, but this syntax has its downsides.
Take a look at HTMZ - it only weighs 166 bytes (yes, bytes) and is super flexible.