- From: <bugzilla@jessica.w3.org>
- Date: Mon, 28 Apr 2014 22:51:42 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25470 --- Comment #4 from Morrita Hajime <morrita@google.com> --- (In reply to Glenn Maynard from comment #3) > <script async> means "load the resource asynchronously, and run the script > as soon as it's ready". <script defer> means "load the resource > asynchronously, and run the script in the order it was added (at the end of > parsing)". If you have multiple <script defer>s, they all load > asynchronously, but later ones don't execute until earlier ones, even if the > network load happens to finish first. > > With the defer model, b.html, c.html, a.html and d.html would always be > executed in that exact order (sync before defer, then defer in the order > added), which is much easier to test--you don't have to test every possible > load order to be certain your page always works, since the load order is > always predictable. > > It seems like <script async> was a bad idea which <script defer> fixed, and > now this is making the same mistake. <script async> is bad idea because there is no way to declare the dependency to the loaded script. For imports, the import itself can contain a set of imports to require its dependency. So it's much easier for imports to be self contained. This is big difference between <scripts> and imports. Imports support textual ordering mainly for consistency of other platform bits. Imports shouldn't have to rely on that ordering and so do not well defined imports. Dependency is no longer have to be a list. Now it can be a tree. One good thing not to enforce ordering for @async is that imports that is loaded faster can rendered earlier, without waiting other imports. This is important for mashup-like scenario. Tweet buttons don't to Like buttons and vice versa. -- You are receiving this mail because: You are the QA Contact for the bug.
Received on Monday, 28 April 2014 22:51:44 UTC