On Fri, Apr 7, 2017 at 7:46 AM, Felipe Schenone <scheno...@gmail.com> wrote:

> Hi all! I'm the main developer of the ProveIt gadget
> <https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt>, a reference
> manager for Wikipedia. The code is tracked via Phabricator, reviewed via
> Gerrit, and served to the various Wikipedias from Commons. Each wiki has a
> unique initialization code
> <https://en.wikipedia.org/wiki/MediaWiki:Gadget-ProveIt.js> that sets some
> local config and then requests the main code from Commons (JavaScript, CSS
> and JSON). Every time I merge a new change via Gerrit, I need to manually
> update the Commons pages so that the Wikipedias have the latest code.
>


While updating ("deploying") to the wiki is indeed an extra step, I don't
think running in real-time from master is desirable, either. The wiki could
be updated with a semi-automated build script you run locally from time to
time (e.g. "npm run deloy" or some such). Alternatively, we could consider
using a post-merge Jenkins job that would automatically run it (e.g. by
storing a BotPassword in Jenkins secure env variables).

In addition, by keeping it stored on-wiki as a real gadget and loading with
ResourceLoader there are various benefits.
* Combining files into one request.
* Minification and compression.
* Automatic CSS flipping for LTR/RTL.
* Localisation (in Gadgets 2.0).

The first three points you can get now already by loading it from Commons
using load.php instead of individual action=raw requests. This can also
perform CSSJanus directionality flipping for you when load.php?lang= is set
to that of an RTL language.

For ProveIt:
https://commons.wikimedia.org/w/load.php?debug=false&lang=en&modules=ext.gadget.ProveIt&skin=vector

Loading this one url with mw.loader.load (potentially using wgUserLanguage
and skin from mw.config) would make it a bit more efficient already.

Example for RTRC (deployed to/loaded from mediawiki.org)
<https://meta.wikimedia.org/wiki/User:Krinkle/RTRC-dev.js>.


-- Krinkle
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to