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 ===
I don't know if its best practise to do this, but core seems to do:
(window.RLQ=window.RLQ||[]).push(function () {
mw.loader.using('ext.myextension').then(function(){
console.log('library loaded');}); });
You probably don't have many other options if you are using the Widgets
extension.
--
Best practice is to use the PHP methods which generate the required
wrappers. Have a look at ResourceLoader::makeLoaderConditionalScript()
and ResourceLoader::makeInlineCodeWithModule().
Alternatively, if it's possible, it is ideal to put the initialization
code into another module and load
dear all,
i experienced breaking changes when loading scripts in the widgets
extension through the resource loader. please check the gitlab snippet
[1] i created. i did not find any documentation and checked the
migration guide [2].
is the code presented in the gitlab snippet good practice?