Feature summary
The skipFunction feature available for RL modules in extensions would be useful for gadgets as well.
Use case(s)
On enwiki, there are many hidden "loader" gadgets which merely check if another "core" gadget needs to be loaded. Such as:
- Gadget-charinsert.js – loader gadget for charinsert-core
- Gadget-geonotice.js – loader gadget for geonotice-core
- Gadget-script-installer.js – in this case, the "core" isn't another gadget - it's just loaded as a normal script. Also, this one relies on document-ready.
- Gadget-formWizard.js - loader based on namespace
There are likely more examples from other wikis. Many of these loader gadgets could be made skipFunctions of the core gadgets, reducing the size of the module manifest.
Some more complicated loaders which rely on user.options module and conditionally load different gadgets also exist (eg. Gadget-XFDcloser.js and Gadget-refToolbar.js) though these likely can't be done with skipFunction.
Implementation
For MediaWikiGadgetDefinitionRepo, skip functions could be saved as MediaWiki:Gadgets-skip-function/<name> (to match MediaWiki:Gadgets-defintion) in js contentmodel.
For GadgetDefinitionNamespaceRepo, the skip function page name (in Gadget namespace) could be specified in the json config.