Page MenuHomePhabricator

skinScripts cannot be used alongside packageFiles: should throw exception.
Closed, ResolvedPublic2 Estimated Story Points

Description

While working on https://gerrit.wikimedia.org/r/c/591436 (Bug: T250851) we noticed that skinScripts do not get loaded in packageFile modules.

This will block work in building out the search widget in Vue.js so it's of high importance that we get this unblocked.

In the meantime we could revert the use of packageFiles in this module or split out a new module however we'd like to avoid this if at all possible.

Acceptance criteria

  • Setting skinScripts and packageFiles on the same module should thrown an exception.

Developer notes

After talking to @Catrope we think that virtual packageFiles using hooks could solve the needs of skins wants to change behaviour. With this in mind we should thrown an exception of skinScripts is mixed with packageFiles.

Event Timeline

Jdlrobson renamed this task from skinScripts cannot be used alongside packageFiles to skinScripts cannot be used alongside packageFiles: should throw exception..May 6 2020, 8:58 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson triaged this task as Medium priority.May 8 2020, 4:18 PM
Jdlrobson moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.
Jdlrobson added a project: patch-welcome.

With or without throw, they can't both be used at the same time (there can only be one main module.exports). So I assume this does not block, T250851. Right?

The equivalent of skinScripts in packageFiles, is a virtual file that you define from a callback based on any variant factors you wish (language, skin, wiki config etc.).

ovasileva set the point value for this task to 2.Jun 8 2020, 5:28 PM

Change 604011 had a related patch set uploaded (by Vas Yaremchuk; owner: Vas Yaremchuk):
[mediawiki/core@master] skinScripts cannot be used alongside packageFiles: should throw exception

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

vas subscribed.

Jon, please check my patch.

Jon, I have fixed 2 issues in includes/resourceloader/ResourceLoaderFileModule.php

You can run tests again.

Change 604011 had a related patch set uploaded (by VolkerE; owner: Vas Yaremchuk):
[mediawiki/core@master] skinScripts cannot be used alongside packageFiles: should throw exception

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

Change 604647 had a related patch set uploaded (by Vas Yaremchuk; owner: Vas Yaremchuk):
[mediawiki/core@master] resourceloader: skinScripts cannot be used alongside packageFiles

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

Change 604647 abandoned by Jdlrobson:
resourceloader: skinScripts cannot be used alongside packageFiles

Reason:
Per https://phabricator.wikimedia.org/T251957#6214484

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

Change 604011 had a related patch set uploaded (by Jdlrobson; owner: Vas Yaremchuk):
[mediawiki/core@master] resourceloader: skinScripts cannot be used alongside packageFiles

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

Change 604011 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: skinScripts cannot be used alongside packageFiles

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

Change 604890 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Improve packageFiles/skinScripts error message

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

Change 604890 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Improve packageFiles/skinScripts error message

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

Jdlrobson updated the task description. (Show Details)