Ticket #2531788 (accepted enhancement)

Reporter


Julien Lecomte
Opened: 02/14/12
Last modified: 09/19/12
Status: accepted
Type: enhancement

Owner


Dav Glass
Target Release: BACKLOG
Priority: P3 (normal)
Summary: YUI::use should not invoke the callback if a module is missing and the loader disabled
Description:

If the loader is disabled (

bootstrap: false
), the callback passed to YUI::use should not be invoked if a required module or dependency is missing. Here is an example:

YUI({
bootstrap: false
}).use('calendar', function (Y) {
new Y.Calendar(...);
});

Disabling the loader is useful when an application wants to handle the loading of its assets separately. In this situation, the callback should be invoked only when all the listed modules and their
dependencies have become available. See this presentation for a very specific use case:

http://www.slideshare.net/julien.lecomte/an-unconventional-loading-strategy-for-yui-3

I will attach a file to this ticket that shows how we fixed that behavior in Yahoo! search.

Type: enhancement Observed in Version: 3.5.0pr2
Component: YUI Global Object Severity: S3 (normal)
Assigned To: Dav Glass Target Release: BACKLOG
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: All
URL:
Test Information:

Attachments

Attachment #1: fix.js (download)

Change History

Dav Glass

Posted: 02/14/12
  • location changed to Library Code
  • priority changed to P3 (normal)
  • status changed from new to accepted
  • type changed from defect to enhancement

AFAIK this is by design, I've always hated the design but that's the way it's always been. Changing from a defect to an enhancement.

I can't make this change this late in the game & I can't apply your fix because it uses parts of the core that do not exist when the core is loaded.

I can ask the team for their input on this issue and come up with a resolution, but it will likely not be in the 3.5.0 timeframe as we are already on our PR 3 release.

Julien Lecomte

YUI Developer

Posted: 02/14/12

Yes, I remember talking to Adam about this and he told me this was by design (a bad design IMHO) so I agree that this should be an enhancement. Also, since I already have a fix, I don't need this into YUI 3.5.0. I can deal with the current situation for now and a better fix (not the one I provided, this was only for reference) can be applied to a later version of the library. Cheers!

Dav Glass

Posted: 02/14/12
  • milestone changed to 3.6.0

Dav Glass

Posted: 04/5/12
  • sprint changed to backlog

Dav Glass

Posted: 07/24/12
  • milestone changed from 3.6.0 to 3.NEXT

Jenny Donnelly

YUI Developer

Posted: 09/19/12
  • milestone changed from 3.NEXT to BACKLOG

Moving from 3.NEXT to BACKLOG.