Page MenuHomePhabricator

mobile.init should not be loaded on desktop Minerva
Closed, ResolvedPublic

Description

The mobile.init module was setup to capture the side effects of code that runs on skins operating in mobile.
While it was intended to be used to handle changes in the MobileFormatter, e.g. lazy loading and lazy loaded references, it appears to have been tainted to also provide a method mw.mobileFrontend.getCurrentPage() and a shared skin instance.

This also means that VisualEditor doesn't behave correctly in desktop mode (see T208068)

Long term Minerva can only depend on the mobile.startup module in MobileFrontend. When we finally get round to doing T171000 we will swap this out for an npm module.

Acceptance criteria

  • Skin::getLicenseMsg is separated from Skin as a pure function.
  • Remove all instances of M.require( 'skins.minerva.scripts/skin' )
  • Remove all instances of M.require( 'mobile.init/skin' )
  • mobile.init should be removed from Minerva's skin.json
  • mobile.init no longer exports getCurrentPage. This factory method is moved to mobile.startup

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 19 2019, 7:01 PM

Change 491568 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Deprecate access to mobile.init from skins

https://gerrit.wikimedia.org/r/491568

Jdlrobson updated the task description. (Show Details)Feb 19 2019, 8:04 PM

Change 491576 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Reduce dependency on mobile.init

https://gerrit.wikimedia.org/r/491576

Change 491656 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/skins/MinervaNeue@master] skins.minerva.scripts/init: Remove unnecessary use of 'mobile.init/skin'

https://gerrit.wikimedia.org/r/491656

Change 491656 abandoned by Bartosz Dziewoński:
skins.minerva.scripts/init: Remove unnecessary use of 'mobile.init/skin'

Reason:
Never mind, I need to read better…

https://gerrit.wikimedia.org/r/491656

Change 491568 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Deprecate access to mobile.init from skins

https://gerrit.wikimedia.org/r/491568

Change 523982 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Introduce Skin.getSingleton function

https://gerrit.wikimedia.org/r/523982

Change 523984 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Drop mobile.init dependency

https://gerrit.wikimedia.org/r/523984

Change 523982 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Introduce Skin.getSingleton function

https://gerrit.wikimedia.org/r/523982

Change 491576 abandoned by Jdlrobson:
Reduce dependency on mobile.init

Reason:
See https://gerrit.wikimedia.org/r/523984

https://gerrit.wikimedia.org/r/491576

Change 523984 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Drop mobile.init dependency

https://gerrit.wikimedia.org/r/523984

Jdlrobson closed this task as Resolved.Wed, Jul 24, 6:19 PM
Jdlrobson claimed this task.