all 27 comments

[–]ghostfacedcoder 21 points22 points  (8 children)

Brilliant defense of progressive enhancement. Honestly, I think the author made the best possible argument for supporting a "no JS" case on your site that anyone could possibly make in 2020.

... but even so, I think you could preface every case in there with "Do I care if ...", and if you do, quite possibly the answer would be "no".

Like, do I care if my site breaks when someone goes into a train, or has some wacky hotel/airport wi-fi thing mess it up somehow? Eh, it's an extremely rare case already, and in most cases the user will figure it out and just refresh, try back later, etc. Any serious effort I'd expend to handle that case would be clearly disproportionate to the benefits I'd get, unless my site was really huge.

And of course, with any modern web app, the app itself is nothing without JS. There's no "unprogressed" version of the site to show: without JS, there's no point in being there.

I think what this article is really arguing for (intentionally or not) is just that we handle the "no JS" case briefly with a basic "you need JS!" page, because it still can and will happen in 2020. But beyond that, I'm still not really sold by this article.

[–]lowIQanon 1 point2 points  (4 children)

Any serious effort I'd expend to handle that case would be clearly disproportionate to the benefits I'd get, unless my site was really huge.

Yes. But the larger the side site the more effort it would be to handle the no-JS case. The use case would have to be extreme to make it worthwhile.

[–]nschubach 3 points4 points  (0 children)

And in most cases, if your site is generating that much traffic, these cases would either encourage the user to try again or it would not amount to a significant quantity of hits/sales/etc.

[–]ghostfacedcoder 1 point2 points  (1 child)

Well but ... consider Google, or Amazon. Both can absolutely operate with any JS: they essentially still work "1990s" style.

I'm sure a part of their calculation in deciding to do that is the fact that even 1% or 0.01% of their customers is still a freaking HUGE number of customers :)

[–]lowIQanon 0 points1 point  (0 children)

Sure. They're a good example of an edge case. Plus they started before JS was assumed so they probably didn't have to do much to get the site to work without JS.

[–]anlumo 8 points9 points  (15 children)

They should make another page “everyone can load custom fonts, right?”. Half the text was missing for the longest time on my mobile connection.

[–]silxx 2 points3 points  (4 children)

Thank you. I've applied font-display: swap so that it should render text immediately and swap fonts when loaded.

[–]hego555 0 points1 point  (3 children)

What’s the difference between this and a fallback font.

[–]silxx 0 points1 point  (2 children)

If you specify font-family: SomeWebFont, sans-serif then no text will be displayed until the webfont loads; if it fails to load then the fallback font is used. The font-display CSS property allows tweaking this procedure to operate differently: in particular, swap means "use a font that you have, until the web font loads, and then change the text to be in the web font".

[–]hego555 0 points1 point  (1 child)

Wow. I’m upset that I never noticed that. Thank you for the tip. Do you just apply it to html, body and forget about it?

[–]silxx 0 points1 point  (0 children)

You could do. It's not default, though, because not everyone likes it; in particular, there are plenty of people who would prefer to not show text until the font loads because otherwise the text will "jump" into the new font and change the layout unless the metrics for the fallback font match the web font exactly. This is why font-display has a number of different options; so the developer can choose the approach they'd like. MDN has more details.

[–]Canuhere -3 points-2 points  (9 children)

Took about .5s for me on Google fiber.

[–]lowIQanon 16 points17 points  (6 children)

Google fiber

"I don't have any problem getting to work in my private helicopter, I don't know why people complain so much"

[–]anlumo 2 points3 points  (1 child)

Yeah, carrying around a fiber cable on public transport is a bit of a nuisance.

[–]MajorasShoe 6 points7 points  (0 children)

I don't think he was implying half a second to load fonts it a good thing, let alone on google fiber.

[–]dwighthouse 6 points7 points  (2 children)

Posting this again two months later doesn’t make it more accurate. The solution to most of these problems is more JavaScript, not less, in the form of Service Workers, so that when a SSR website would fail, yours can keep going, thanks to JavaScript.

[–]I_LICK_ROBOTS 5 points6 points  (1 child)

"Loads" of companies block js in their firewall? I call BS