Page MenuHomePhabricator

Extract out using into wrapper script
Closed, ResolvedPublic

Description

Using the wrapper dev script, the using call should also be pulled into the wrapper. That keeps the main script smaller (and slightly faster) and still allows successful dev uses to be copied (modulo formatting) into the gadget definition.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 14 2016, 6:40 PM
Sophivorus triaged this task as Low priority.Oct 14 2016, 6:41 PM
Sophivorus changed the task status from Open to Stalled.Oct 25 2016, 4:51 PM
Sophivorus lowered the priority of this task from Low to Lowest.

Needs further explanation.

It is suggesting that there be no mw.loader.using calls in the main script (https://phabricator.wikimedia.org/diffusion/1884/browse/master/proveit.js), and where to put them in general.

There have been changes in this area, but there are currently two such calls.

Under the proposal:

  1. There would be no mw.loader.using in https://phabricator.wikimedia.org/diffusion/1884/browse/master/proveit.js (but 'mediawiki.toolbar' is a special case because it's conditional, and you might want to keep that one).
  1. Instead, they would be either in a developer-only wrapper script (if you want to test while developing without loading ProveIt as a gadget), or (for regular users) at https://en.wikipedia.org/wiki/MediaWiki:Gadgets-definition (the way ProveIt-classic is defined with dependencies= and various libraries).

If you test ProveIt in gadget mode, the "developer-only wrapper script" doesn't exist and you can ignore it. As for regular users, defining it in Gadgets-definition probably has performance benefits, since ResourceLoader can optimize the loading.

Change 348792 merged by Sophivorus:
[wikipedia/gadgets/ProveIt@master] Remove unnecessary mw.loader.using call

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

Sophivorus closed this task as Resolved.Apr 18 2017, 7:40 PM
Sophivorus claimed this task.

All calls to mw.loading.using are now done from the gadget module definition at Commons (except the conditional call when using mediawiki.toolbar).