Django, HTMX and Alpine.js: Modern websites, JavaScript optional
Can someone genuinely explain to the the desire/interest to use HTMX/Hotwire/LiveView etc?<p>I was writing web apps when rendering templated HTML views on your server was standard, and you had controller endpoints that returned HTML content, or things like Rails "Unobtrusive Javascript" where you had code like:<p><pre><code>  $(‘#user-list’).html(“<%= j render(‘index’, users: @users) %>”)
</code></pre>
As an automatic callback to some action.<p>Whether or not you love or hate this model of development is irrelevant, because if at some point you need to render on a client other than a browser -- you have to start from the beginning and write an API now.<p>IE, so that your Android/iOS app in Java/Swift or whatnot, can ask your backend for data and render it using the tools available on that platform.<p>When we turned apps into pure API's and just exchanged data with them, it opened up the ability to be platform-agnostic.<p>I guess I don't understand why someone would choose to build an app that sends HTML over the wire instead of JSON/XML/whatever, that any client can render. All it means is that you have to write this functionality later when you want it, in addition to now having this HTML stuff.