Most of Vector's code involves taking data from core and transforming it for Vector's templates. This code is currently distributed between SkinVector, SkinVector22 and SkinVectorLegacy classes.
The goal of this separation is to ideally create a system whereby we can transform the presentation of any menu (i.e from tabs to dropdown) without modifying the underlying data structure (whether or not this will actually work remains to be seen).
Going forward we think it would be better to organize code using templates
Benefits
- Various component data is in the global scope making it harder to reason with templates and easier to break them. For example the input-location template value should be part of data-search-box but isn't.
- Easier to upstream code from Vector to core and vice versa.
- Component classes would match template names, making it easier to refer to the data a template has available.
GOALS
- Removal of SkinVector class will fully isolate old and new Vector
- Components will scope data to the component they serve
- Components will provide a language more consistent with Vector's abstraction than MediaWiki core menu API
TODO
(In suggested sequenced order)
- Search component https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/850197
- ULS Button
- User links
- Sticky header component
Developer notes
Rough proof of concept patches: