Scripts: async, defer
I’m constantly forgetting the difference between the async
attribute and the defer
attribute on script
elements—this is a handy explanation.
I’m constantly forgetting the difference between the async
attribute and the defer
attribute on script
elements—this is a handy explanation.
Scott re-examines the browser support for loading everything-but-the-critical-CSS asynchronously and finds that it might now be as straightforward as this one declaration:
<link rel="stylesheet" href="/path/to/my.css" media="print" onload="this.media='all'">
I love the fact the Filament Group are actively looking at how deprecate their loadCSS
polyfill—exactly the right attitude for polyfills in general.
A truly monstrous async web chat using no JS whatsoever on the frontend.
This is …I mean …yes, but …it …I …
A great primer by Ire:
Web workers, service workers, and worklets are all scripts that run on a separate thread. So what are the differences between these three types of workers?
Here’s a great even-handed in-depth review of Going Offline:
If you’re interested in the “offline first” movement or want to learn more about Service Workers, Going Offline by Jeremy Keith is a really gentle and highly accessible introduction to the topic. At times, it even felt “too gentle”, with Keith taking a moment here and there to explain what a “variable” is and what “JSON” (JavaScript Object Notation) is. But, this just goes to show you the unassuming and welcoming mindset behind writing a book like this one.
Slides from a conference talk with a really clear explanation of how async
+ await
works with promises.
It looks like the async
attribute is going to ship in Chrome for img
elements:
This attribute would have two states:
- “on”: This indicates that the developer prefers responsiveness and performance over atomic presentation of content.
- “off”: This indicates that the developer prefers atomic presentation of content over responsiveness.
This article makes a good point about client-rendered pages:
Asynchronously loaded page elements shift click targets, resulting in a usability nightmare.
…but this has nothing, absolutely nothing to do with progressive web apps.
More fuel for the fire of evidence that far too many people think that progressive web apps and single page apps are one and the same.
At first when I was reading this JavaScript coding guide, I thought “Isn’t this exactly what promise
s address?” but that is then addressed further down:
Before looking at more advanced solutions, remember that callbacks are a fundamental part of JavaScript (since they are just functions) and you should learn how to read and write them before moving on to more advanced language features, since they all depend on an understanding of callbacks.
Fair enough. In any case, what you’ll find here is mainly good advice for writing modular code.
Mariko has a real knack for explaining technical concepts in a very accessible way. This time it’s JavaScript promise
s.
Monica takes a look at the options out there for loading web fonts and settles on a smart asynchronous lazy-loading approach.
This Async event at 68 Middle Street on June 11th looks like it’s going to good (and relevant to my interests).
Scott shares the code that Filament Group are using to determine which style declarations are critical (and can be inlined) and which are non-critical (and can be loaded asynchronously). It makes quite a difference in perceived performance.
By the way, I really, really like the terminology of “critical” and “non-critical” CSS, rather than “above the fold” and “below the fold” CSS.
Tom is running a Node School at 68 Middle Street on the evening of March 27th. I plan to attend and finally wrap my head around all this Node stuff.
A new geek gathering in Brighton, every second Thursday, all about JavaScript.
This looks like an interesting approach to web analytics: a JavaScript function pings the service every 10 seconds allowing for a near realtime overview.