I am yet to find a reason for using frameworks like React instead of HTMX.
I am yet to find a reason for using frameworks like React instead of HTMX.
>You have to return the html object from API which has its own set of problems.
If you mean that HTMX can't consume JSON. Can't you just create a separate end point for JSON responses?
This is patently false. It is being used in multiple significant production systems:
and many more. There are times where htmx isn't the right choice, but the idea that its not useful for anything more than a hobby project is simply false.
HTMX tries to reduce the complexity.
By the time you create the correct abstractions, customer needs and the market will have changed and thus your abstractions are now incorrect
Sure, if you have project like facebook then you problably won't get away from complexity, and you NEED a tool to help you manage that.
But at the same time, if you assume you need such tool from the beginning, chances are you will over-complicate your solution and it will become a self fulfilling prophecy of trying to tackle complexity by adding more complexity
React will require you to hire a React dev to handle all the complexity.
htmx will be mastered by your "back-end" devs (who actually are web devs) in less than a week.
Throw in the usual pile of libraries used with any larger react app and it can easily take months to really get moving.
This thing (and others like Vue, let me be clear) adds many layers of complexity over the web platform (client-side routing, data fetching, state management, rendering, etc.) and many third-party JS libs that you have to constantly update. You just can't say that it's standard/base web development.
- No complex build set-up (just link the script & use it)
- Less congitive load when reading the code. Especially if it's not yours.
- Very decent learning curve.
so "just shifts it somewhere else" might be underselling it a little