Page MenuHomePhabricator

Remove desktop / mobile only targeted code from CirrusSearch extension
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

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

[mediawiki/extensions/CirrusSearch@master] Drop ext.cirrus.explore-similar feature

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

@EBernhardson it looks like $wgCirrusExploreSimilarResults is always false in production. Could this code be removed?

Change 902210 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Drop ext.cirrus.explore-similar feature

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