Page MenuHomePhabricator

Consolidate svgmin config and svg / grunt-svgmin checker
Open, MediumPublic

Description

MobileFrontend, MinervaNeue, and Popups each contain approximately the same lengthy svgmin config and script or Gruntfile. This task encompasses the work to consolidate and move the config and the checker script to a new repo under wikimedia and publish a new NPM package under @wikimedia and replace the duplicate code in MobileFrontend, MinervaNeue, and Popups (don't forget to uninstall the grunt-svgmin package). The new checker should be invoked as a pre-commit hook. This task will also involve re-reading the svgmin configuration documentation to have reasonable due diligence that our configuration and usage are up to date.

See also:

Event Timeline

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptSep 13 2018, 4:01 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

How does this relate to the work @Volker_E did (and T178867)?

I'm keen to hear if there is a standard way to do this.^

Hopefully we can discuss this in a future frontends session..

Jdlrobson renamed this task from Consolidate svgmin config and checker to Consolidate svgmin config and svg / grunt-svgmin checker.Mar 3 2020, 6:58 PM
Jdlrobson added subscribers: Legoktm, Jdforrester-WMF.

From @Jdrewniak on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Popups/+/682017:

I'd prefer a solution written in Node.js and the SVGO JS api (an additional benefit being the ability to loop through files asynchronously), offering the best cross-OS compatibility. That being said, I don't think the creation of such a library should be a blocker here.

This should be split up into two tasks:

  1. A Wikimedia specific SVGO config, since v2.n possible as JS based config as dependency
  2. A Wikimedia svg_check as dependency for linting
  1. SVGO and svg_check (or similar) use centralized config