Page MenuHomePhabricator

PageTriage: Javascript refactoring to take advantage of ES6
Open, Needs TriagePublic

Description

Some ideas (courtesy @Chlod and @TheDJ):

  • functions to classes striking for now, high effort
  • var to const/let
  • $.Deferred() to Promise() (3 files)
    • Note: mw.Api uses jQuery.Promise, resulting in even more uses of it than the 3 above. And do we want to start mixing jQuery.Promise and Promise? Maybe not.
  • cleanup of that = this, (13 files)
    • Once we switch to arrow functions, those will be really easy to convert. Can just change that to this without any .bind()ing
  • conversion of function (){} to () => {} (24 files)
  • $.when to Promise.all() (4 instances)
  • concatenation to backticks, e.g. ${string} interpolation

Split from T324579: Enable ES6

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

What's left here and how can I help?

The Moderator Tools team is currently rewriting the PageTriage front end in Vue. The conversion process might clean up most of these JavaScript issues. We should come back to this task in a couple months.

Two months have past. Any updates here?

Two months have past. Any updates here?

Resolution of T343329: Special:NewPagesFeed Vue UI: wrap up feedback period and make default experience would be the threshold. The rollout has been slow, as we were hoping to be there by the end of August. Other than functions to classes, these would all be really low effort individual patches. If we struck that one item, I'd be happy to put this in our maintenance backlog that we try to whittle down every sprint.

Sounds good. I went ahead and did a strikethrough of "functions to classes". You can add to your maintenance backlog now if you want.

Thanks; done! If we don't catch this by the end of the month, we'll roll it to the next quarter.

Change #1038414 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/extensions/PageTriage@master] convert to arrow functions using eslint autofixes

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

Change #1038412 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/extensions/PageTriage@master] update eslint-config-wikimedia to 0.28.0

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

Change #1038412 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] update eslint-config-wikimedia to 0.28.0

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

Change #1038414 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] convert to arrow functions using eslint autofixes

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