Page MenuHomePhabricator

Transition Gruntfile.js tasks to NPM scripts (MobileFrontend)
Closed, ResolvedPublic3 Estimated Story Points

Description

This task encompasses the work to start transitioning Gruntfile.js tasks to package.json. This task covers all simple transitions such as ESLint and creating tasks for what remains. Delete any relevant dependencies as you go and see Popups for reference.

Developer notes

  • eslint is not using grunt
  • stylelint is not using grunt
  • banana-checker is not using grunt
  • grunt, grunt-contrib-watch and grunt-notify is removed from codebase

Motivation

We discussed this in frontend standards group today. Reasons to do this include:

  • Relying on Grunt plugin maintainers (e.g. dependant on grunt eslint-plugin upgrades everytime eslint is upgraded. Working now, albeit slower pace, but no guarantee it will in future)
  • Grunt going out of fashion
  • Focus should be on production code and less on tooling
  • Only package.json to npm install, npm start
  • Understanding how Grunt works is an unnecessary and additional tax developers need to make when working with our codebases and it's not clear if it's worth it.
  • Tasks can be run in package.json. Grunt not needed for that purpose.
  • CI faster as no longer needs to download grunt and grunt plugins.

Sign off steps

Event Timeline

Restricted Application changed the subtype of this task from "Deadline" to "Task". · View Herald TranscriptOct 2 2018, 10:55 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 464136 had a related patch set uploaded (by Jdlrobson; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Run eslint and stylelint from NPM scripts instead of grunt tasks

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

Jdlrobson updated the task description. (Show Details)

Change 464136 merged by Jdlrobson:
[mediawiki/extensions/MobileFrontend@master] Remove eslint from Grunt tasks

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

Jdlrobson updated the task description. (Show Details)
Jdlrobson renamed this task from Transition Gruntfile.js tasks to NPM scripts to Transition MobileFrontend Gruntfile.js tasks to NPM scripts.Oct 8 2018, 8:38 PM

What's the motivation behind this?

ovasileva set the point value for this task to 3.Oct 10 2018, 4:10 PM
Jdlrobson updated the task description. (Show Details)Oct 10 2018, 6:43 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)Dec 12 2018, 6:30 PM
Jdlrobson lowered the priority of this task from Medium to Low.Apr 4 2019, 9:47 PM
Jdlrobson added a subscriber: Jdlrobson.

This doesn't seem a top priority right now.

Kizule claimed this task.Dec 16 2019, 10:03 PM
Kizule added a subscriber: Kizule.

Claiming task here too, as I did it on GCI site too..

Restricted Application added a project: User-Kizule. · View Herald TranscriptDec 16 2019, 10:03 PM

Google Code in student is working on this so adding to sprint for visibility so we can provide support! :)

Change 558727 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/MobileFrontend@master] Transition of MobileFrontend Gruntfile.js tasks to NPM scripts

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

Change 558727 abandoned by Zoranzoki21:
Transition of MobileFrontend Gruntfile.js tasks to NPM scripts

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

Kizule removed Kizule as the assignee of this task.Dec 18 2019, 1:12 AM
Kizule removed projects: Patch-For-Review, User-Kizule.

I'm going to abandon this, as I don't have much free time to work on this, as I have much school works because year will end soon, and in Serbia we have "conclusion of grades" before end. + I have health problems. Sorry..

Jdrewniak added a subscriber: Jdrewniak.EditedJan 7 2020, 1:01 PM

Maybe we can even run the npm scripts in parallel to get them over with faster? I don't think the linters are interdependent.
NPM packages like concurrently can parallelize npm scripts (so can &, but this does it cross-platform) and that one has a --kill-others-on-fail option which returns a non-zero exit code if any of the tasks fail.

I think npm-run-all has the same features as well.

Change 562519 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Replacing the grunt stylelint task with an npm script

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

Change 562523 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/MobileFrontend@master] Replace i18n-linting Grunt task with NPM script, remove Grunt

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

Jdrewniak updated the task description. (Show Details)Jan 7 2020, 2:48 PM
Jdlrobson claimed this task.Jan 8 2020, 6:12 PM

Change 562519 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Replacing the grunt stylelint task with an npm script

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

Change 562523 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Replace i18n-linting Grunt task with NPM script, remove Grunt

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

Jdlrobson removed Jdlrobson as the assignee of this task.Jan 14 2020, 7:34 PM

I'm still seeing grunt-banana-checker inside MobileFrontend (I think it's unused)
https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/package.json#L42

Change 565145 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Drop unused grunt dependency

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

Change 565145 abandoned by Jdlrobson:
Drop unused grunt dependency

Reason:
confusingly https://www.npmjs.com/package/grunt-banana-checker provides banana-checker.

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

Jdlrobson closed this task as Resolved.Jan 15 2020, 10:30 PM
Jdlrobson claimed this task.

So despite the existence of grunt-banana-checker this is not using Grunt any more.

Demian renamed this task from Transition MobileFrontend Gruntfile.js tasks to NPM scripts to Transition Gruntfile.js tasks to NPM scripts (MobileFrontend).Feb 28 2020, 12:42 AM