Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I build exclusively web apps and I still use the backend as an API.

You fetch data from the API and render it with JavaScript.

React, Vue, Svelte, Angular, Alpine, pick whatever.

Not sending HTML over server endpoints, or using templated views like ERB/EJS/EEX/etc doesn't mean you inherently have a worse quality app.

If you do this in something like Next.js with "getServerSideProps()", it's functionally equivalent.

React even went so far as to make "Server Components":

https://reactjs.org/blog/2020/12/21/data-fetching-with-react...



If you render everything with JavaScript then HTMX is not really going to be useful at all. It's useful for developing apps that simply don't need the sort of complex client-side interaction that those frameworks enable. The article points this out- if you want to write a SPA in React, HTMX is not going to help at all. But if you want a mostly-server-rendered page with some AJAXy interactivity, HTMX is much much easier than trying to shoehorn in some client-side rendering just for the AJAXy bits.

The main thing is is that there is still a substantial demand for tools that let you mostly avoid writing lots of JavaScript, whether on the server or the client.


This is a super valid answer, thanks.

Psychological bubble from the sorts of apps I build I suppose, I hadn't considered:

  > It's useful for developing apps that simply don't need the sort of complex client-side interaction that those frameworks enable.


I feel like I gotta call out the LiveView is a bit in a class of its own. HEEx is rendered on the server, but the diff sent over the wire is the absolute minimal diff it can be with a map of where it in the DOM. Often this is just text. LiveView also gives you a running process on the server (a virtual machine process, not a linux process) that holds the user's state (like if they're logged in, for example) and makes things like "who's online?" and other concurrent features almost trivial.


You build web apps. The parent talks about web sites.

Not everything on the web is a full featured interactive application, this is exactly what they're talking about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: