DescriptionTightening up dart2js load timing.
The timing of main() execution in dart2js currently occurs after 'loaded' which is quite late in the page load phase (after all images) and is inconsistent with Dartium.
In order to get the timing more consistent with Dartium and more consistent in general this CL makes a couple of changes:
- dart2js generated code is now executed synchronously- this gives end developers more control over timing of main().
- A warning is generated if main() is executed during document parse time- this is primarily to ease the transition and let users know what needs to be done to more closely match Dartium behavior.
- dart.js bootstrapper no longer waits for DOMContentLoaded- the modified script tags will be executed after parse phase, the additional delay should not be necessary.
Breaking changes:
- dart2js main() execution in standard project templates now occurs after document parse but before all assets have been loaded
- Script tags directly referencing dart.js files will now execute synchronously. It's recommended that defer tags be added to these, or that they be moved to the end of the body tag.
- dart.js bootstrapper will now only auto-load script tags which occur before it on the page.
BUG=4718
R=sra@google.com, vsm@google.com
Committed: https://code.google.com/p/dart/source/detail?r=26149
Patch Set 1 : #
Total comments: 4
Patch Set 2 : #
Total comments: 9
Patch Set 3 : #Patch Set 4 : #
Total comments: 2
Messages
Total messages: 14 (0 generated)
|