[Webkit-unassigned] [Bug 50115] Please implement async=false for dynamic script loading (REGRESSION: LABjs is broken)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 30 07:08:55 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50115





--- Comment #45 from Kyle Simpson <getify at gmail.com>  2010-12-30 07:08:54 PST ---
@Antti-

> So why is async needed at all?

I assume you mean the markup `async` attribute, not the (currently being discussed) `async` property on a dynamic script element in JavaScript?

The usefulness of the `async` attribute in markup is that it tells the browser that this particular script being loaded DOES NOT have any other dependencies, and it can thus execute "as soon as possible" once it downloads.

Scripts like "ga.js" (Google Analytics) are a perfect example of a script that is standalone and has no other dependencies, and so is a candidate for "run me as soon as possible, but don't make me wait on anyone and definitely don't make anyone else wait on me."

The whole point is that in markup, I can choose to either have the "async" attribute or not, and by doing so, I'm choosing if I need ordering behavior or not. For some scripts, I need ordering, for others I don't.

In JavaScript (using a script loader), the same is of course true. Sometimes I need to preserve execution order for dependencies, sometimes I do not want to. But in JavaScript, I have *no way* to choose the ordering behavior. It's *always* "async", even if I don't want it to be. So the only way for a script loader to get ordered execution is to also do ordered loading (ie, serial one-at-a-time loading), which is of course bad for performance.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list