As a devops engineer who has recently been tasked with building UIs for our team and our developers, HTMX is a godsend. I create apps that often get steadily worked on for weeks and then only maintenance once and a while after that. I used to write django apps, but recently switched to a go backend with go html templates and htmx. This allows me to push everything in one docker image and avoid the black box nature of…
Is htmx Just Another JavaScript Framework?
81–90 of 318 posts
Re: Is htmx Just Another JavaScript Framework?
#82Earlier quoted context omitted.
One vital distinction is that even if you define 100 components, nothing will happen unless you call .render from react-dom. Nothing is automatically setup for you. Compare that to Laravel or anything else that is obviously a framework. You write code and put it in a file in the right place, and it gets picked up automatically, most of the time. This makes me still consider React a library, rather than a framework. B…
Note that by this definition Spring Boot isn't a framework - you call SpringApplication.run to start it.
Re: Is htmx Just Another JavaScript Framework?
#83It is not the same at all. Of course it needs javascript on the back to work. But the concept is totally different. It uses a hypermedia declarative model, an extended POST/GET etc. model. It keeps things very simple compared to a framework like React where you need a package manager, a transpiler and a json backend for data (not returning hypermedia). So I would not consider it another Javascript frontend framework…
Re: Is htmx Just Another JavaScript Framework?
#84I'm one of them. Really proud!
Re: Is htmx Just Another JavaScript Framework?
#85It is not the same at all. Of course it needs javascript on the back to work. But the concept is totally different. It uses a hypermedia declarative model, an extended POST/GET etc. model. It keeps things very simple compared to a framework like React where you need a package manager, a transpiler and a json backend for data (not returning hypermedia). So I would not consider it another Javascript frontend framework…
AJAX means Asynchronous Javascript and XML. It's quite literally JS. AJAX was not part of the original web model. It came out around the year 2000.
Re: Is htmx Just Another JavaScript Framework?
#86HTMX aims to render itself obsolete by serving as a proof of concept to advance the HTML specification. In various interviews and blog posts, Carson has mentioned that jQuery was essential only until browsers implemented features like `querySelectorAll`. The discussion about Library vs. Framework misses the core objective of the HTMX project.
Another question in the same vein: In your view, why is it so important for the project to advance the HTML spec?
By the way I am actually curious about this, I am an avid user of HTMX, but have never contemplated this.
Edit: Ok I think I get it now. HTMX provides hypermedia controls that should have been in the standard from the beginning. It also more-or-less maintains the current semantics of the web as defined in the HTML spec. Therefore it is logical to eventually include it into the standard. That it?
Re: Is htmx Just Another JavaScript Framework?
#87htmx is one of those things, like SQLite on the server, that you will incessantly see on HN, but rarely see used at large profitable companies. Say you use python and Django. Why use htmx instead of Django templates? Same with ruby and rails, elixir and phoenix, etc. the trend is clearly towards live view/hotwire OR things like server side react. Htmx is in a weird position that makes no sense unless you want to use…
Overall, I have used htmx successfully in several small projects, of varying tech stacks, without much effort at all.
Re: Is htmx Just Another JavaScript Framework?
#88The problem I have with this style of library for frontend dev work is eventually the scope of the problem exceeds what the library is capable of doing. Then you have to embed JS which then gets pretty messy and spaghetti code and enough of this you are right back to where you started setting up a JS build system to make up for the deficiencies. Only now it is worse because you are working around one library and you…
But it is not a given that the scope of the problem eventually exceeds what HTMX is capable of. It is perfectly fine to set HTMX aside and choose another framework if you feel that it better suits the problem at hand. Meanwhile there is still a ton of projects for which HTMX is more than enough (and always will be). So what you are mentioning is not an issue of HTMX, but one of "chosing the right tool for the problem…
One team at my company wanted to use HTMX and write the product with it and then the PM kept asking for features to bring it to parity with the rest of the application with regards to client side behavior and things devolved. They used hyperscript and eventually the frontend was just rewritten to be react.
Re: Is htmx Just Another JavaScript Framework?
#89I prefer to refer to htmx as a "future polyfill". Eventually, htmx semantics will become part of the web standard, and older browsers (or those that choose not to implement the feature) will need this polyfill.
> Eventually, htmx semantics will become part of the web standard Why do you think that will be the case? I'm not aware of any effort being made to evolve htmx into a web standard (either by introduction into existing specifications or direct adoption by browser), so this is about as baseless of a claim as someone saying "I see JQuery as a future polyfill" in ~2006.
Re: Is htmx Just Another JavaScript Framework?
#90Earlier quoted context omitted.
Note that by this definition Spring Boot isn't a framework - you call SpringApplication.run to start it.
Forgive my ignorance, I'm not super deep into the Java ecosystem, but is Spring Boot the same as just "Spring"? Or what is the difference precisely?