- Generated from a JSON file in the theme
- Use ResourceLoaderImageModule
- Map to .mw-icon-<whatever> classes in addition to .oo-ui-icon-<whatever>
We want to use ResourceLoaderImageModule to serve icons for OOjs UI in MediaWiki since it gives us better per-language icons support and brings us ever-so-slightly closer to being able to master the MediaWiki theme for OOUI in the mediawiki/core repository, which AIUI we also want to do at some point.
- Keep using what we have. No ResourceLoaderImageModule, lots of silly duplicated code in Resources.php, annoying update process if we add/remove icon packs. This is now in master.
- Use the original JSON files from OOUI source and teach ResourceLoaderImageModule to pull data directly from them. I think that's pretty gnarly. That is what the proposed patch does now.
Hopefully better idea: generate the ResourceLoader module data for MediaWiki directly. This would be a separate file that we'd load in ResourceLoader.php near "// Register core modules" code. (We already have such a thing in LocalisationCache for OOUI localisation.)
- We could make this PHP code blob like in Resources.php or a JSON file with similar structure. JSON would probably require some custom caching in order not to affect page load times, Legoktm says it's possible. PHP code would be nasty, that's not a portable format, but possibly easier to use in this scenario.
- We could generate this from OOUI build process (which would shatter the illusion of OOUI being independent from MediaWiki) or from a MediaWiki maintenance script ran during update, from update-oojs-ui.sh (would make the update process somewhat nastier?).