While we've been migrating code to webpack, for backwards compatibility we've been making use of the deprecate module function and changing function signatures. These lead to console deprecation warnings.
This task will be updated as more modules make use of it, and we'll squash those in one clean swoop!
Acceptance criteria
- ag "mobileFrontend.deprecate" src/ shows zero results
- All notices reporting "Setting events on the View is deprecated. Please use options." are fixed.
- DEPRECATED_PROPERTIES inside src/mobile.startup/View.js is an empty array. (was removed entirely)
- Any modules defined using M.define that are not used by Minerva are removed.
- ag "this.events" in MobileFrontend matches nothing
- Ensure matches for ag M.define match M.require calls in Minerva - e.g. we're not porting anything we don't need to be.
Developer notes
Fixing this.events
The following files need fixes:
- resources/skins.minerva.options/BackToTopOverlay.js (move to props, drop redundant View.prototype.events)
- resources/skins.minerva.scripts/init.js (update initRedLinks to drop CtaDrawer.prototype.events)
- src/mobile.mediaViewer/LoadErrorMessage.js (move events to View.call)
- src/mobile.startup/Overlay.js (move events to View.call... caution - make sure all Overlay's are not passing events)
- src/mobile.startup/Panel.js
- src/mobile.startup/references/ReferencesDrawer.js (move events to View.call)
- src/mobile.startup/watchstar/Watchstar.js (move events to View.call)
- src/mobile.startup/Skin.js (empty events object - can simply be removed)
Fixing the modules
https://codesearch.wmflabs.org/search/?q=M.require&i=nope&files=&repos=
Will let you know which modules need to be exposed to other extensions. Don't expose anything that doesn't need to be!