Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

upgrading to YUI 3.7.2 to facilitate the use of new loader #608

Merged
merged 6 commits into from
Oct 10, 2012

Conversation

caridy
Copy link
Contributor

@caridy caridy commented Oct 10, 2012

  • improving loader integration
  • adding some guarding on combo handler.
  • formalizing extensions and content-type.
  • supporting ylinux/yiv
  • adding support for css on the combo handler

module = module.replace(/\-(min|debug)$/, '');
// something like foo/bar-min.js should become just "bar"
module = libpath.basename(files[i]).
replace(/\.(js|css)$/, '').
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using libpath.basename(files[i], libpath.extname(files[i])) instead of the replace(/\.(js|css)$/, '') is a little more correct/robust, but might not be worth the effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the extension explicitly to trigger the error if they try to access something else, but later on I added a verification of the extension, so I can use this structure now. Should be ready in the next commit.

@drewfish
Copy link
Contributor

Besides two small comments, +1.


if (module === 'loader-app-base') {
result[i] = {
fullpath: module,
content: "YUI.applyConfig({modules:" + appMetaData + "});"
content: 'YUI.add("loader",function(Y){' +
'YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||' + appMetaData + ';' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems a little strange -- it seems like mojito has too much knowledge of how YUI works. Is there a YUI API call we can make instead (loader.addGroup() or something like that) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, it should use YUI.applyConfig(), but there is a remaning bug in yui that prevents us from using the config API. Instead, we need to plug them directly into the main object. Dav will have this fix for the next release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add that information to a comment. We really should circle back and do it the right way (once the right way is available).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drewfish
Copy link
Contributor

+1

caridy added a commit that referenced this pull request Oct 10, 2012
upgrading to YUI 3.7.2 to facilitate the use of new loader

- upgrade to YUI 3.7.2
- improving loader integration
- adding some guarding on combo handler.
- formalizing extensions and content-type in combo.
- supporting ylinux/yiv in combo
- adding support for css on the combo handler
@caridy caridy merged commit 4164f22 into YahooArchive:develop-perf Oct 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants