Remix.run Logo
mrinterweb 4 days ago

HTML over the wire frameworks like HTMX, Hotwire (rails), LiveView (phoenix), Livewire (laravel), LiveView (django), etc. They all have the same basic idea with differences in how they achieve it. I feel this approach is overlooked, and it drives me crazy. There is a huge complexity cost attached with JS frontend app + backend that everyone seems to have accepted as reality. HTML over the wire (really need a catchy acronym maybe HotW) can greatly simplify and speed up development with pretty much the same end user experience as a react app.

ChocolateGod 4 days ago | parent [-]

Using JSON over the wire means you can re-use your backend between multiple frontends (like with mobile apps).

mrinterweb 4 days ago | parent | next [-]

I have lost track of the number of times I have heard that argument, and implemented the API only to never have other API clients, or the API clients that do come later have very different needs and I need to create another API for that. I don't think API re-use is a strong argument unless the other client will be consuming the API imminently. I've heard the of "course we will have a native mobile app" argument enough times to often identify it as wishful thinking. Many clients are often satisfied with with a good web app.

yawaramin 4 days ago | parent | prev | next [-]

You can also reuse your backend if you server HTML, thanks to content negotiation. The frontend sends a header that indicates what type of content it accepts, and the backend serves the according type.

Also, mobile apps often have different API needs than webapps, so they end up getting different APIs anyway.

array_key_first 3 days ago | parent | prev | next [-]

You can certainly try, but a lot of times the applications are different applications with different semantics so this doesn't work and you create a bunch more endpoints.

Lio 4 days ago | parent | prev | next [-]

You could use Hotwire Native for that. Also backends like Rails give you JSON APIs for free if you want them.

mrinterweb 4 days ago | parent [-]

Hotwire Native would be a great option, but I will argue that I've never felt that I got JSON APIs for free with rails. Thousands of my rails dev hours spent writing APIs would say otherwise.

mrinterweb 4 days ago | parent | prev [-]

Not all web applications need to be have an API that serves other clients. Often web apps are enough.