11 ms·
It 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
by germandiago 3y ago
It 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 at all. I would consider it more like original html with extensions that support Ajax respecting the original web model.
- synergy20 3y agothat's true, it also need more support from the backend, for react a restful background is all you need, for htmx or html+ajax the backend has to do routing, state management,etc, it's really the traditional MVC approach, but easier for the frontend(no json, just html)
- AzalinRex 3y agoif you put your state in the front end, you will end up tracking state on the front end and the server
- chrisco255 3y agoAJAX 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.
- jbverschoor 3y agoBefore that, we could use JSRS (JavaScript Remote Scripting)
- germandiago 3y agoThe only part that htmx adds is avoiding reloading the hypermedia and allow swaps via AJAX as you say. But the programming model stays hypermedia-based. For example, your server returns markup, not Json to a React frontend or similar. This simplifies things a lot though it also has some disadvantages. Advantages: if your backend changes the return to extend functionality, the hypermedia will be returned with no required changes on the frontend. On the other hand, if you want to do a data-based json API htmx is not what you want, because it conflates returning functionality (embedded in the hypermedia) with presentation, instead of returning only data.
- Pigo 3y ago"original html with extensions" I just had this weird flashback to Frontpage...
- jbverschoor 3y agoThe second biggest USP of React was that it's a library and not a framework.