logoalt Hacker News

IgorPartolayesterday at 12:09 AM2 repliesview on HN

I have never loved the idea of the server rendering HTML which is probably why I have such a hard time with HTMX. In every other paradigm you clearly separate your server API and UI rendering/logic. Web apps are the only place where it seems common to have the server render UI components. Imagine if you had a Java or Swift application and had the server sending your phone UI screens. I don’t even know how you would pitch that. About the only thing I have seen that makes some sort of sense here is video game rendering to be able to play on really limited devices with quick internet access.

The problem with SPAs is the ecosystem. I recently found packages like this [1] and this [2] in my node_modules and that is insanity. But the architecture honestly makes way more sense than any other paradigm: server side is a well defined API and the client renders UI and handles local state.

[1] https://www.npmjs.com/package/isarray

[2] https://www.npmjs.com/package/is-string


Replies

arethuzayesterday at 9:46 AM

X (the Window System not the thing that was Twitter) explicitly allowed a remote machine to send rendering commands over a network to the local machine? (I'm avoiding using the term "server" as X has this round the other way - from the users perspective the server is local and the client can be remote).

Sun's NeWS also allowed something similar - but with a large amount of programmability using PostScript.

show 1 reply
adamzwassermanyesterday at 2:40 AM

At the end of the day, personal preferences play a huge role. All programming is a compromise between tradeoffs.

React has a lot going for it. It's simply that I prefer htmx; it feels cleaner to me.