Re: resource loader; 1.32 alpha; 1.32 stable breaking change, loading scripts in widgets

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: resource loader; 1.32 alpha; 1.32 stable breaking change, loading scripts in widgets

Tom Schulze-2
I agree with Bartosz Dziewoński. However, after checking out the code, I
think the reason why I need to change the RLQ push statements is due to
the resources/src/mediawiki.base/mediawiki.base.js modifications in
v1.32 stable.

window.RLQ = {
push: function ( entry ) {
if ( typeof entry === 'function' ) {
entry();
} else {
mw.loader.using( entry[ 0 ], entry[ 1 ] );
}
}
};


It seems hacky, but when using RLQ.push() and mw.loader.using in widgets
I now have to use

 RLQ.push([ [], function () {
  mw.loader.using('mymodule');
 });

Otherwise mw.loader.using won't be defined as the anonymous function is
executed instantly (why mw.using.loader is not available globally yet at
this time I dont know for sure).
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l