Much of the data in SkinTemplate::getTemplateData is unused.
We want to be able to make breaking changes to the array returned by Skin::getTemplateData - this will result in removing certain array keys from the returned data object. This will cut down on PHP processing time and result in a more data orientated format which does not include raw HTML string.
For example
- menu items generate a string html-items for legacy skins and also a more preferable array-items (used by SkinVector)
- link-mainpage is generated inside SkinTemplate::
- the SkinMustache::getCategories generates a template variable html-categories, but it also generates a data format inside data-portlets that gives more flexibility to the skin (https://github.com/wikimedia/mediawiki-skins-cli/blob/main/components/CategoryPortlet.mustache for example). On the long term we plan to port Vector to this format.
Ideas
Idea 1
Allow skin versioning
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/894732
Idea 2
Allow skins to provide a list of keys that they want to generate or not generate (e.g. an inclusion/exclusion list)