Django, HTMX and Alpine.js: Modern websites, JavaScript optional
Can someone genuinely explain to the the desire&#x2F;interest to use HTMX&#x2F;Hotwire&#x2F;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 &quot;Unobtrusive Javascript&quot; where you had code like:<p><pre><code>  $(‘#user-list’).html(“&lt;%= j render(‘index’, users: @users) %&gt;”)
</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&#x2F;iOS app in Java&#x2F;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&#x27;s and just exchanged data with them, it opened up the ability to be platform-agnostic.<p>I guess I don&#x27;t understand why someone would choose to build an app that sends HTML over the wire instead of JSON&#x2F;XML&#x2F;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.