Mailing List Archive

Document usage of gadget exports for other gadgets' use
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
Re: Document usage of gadget exports for other gadgets' use [ In reply to ]
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.

--
Bartosz Dziewo?ski
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/