mv_embed has some functions for doing exactly that. You can run something like: doLoad({list, of, classes, that, i need}, function(){ //code to run now that all those components have been included. }
It plays well with the script loader and loads it all the requested components in a single scriptLoader request. If you have already loaded some of those libraries it skips the classes it already has available. and is a bit simpler than the YUI framework I think ;) --michael Sergey Chernyshev wrote: > Speaking of libraries and all, I think it's worth merging libraries in > general and figuring out a way for skin and extension developers to include > libraries in the way that system can only: > - include a library once > - include latest library unless absolutely necessary > - maybe even load parts of the library on demand ( > http://developer.yahoo.com/yui/yuiloader/ is an example of what I'm talking > about). > > Maybe it's also worth adding some JS bundles functionality where main bundle > is global JS to be loaded on all page and there can be more bundles to load > the rest of the code on pages that need them. My point is that this decision > could be made in MW and not in the extensions - system should know what is > bundled where and ignore inclusion request on the page if, let's say, YUI is > already loaded in main bundle. > > Thank you, > > Sergey > > > -- > Sergey Chernyshev > http://www.sergeychernyshev.com/ > > > On Wed, Apr 15, 2009 at 6:53 PM, Hay (Husky) <hus...@gmail.com> wrote: > > >> That's great news. I've been programming in JavaScript quite a lot the >> last few years and i think i would've probably gone insane if i hadn't >> discovered jQuery. Especially for complex and intricate HTML >> selections it's pretty amazing what you can do with jQuery. >> >> Also, the fact that animations are built into the core could mean it >> might get a little bit more simple to do visually cool things, which >> might make the UI more intuitive. >> >> -- Hay >> >> On Wed, Apr 15, 2009 at 11:45 PM, Sergey Chernyshev >> <sergey.chernys...@gmail.com> wrote: >> >>> Guys, >>> >>> It's great to see that you're working in this direction - I'm thinking >>> >> about >> >>> working on this for a while, but didn't have a gut to undertake such >>> ambitious project alone ;) >>> >>> Do you have a working instance of ScriptLoader anywhere so I can aim some >>> performance tools at it? >>> >>> Thank you, >>> >>> Sergey >>> >>> >>> -- >>> Sergey Chernyshev >>> http://www.sergeychernyshev.com/ >>> >>> >>> On Wed, Apr 15, 2009 at 5:29 PM, Michael Dale <md...@wikimedia.org> >>> >> wrote: >> >>>> These changes will probably result in some minor adjustments to existing >>>> skins. (I will try not to completely break compatibility cuz I know >>>> there are many custom skins out in the wild that would be no fun to stop >>>> working once they update medaiWiki) >>>> >>>> This consolidation of <head> includes _may_ result in _some_ un-updated >>>> skins referencing the same files twice which I think most browsers >>>> genneraly handle "oky" >>>> >>>> Enabling $wgEnableScriptLoader will not work so well with skins that >>>> have not been updated. Should have a patch soon. more about >>>> >> scriptLoader: >> >>>> http://www.mediawiki.org/wiki/ScriptLoader >>>> (We will most likely ship with $wgEnableScriptLoader off by default ) >>>> >>>> I am also very excited about jQuery making its way into core. Things >>>> like the add_media_wizard are much easier to put together with jQuery's >>>> nifty abstractions and msg system. More about add media wizard: >>>> >>>> >>>> >> http://metavid.org/blog/2009/03/27/add-media-wizard-and-firefogg-on-test-wikimediaorg/ >> >>>> peace, >>>> michael >>>> >>>> >>>> Brion Vibber wrote: >>>> >>>>> Just a heads-up -- >>>>> >>>>> Michael Dale is working on some cleanup of how the various JavaScript >>>>> bits are loaded by the skins to centralize some of the currently >>>>> horridly spread-out code and make it easier to integrate in a >>>>> centralized loader so we can serve more JS together in a single >>>>> compressed request. >>>>> >>>>> Unless there's a strong objection I'd be very happy for this to also >>>>> include loading up the jQuery core library as a standard component. >>>>> >>>>> The minified jQuery core is 19k gzipped, and can simplify other JS >>>>> >> code >> >>>>> significantly so we can likely chop down wikibits.js, mwsuggest.js, >>>>> >> and >> >>>>> the site-customized Monobook.js files by a large margin for a net >>>>> >>>> savings. >>>> >>>>> If you've done browser-side JavaScript development without jQuery and >>>>> wanted to kill yourself, I highly recommend you try jQuery -- it's >>>>> sooooo nice. :) >>>>> >>>>> -- brion >>>>> >>>>> _______________________________________________ >>>>> Wikitech-l mailing list >>>>> Wikitech-l@lists.wikimedia.org >>>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l >>>>> >>>>> >>>> _______________________________________________ >>>> Wikitech-l mailing list >>>> Wikitech-l@lists.wikimedia.org >>>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l >>>> >>>> >>> _______________________________________________ >>> Wikitech-l mailing list >>> Wikitech-l@lists.wikimedia.org >>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l >>> >>> >> _______________________________________________ >> Wikitech-l mailing list >> Wikitech-l@lists.wikimedia.org >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l >> >> > _______________________________________________ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l