Hello all,
Testing shows that a gadget can export something for another gadget (or user script) to use. But I cannot find any documentation regarding this. (Please don't confuse this with package gadgets -- they are different concepts.)
Examples here: https://test.wikipedia.org/wiki/MediaWiki:Gadget-packagefileuser.js and https://test.wikipedia.org/wiki/MediaWiki:Gadget-packagefilebase-file1.js.
I would like to draw your attention to this, as there is [a default gadget on Chinese Wikipedia](https://zh.wikipedia.org/wiki/MediaWiki:Gadget-HanAssist.js) utilizing this feature, so things can be better if this is officially documented.
For more information, please checke out [T349459](https://phabricator.wikimedia.org/T349459), thanks.
Best regards,
Diskdance
Everything you're doing in the examples with `module.exports` and `require` is supported, it works in the same way in Gadgets as in any other ResourceLoader module.
We'll find a place to document it better.
wikitech-l@lists.wikimedia.org