Currently, all JS/CSS/JSON files in a gadget definition must be from the local wiki. It should be possible to specify files from another wiki on the WMF cluster.
And/or equivalently, it should be possible to define a gadget which is entirely loaded from another wiki – essentially a "pointer" gadget. This could be marked as hidden and used as a dependency for a user-facing gadget.
Usecases
- i18n/l10n: Generally, gadgets would want to load the core part from another wiki, and specify a local file with i18n strings and per-wiki configurations.
- Use of foreign libraries: A gadget on frwiki or dewiki should be able to use enwiki's Morebits.js library without having to maintain a local copy.
Example:
*HotCat [ ResourceLoader ] | HotCat.js@commonswiki | HotCat.css@commonswiki | HotCat-enwiki-config.json (MediaWikiGadgetsDefiniton is too limiting w.r.t. syntax, but the GadgetDefinitionNamespace syntax can be made more systematic)
Or equivalently,
Core hidden gadget which is a pointer to a gadget on foreign wiki.
*HotCat-core [ ResourceLoader | source = HotCat@commonswiki | hidden ]
The user-facing gadget, which just add a site config file to the core hidden gadget
*HotCat [ ResourceLoader | dependencies = ext.gadget.HotCat-core ] | HotCat-enwiki-config.json