4 ms·
HTML over the wire frameworks like HTMX, Hotwire (rails), LiveView (phoenix), Livewire (laravel), LiveView (django), etc. They all have the same basic idea with
by mrinterweb 10mo 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 10mo agoUsing JSON over the wire means you can re-use your backend between multiple frontends (like with mobile apps).
- mrinterweb 10mo agoNot all web applications need to be have an API that serves other clients. Often web apps are enough.
- yawaramin 10mo agoYou 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.
- Lio 10mo agoYou could use Hotwire Native for that. Also backends like Rails give you JSON APIs for free if you want them.
- mrinterweb 10mo agoHotwire 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 10mo agoI 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.
- array_key_first 10mo agoYou 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.