Live data from Hacker News

Ask HN: What companies are embracing “HTML over the wire”?

news.ycombinator.com

61–70 of 192 posts

Re: Ask HN: What companies are embracing “HTML over the wire”?

#61
post #51

Earlier quoted context omitted.

A bit of Ajax here and there is fine. Look at how HN handles it when you upvote/unvote a comment. Look at how old.reddit.com handles it when you click "load more comments" in a long thread.

isnt ajax fancy sending html over the wire? or is it just the non fancy way?

AJAX stands for Asynchronous JavaScript And XML--it was originally designed for asynchronously manipulating XML data using JavaScript because at the time, the future was XML. The act of using JavaScript to send requests is still sometimes referred to as AJAX, despite usually not dealing with XML in any way. The most common use for sending asynchronous requests is making API calls, which today generally return JSON, but you could use AJAX to load HTML and dynamically add it to the page.

Re: Ask HN: What companies are embracing “HTML over the wire”?

#62
People have gotten way too religious over SPAs, SSR, etc.

Should you use X? Maybe it depends. I have been burned by using SSR when the complexity of the app increased and suddenly doing SSR was getting in the way and now I was uncomfortably mixing JS with server rendered pages and struggling to maintain state. I've also been on the other side, using React and creating more complexity than was needed.

The point is: don't be dogmatic. Get requirements, extrapolate what could happen in the future, use first principles, weigh decisions against team capabilities, ask yourself if your decisions are for your own personal reasons or have significant positive user/business impact.

Engineers who rush to use one technology over the other without doing their homework are just doing bad engineering. It has nothing to do with "fighting the good fight".

Re: Ask HN: What companies are embracing “HTML over the wire”?

#63
post #5

Earlier quoted context omitted.

It is rendered server side, but typically the server keeps track of only what needs to change and sends as small as possible an update to dynamically update the DOM. You end up with a user experience that feels close to an SPA, but a dev experience that feels close to traditional SSR.

Tech like LiveView (Phoenix) and LiveWire (Laravel) are great examples of this.

And htmx for a language-agnostic one

Re: Ask HN: What companies are embracing “HTML over the wire”?

#66

Isn't making a request for almost any user interaction a bit too much? I am more in favour of BE telling FE what to render. I honestly believe many apps could be simplified with better abstractions than hard coding html into messy components. Not saying it's a great approach for super complex layouts, of course.

[deleted]

Re: Ask HN: What companies are embracing “HTML over the wire”?

#67
post #5

Earlier quoted context omitted.

It is rendered server side, but typically the server keeps track of only what needs to change and sends as small as possible an update to dynamically update the DOM. You end up with a user experience that feels close to an SPA, but a dev experience that feels close to traditional SSR.

Having only worked at SPA places, it's hard for me to imagine not having tools like Storybook, Chromatic, and Mocked Service Workers. Building the UI in isolation means with mocked API responses means I can, in parallel, validate 1000's of use cases with pixel-level precision. The backend teams can keep their focus on scalable, performant APIs. The frontend teams can focus on accessibility, consistency, etc. I've fou…

At what cost? You can validate 1000s of use cases but you can't validate one that doesn't include that 25m download and simulate what a real user experiences.

Are developer tools more important than the product they create?

Re: Ask HN: What companies are embracing “HTML over the wire”?

#68
post #44

Earlier quoted context omitted.

IF you want the page to be interactive without refreshes though, you gotta do something. Unless you are advocating a completely pre-ajax web. https://en.wikipedia.org/wiki/Ajax_(programming)

Why are refreshes assumed to be bad?

if the page is large and you only need to bring back a little data it's probably better to just grab the little data. or upvote so your just sending a little bit of info back to the server.

Re: Ask HN: What companies are embracing “HTML over the wire”?

#70

old man alert Back in my day, we wrote ASP.NET that was all server-side-rendered HTML. Once in a while we got REAL FANCY and used JQuery to make PARTIAL HTML requests and update only FRAGMENTS of the page. Hooboy I knew that fashion was cyclical but not tech!

Computer tech has been cyclical since at least the 1960s, mostly moving the cleverness back and forth between the server and the client.
Post reply on HN