Page MenuHomePhabricator

Remove desktop / mobile only targeted code from MediaWiki skins and extensions
Closed, ResolvedPublic

Description

Various skins/extensions intentionally set a targets of either mobile OR desktop to avoid loading that code on mobile/desktop site.
Going forward we want to move away from that - so that we can improve caching of ResourceLoader resources. If we fix this we'll be able to remove the targets system altogether.

Doing this requires following the guidelines in https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers#Target_system and moving away from a mobile domain VS desktop domain distinction to a media query or skin based approach (note: mobile vs desktop is still possible if truly needed via MobileContext service but should be used as a last resort)

Offending code will have extension/skin json ResourceLoader module definitions in the following forms:

"targets": "desktop"
"targets": "mobile"
"targets": [ "desktop" ]
"targets": [ "mobile" ]

The following query marks some of the offenders (query to be improved later):
https://codesearch.wmcloud.org/search/?q=%5C%5B%20%22(desktop%7Cmobile)%22%20%5C%5D&i=nope&files=(extension%7Cskin).json&excludeFiles=&repos=

Event Timeline

Please be careful with "Create Subtask", it copies all subscribers.

Note that these have missed the boat for 1.41, so should be moved/re-evaluated for 1.42.

Change 984879 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/BlueSky@master] Maintenance: Address deprecations in 1.41

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

Jdlrobson claimed this task.

This looks like it was complete with two exceptions in 3rd party extensions/skins

I posted a patch for:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/BlueSky/+/984879

Extension:ImageCompare is marked as "hincompatible with MediaWiki 1.38 or any later release!" so I won't post a patch.

Change 984879 merged by jenkins-bot:

[mediawiki/skins/BlueSky@master] Maintenance: Address deprecations in 1.41

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