-
Notifications
You must be signed in to change notification settings - Fork 214
upgrading to YUI 3.7.2 to facilitate the use of new loader #608
Conversation
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
…tent-type. supporting ylinux/yiv
module = module.replace(/\-(min|debug)$/, ''); | ||
// something like foo/bar-min.js should become just "bar" | ||
module = libpath.basename(files[i]). | ||
replace(/\.(js|css)$/, ''). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 + ';' + |
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 |
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