Page MenuHomePhabricator

ext.globalCssJs.user and ext.globalCssJs.user.styles are silently being removed from page via targets system
Closed, ResolvedPublic

Description

Related task: T138727

NOTE: this is about avoiding the warning, which does necessarily involve the code running on mobile.

By default modules target desktop only. They must explicitly add "targets" => [ "desktop", "mobile"] to their ResourceLoader definition.

Modules that are added to the page without targets are silently removed and trigger warnings.

Longer term we would like to remove the targets system, but before doing that we need to knowingly make decisions about the code we maintain and where it should run.

Desired outcome

Option 1

If the module works on mobile, is small/sensibly loaded so as not to cause potential for performance regressions for end users it should define targets.

Option 2

If the module does not work on mobile it should be conditionally added to the page so it only runs where needed. See instructions on T235712 for potential loading strategies.

Event Timeline

Is the user module loaded on mobile? This is basically the global equivalent of that and should be treated the same.

Reedy renamed this task from ext.globalCssJs.user and ext.globalCssJs.user.styles silently being removed from page via targets system to ext.globalCssJs.user and ext.globalCssJs.user.styles are silently being removed from page via targets system.Jul 29 2020, 1:01 AM

Change 616960 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/GlobalCssJs@master] Enable on 'mobile' ResourceLoader target

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

Change 616960 merged by jenkins-bot:
[mediawiki/extensions/GlobalCssJs@master] Enable on 'mobile' ResourceLoader target

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