<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18979</bug_id>
          
          <creation_ts>2012-09-23 21:27:02 +0000</creation_ts>
          <short_desc>provide way to guarantee order of execution for async scripts</short_desc>
          <delta_ts>2016-04-20 19:30:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Alimian">dalimian</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>arronei</cc>
    
    <cc>mike</cc>
    
    <cc>plh</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>travil</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>74326</commentid>
    <comment_count>0</comment_count>
    <who name="David Alimian">dalimian</who>
    <bug_when>2012-09-23 21:27:02 +0000</bug_when>
    <thetext>currently html 5 spec provides no clean way for a web developer to ensure order of execution of async scripts.

One simple solution to achieve this is to introduce a new attribute to script element - &quot;group&quot;

the idea is that if one has
&lt;script async=&quot;async&quot; group=&quot;group1&quot; ...&gt;&lt;/script&gt;

then this script will not be executed until any previous scripts of same group have finished executed. This should be simple for browsers to implement,- when the browser is parsing a script with group=&quot;groups1&quot; it just checks if it currently has a download or execution of a script belonging to that group, if not, execute.

This would make the web lot faster.

What you think?

to achieve a similar result currently developers are loading the scripts dynamically (thus async) and listening to the onload event for the script, then in the onload they download a dependent script, - this is a huge performance concern cause in this case the downloads happen sequentially and we want the downloads to happen in parallel.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81676</commentid>
    <comment_count>1</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-01-21 15:58:23 +0000</bug_when>
    <thetext>Mass move to &quot;HTML WG&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81794</commentid>
    <comment_count>2</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-01-21 16:01:10 +0000</bug_when>
    <thetext>Mass move to &quot;HTML WG&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125954</commentid>
    <comment_count>3</comment_count>
    <who name="Arron Eicholz">arronei</who>
    <bug_when>2016-04-20 18:47:59 +0000</bug_when>
    <thetext>HTML5.1 Bugzilla Bug Triage: This is solved by using modules. You can create and order using chained imports and then async.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125955</commentid>
    <comment_count>4</comment_count>
    <who name="David Alimian">dalimian</who>
    <bug_when>2016-04-20 19:04:39 +0000</bug_when>
    <thetext>Thanks Arron, could u provide a link to documentation tho</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125965</commentid>
    <comment_count>5</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2016-04-20 19:30:45 +0000</bug_when>
    <thetext>Here&apos;s some early details: https://24ways.org/2014/javascript-modules-the-es6-way/

The EcmaScript spec: https://tc39.github.io/ecma262/2016/ (specifically: https://tc39.github.io/ecma262/2016/#sec-ecmascript-language-scripts-and-modules)

&lt;script type=&quot;module&quot;&gt; is here for now: https://html.spec.whatwg.org/#the-script-element</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>