Ticket #2532076 (closed enhancement)

Reporter


Ilya Goberman
Opened: 03/30/12
Last modified: 08/1/12
Status: closed
Type: enhancement
Resolution: fixed

Owner


Dav Glass
Target Release: 3.6.0
Priority: P3 (normal)
Summary: Combo Loader broken in 3.5.0pr4
Description:

YUI combo loader is broken in 3.5.0pr4 and fails to load js files in the correct order. But it does look like these are loaded correctly in the Chrome debugger. This is major show stopper.

The test case is below. If you keep pressing F5 in Chrome, you will get 'Uncaught ReferenceError: a is not defined' eventually in Chrome:

  • ComboTest.html

<script src="http://yui.yahooapis.com/3.5.0pr4/build/yui/yui-min.js"></script>

<script>
var getConfig = function () {
var config = {
modules: {
'a': {
fullpath: 'a.js'
},
'b': {
fullpath: 'b.js',
requires: ['a']
}

}
};

return config;
};

YUI(getConfig()).use('b', function (YUI3) {
});
</script>

  • a.js file:

a = function () {
};

  • b.js file:

b = function () {
};

b.prototype = new a();

Type: enhancement Observed in Version: 3.5.0pr4
Component: Loader Severity: S3 (normal)
Assigned To: Dav Glass Target Release: 3.6.0
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: All
URL:
Test Information:

Change History

Dav Glass

Posted: 03/30/12
  • location changed to Library Code
  • milestone changed to 3.6.0
  • priority changed to P3 (normal)
  • severity changed from S1 (critical) to S3 (normal)
  • status changed from new to accepted
  • type changed from defect to enhancement

Since your modules are not wrapped with a YUI.add, you need to add an `async: false` flag to your modules config:

https://gist.github.com/2252248

I can however add an `async` flag to the YUI config that will force all modules to load in async, but this is not recommended for performance. The `YUI.add` wrapper fixes this by not executing the JS until use time and not load time.

Dav Glass

Posted: 03/30/12

Ref #2532076 - Added documentation to Loader for async loading
View Commit: 75d7c0828cc6c14fe43d0822cb539140063eeb64

Dav Glass

Posted: 03/30/12

Ref #2532076 - Added documentation to Loader for async loading
View Commit: 75d7c0828cc6c14fe43d0822cb539140063eeb64

Dav Glass

Posted: 04/5/12
  • estimated changed from 0 to 0.25
  • remaining changed from 0 to 0.25
  • sprint changed to sprint 1

Dav Glass

Posted: 04/6/12
  • completed changed from 0 to 0.25
  • remaining changed from 0.25 to 0

Dav Glass

Posted: 04/10/12

Ref #2532076 - Added documentation to Loader for async loading
View Commit: 75d7c0828cc6c14fe43d0822cb539140063eeb64

Dav Glass

Posted: 04/12/12
  • resolution changed to fixed
  • status changed from accepted to checkedin

Fixes #2532076 - Added a global async flag to Loader, still defaults to true
View Commit: 50ea99ae99adbbeea376962d7fa873e3403350a0

Jenny Donnelly

YUI Developer

Posted: 08/1/12
  • status changed from checkedin to closed

Shipped in 3.6.0. Marking closed/fixed.