Comment

Comment by gavinray

Can someone genuinely explain to the the desire/interest to use HTMX/Hotwire/LiveView etc?

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:

  $(‘#user-list’).html(“<%= j render(‘index’, users: @users) %>”)
As an automatic callback to some action.

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.

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.

When we turned apps into pure API's and just exchanged data with them, it opened up the ability to be platform-agnostic.

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.

parent gavinray 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton