I don't get it. It seems to be an html where magic happens via attributes, and it just looks ugly to me. Looking at the reference - the third Core™ attribute is literally for calling arbitrary JavaScript inside an HTML attribute tag which for me is really cursed. All these hx-on::before-request, hx-on-htmx-before-request, hx-on="htmx:beforeRequest: alert('Making a request!')
htmx:afterRequest: alert('Done making a request!')".
Only showing not a single piece of logic more complex than a simple alert.
Heck! This looks like a dirty hack, and for some reason it exists, giving htmx the power of the javascript, but now all inside HTML of course. How come it's applying the rule of least power if such thing exists? 36 new custom attributes for HTML, _most_ of what you want should be covered, maybe one day you will want something else, and we will cover it with more custom HTML attributes, until we reach hundred of them for every use case. No javascript needed. And yes, React unlike HTMX is not a framework, it is just a library for building user interfaces, it does not provide a specific structure for developing your application, it is just a tool to perform a specific task: building a view layer of your application.
the hx-on attributes are to deal with the fact that HTML's native on* attributes don't allow you to capture custom events, they aren't a focus of the library
the core idea is hypermedia, we have a book on the idea here:
I can't buy into this essay really because it does not show me which code was ported, probably because it was such a shame to even show it to the public. It seems to me that react application was made terrible from the beginning, and I saw many such terrible applications. 255 dependencies for a simple website? The people who used them certainly did not knew what they are doing. By the way to build react ui you need only two. The rest is your choice to use or not depending on how much you know. I could port this monster to 5000 lines of code using the same react with 99% less js dependencies, 80% less memory usage bla bla bla, because I know how to use this tool. And you're right, htmx is really better for these people because it is a familiar pattern. But for me hypermedia is a step back, I would still prefer my lightsaber instead of a pizza-knife because I'm a master jedi and I won't cut off my own hand with it. Yes, it is a library a bit harder to adopt, learn and use consciously – but you can cut through thick metal doors.
Only showing not a single piece of logic more complex than a simple alert. Heck! This looks like a dirty hack, and for some reason it exists, giving htmx the power of the javascript, but now all inside HTML of course. How come it's applying the rule of least power if such thing exists? 36 new custom attributes for HTML, _most_ of what you want should be covered, maybe one day you will want something else, and we will cover it with more custom HTML attributes, until we reach hundred of them for every use case. No javascript needed. And yes, React unlike HTMX is not a framework, it is just a library for building user interfaces, it does not provide a specific structure for developing your application, it is just a tool to perform a specific task: building a view layer of your application.