Impacted code paths: https://codesearch.wmcloud.org/search/?q=mw.mobileFrontend&files=&excludeFiles=&repos=
Follow up from T348081
The mw.mobileFrontend library predates ResourceLoader package files and should be removed in favor of the latter.
Since MobileFrontend was built many of its APIs are no longer relevant. For example:
- We're moving to Codex and using Codex markup is preferable these days.
- ES6 is now the normal. Code such as mw.mobileFrontend.require( 'util' ).mfExtend can be replaced with native ES6
- Hooks are a stable contract and are better suited than the EventEmitter singleton.
Migration notes
Was using | Use this instead |
mw.mobileFrontend.require( 'mobile.startup').Button | require( 'mobile.startup').View and Codex markup where needed. |
mw.mobileFrontend.require( 'mobile.startup').Icon | require( 'mobile.startup').View and Codex markup where needed. |
mw.mobileFrontend.require( 'mobile.startup').IconButton | require( 'mobile.startup').View and Codex markup where needed. |
mw.mobileFrontend.require( 'mobile.startup').Anchor | Use https://doc.wikimedia.org/codex/latest/components/mixins/link.html. |
mw.mobileFrontend.require( 'mobile.startup' ).Skin.getSingleton().getLicenseMsg(); | require( 'mobile.startup').license() |
mw.mobileFrontend.require( 'mobile.startup' ).lazyImages | require( 'mobile.startup').loadAllImagesInPage() |
mw.mobileFrontend.require( 'mobile.startup' ).promisedView | require( 'mobile.startup').promisedView |
mw.mobileFrontend.require( 'mobile.startup' ).View | require( 'mobile.startup').View |
mw.mobileFrontend.require( 'mobile.startup' ).OverlayManager.getSingleton() | require( 'mobile.startup').getOverlayManager() |
mw.mobileFrontend.require( 'mobile.startup' ).Drawer | require( 'mobile.startup').Drawer |
mw.mobileFrontend.require( 'mobile.startup' ).headers.header | require( 'mobile.startup').overlayHeader |
mw.mobileFrontend.require( 'mobile.startup' ).Overlay | require( 'mobile.startup').Overlay |
mw.mobileFrontend.require( 'mobile.startup' ).eventBusSingleton.on( 'section-toggled' | mw.hook( 'mobileFrontend.section-toggled' ).add |
mw.mobileFrontend.require( 'mobile.startup' ).Browser | navigation.userAgent |
mw.mobileFrontend.require( 'mobile.startup' ).util.parseHTML | Use $() |