Live data from Hacker News

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

news.ycombinator.com

121–130 of 192 posts

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

#121
post #75

Earlier quoted context omitted.

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…

We do browser based end-to-end testing which tests the frontend and backend at the same time using a single tool (Capybara in our case). We take snapshots at various points during the test runs which are then compared to previous runs for visual regression testing. Nothing is isolated so it's probably slower. The tradeoff is that the tests are really simple for how much they cover, and they're entirely separate from…

How do you test cases like, "the app should show an error screen when an error occurs in the database or server-side application layer"? In the SPA approach, I find these things quite easy to model with a service worker; just mock JSON API with the non-200 response code with body. I do see the merits of end-to-end testing but I've found it quite simple to mock the interface rather than ensure the database is primed with my situation in mind, or setup or teardown those records to ensure my 404 page renders correctly. And then I have to know how those parts of the system work, to create my test case. It does seem like an increase in cognitive load.

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

#122

Earlier quoted context omitted.

Is that AirBnB stat including “content” stuff like images or embedded maps? It’s still worth critiquing the bandwidth spent on that stuff, of course, but it wouldn’t really be fair to include it here when the discussion is about the architecture of page transitions.

Page transitions are much faster for me on Wikipedia than on AirBnB. Whatever I click on AirBnB, I get a white screen, then some placeholders, then the placeholders one after the other get replaced by the actual content. Whatever I click on Wikipedia - its just there instantly.

"Plain HTML" gmail vs. any other version. It's way faster to navigate.

Remember when AJAX was supposed to make pages faster? LOL. Of course, back then we were just sending HTML to be injected, not JSON that has to be processed by 50+ Javascript functions before finally becoming HTML (or, some DOM entities, anyway).

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

#123
post #97

Earlier quoted context omitted.

I find it much less smooth having a webpage consuming constant CPU.

That's a different issue. There's no reason CPU consumption should be high when you aren't interacting with an application.

There's theory, and there's practice....

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

#124

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!

Returning html fragments is quite stateful and contextual to the rest of the DOM structure. Ex: You might be referencing class names; is there already a stylesheet loaded that defines those styles? Are those styles actually what you want? I try to avoid these sort of "hidden dependencies" because it makes it harder to reason about a system and make changes to it without unknowingly breaking something.

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

#126

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.

> Look at how HN handles it when you upvote/unvote a comment. How?

For me, HN handles votes using deep links, since I have JS disabled.

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

#127

Earlier quoted context omitted.

Is that AirBnB stat including “content” stuff like images or embedded maps? It’s still worth critiquing the bandwidth spent on that stuff, of course, but it wouldn’t really be fair to include it here when the discussion is about the architecture of page transitions.

Page transitions are much faster for me on Wikipedia than on AirBnB. Whatever I click on AirBnB, I get a white screen, then some placeholders, then the placeholders one after the other get replaced by the actual content. Whatever I click on Wikipedia - its just there instantly.

Bear in mind that serving Wikipedia pages (static text documents) is much simpler that AirBnB listings (dynamic image heavy content).

It is possible to create a faster AirBnB by changing some of the underlying constrained imposed on the system (eg by accepting to serve cached, stale, listings; or by lowering the amount of telemetry) but apparently Airbnb management does not think the tradeoff is worth it.

Of course you are entitled to think that these decision from Airbnb are wrong and that they are hurting their sales. But you know the saying: « The least you know about a problem, the more convinced you are that you have the right answer »

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

#128
We embraced Hotwire with a Clojure backend. Favorite things:

- One language model (i.e. no JS, just our favorite backend language)

- Extremely minimal front-end tooling

- All data is manipulated with the same tools

- No client-side routing, validation, or... really much at all

P.S. We even wrote our own import-maps solution to avoid needing a JS bundler for the small stuff you can't do without JS.

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

#130

Earlier quoted context omitted.

Page transitions are much faster for me on Wikipedia than on AirBnB. Whatever I click on AirBnB, I get a white screen, then some placeholders, then the placeholders one after the other get replaced by the actual content. Whatever I click on Wikipedia - its just there instantly.

"Plain HTML" gmail vs. any other version. It's way faster to navigate. Remember when AJAX was supposed to make pages faster? LOL. Of course, back then we were just sending HTML to be injected, not JSON that has to be processed by 50+ Javascript functions before finally becoming HTML (or, some DOM entities, anyway).

> "Plain HTML" gmail vs. any other version. It's way faster to navigate.

And offers far less features. Attaching a file to an email takes ages without drag and drop, this alone is worth waiting few more milliseconds to most people (Gmail loads in less than 2 seconds on my crappy hotel wifi)

Post reply on HN