Live data from Hacker News

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

news.ycombinator.com

181–190 of 192 posts

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

#181

Earlier quoted context omitted.

I’ve never tried it, but my understanding is when JS is disabled HN fires off a GET request (via a link) and returns a 204 to prevent browser navigation, right?

Interestingly enough, although javascript gets used, the vote links don't trigger an XHR request - instead the javascript parses the vote URL from the vote button element and then a GET request is made by creating an Image object in JS. You can see votes appear on your network tab under the image tab instead of Fetch/XHR, even though their response return type is text/html -- interesting little hack, although I'm not…

This is simply how it was done before XMLHttpRequest existed. If it ain't broke don't fix it, I guess.

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

#182

You don't even need a fancy "send html fragments over the wire" approach to create a better user and developer experience. Just sending full pages, server side rendered, like Hacker News and Wikipedia do is fine: Going from the HN homepage to this topic we are on: 36 KB in 5 requests. Going from the Wikipedia Homepage to an article: 824 KB in 25 requests Going from the AirBnB homepage to an apartment listing: 11.4 MB…

old.reddit feels fast, which is why I use the Old Reddit Redirect extension.

The new Reddit is the best example of how shitty can get things when you use the fancy tool instead of the tools you need for the job.

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

#183

Earlier quoted context omitted.

Frontend frameworks developed in response to the need to develop/maintain very complex browser-based applications like Facebook across a large team of developers. AirBnB/Reddit have dramatically more complex user behavior and are much more input- and media-oriented. You cannot wait on round trips to the server for user interactions, and you cannot just do hybrid client/server the old jQuery way on big applications be…

Yeah, I cannot even begin to imagine what it would be like to develop AirBnb without some sort of front end framework. I used to write pure JS and jquery back in the day, and it was super easy to end up with a rat’s nest of spaghetti code. And those apps were several orders of magnitude less complex!

The alternative to SPA frameworks is not spaghetti jquery and vanilla js and full page reloads.

As mentioned everywhere around this thread, the way to do server side rendered apps has also evolved. Hotwire, htmx, Unpoly, Livewire, etc, etc, etc.

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

#184

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: do…

People also need to work within the constraints of the chosen stack. You can make a very good experience in either a SSR and SPA app. But you can't make identical experiences. Product designers are notoriously bad at working within the constraints of a stack - so when you choose SSR with hotwire or whatever, you definitely need to push back when a product designer hands you a mock up of something that can't be done e…

Very well said

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

#185
post #50

We are using Django+HTMX for internal applications. Some random tips: - Write a "Django context processor" to inspect requests for "Hx-Request" header, and set a "base_template" variable accordingly. This means that any template that {% extends base_template %} will react to being a full page or just a fragment and you don't even have to think about that in your view logic. Great for progressive enhancement. - You ca…

I’m all in into the sprinkles approach (I’m a big fan of Hotwire and most of the times that’s what I use) but the Django templates are extremely outdated and limited. I don’t miss it at all. They’re really bad.

Compare it to Blade (Laravel) or even ERB (Rails) and it’s night and day.

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

#187

We’re using Hotwire extensively at https://mailpace.com It’s a joy! But we’re not hiring…

It is indeed. I’ve used it with a Laravel backend and it worked great.

Now using it in a node project and it also works wonderfully

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

#188
post #37

You can also go to the extreme of "jpeg over the wire". Your "web browser" could probably be implemented in <1000 lines of of code ;) No state, no cookies, no million lines of bundled JavaScript.

Little problems with scrolling but constant updates when a page is resized (changes in layout) - maybe it's worth it...

Add "no scrolling" to my list. None of the military-industrial browsers that I built in the late 80s and early 90s had scrolling.

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

#189

Earlier quoted context omitted.

I’ve never tried it, but my understanding is when JS is disabled HN fires off a GET request (via a link) and returns a 204 to prevent browser navigation, right?

Interestingly enough, although javascript gets used, the vote links don't trigger an XHR request - instead the javascript parses the vote URL from the vote button element and then a GET request is made by creating an Image object in JS. You can see votes appear on your network tab under the image tab instead of Fetch/XHR, even though their response return type is text/html -- interesting little hack, although I'm not…

[deleted]

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

#190
post #50

We are using Django+HTMX for internal applications. Some random tips: - Write a "Django context processor" to inspect requests for "Hx-Request" header, and set a "base_template" variable accordingly. This means that any template that {% extends base_template %} will react to being a full page or just a fragment and you don't even have to think about that in your view logic. Great for progressive enhancement. - You ca…

I’m all in into the sprinkles approach (I’m a big fan of Hotwire and most of the times that’s what I use) but the Django templates are extremely outdated and limited. I don’t miss it at all. They’re really bad. Compare it to Blade (Laravel) or even ERB (Rails) and it’s night and day.

Django templating is limited, but it's not necessarily a problem because you should be putting most of the business logic in the view/service/model anyways. After some initial friction, I don't have any issue with how limited they are.
Post reply on HN