See also bug 27535.
Being able to register modules on the client side will make it easier for users to write custom scripts, for example:
register( 'myUserScript', {
'wikiscripts': ['User:Krinkle/Calender.js', 'User:Krinkle/toolboxlinks.js'],
'wikistyles': 'User:Krinkle/Calender.css',
'dependencies': ['jquery.ui.datepicker'],
'messages': ['hist', 'talkpage', 'recentchanges', 'nstab-main']
});
mw.loader.load( 'myUserScript' );
.. would make 1 http request for all of that. Although this will make existing things easier it also opens up good possibilities regarding the localization of scripts. Right now it is either solved by keeping objects inside the scripts like:
'msg-clickhere' : {
'nl' : 'Klik hier',
'en': Click here'
//etc.
}
Or an additional request to the API is made to action=query&meta=allmessages, which brings in the extra complexity if having to wait for that to finish (callback, fallback, errors).
Version: 1.18.x
Severity: enhancement