Page MenuHomePhabricator

Deprecate and remove jQuery Badge plugin
Closed, ResolvedPublic

Description

jQuery Badge plugin has been introduced around 2012 for Echo and has since been replaced by our own notification development.
@kaldari pointed out, that it seems to be still in use in PageTriage for showing the number of potential issues with an article in the Curation Toolbar

We're offering interface functionality in some corner of core that is barely in use. IMO this should not be part of core functionality.

Event Timeline

Volker_E created this task.Oct 18 2017, 5:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 18 2017, 5:06 AM
Volker_E updated the task description. (Show Details)Oct 18 2017, 5:09 AM

The plug-in could easily be moved to it's own non-core, non-mediawiki repo. The only thing it uses MediaWiki for is to check if the number passed to it is a non-latin zero, which doesn't matter for PageTriage (since it's only on English Wikipedia). We could then just make it a dependency in PageTriage via Composer and remove it from core.

Created a new repo here: https://github.com/wikimedia/jquery.badge

Needs a composer.json file and to be made into a packagist package.

Needs a composer.json file and to be made into a packagist package.

Err, why? We don't distribute JS/CSS via composer packages - see T107561: MediaWiki support for Composer equivalent for JavaScript packages.

Ah yeah, this isn't PHP. Nevermind.

If we intent to publish it on npm, and maintain as a GitHub project (with tests, CI , docs, issue triage) that's cool. But if it's just about cleanly moving it out of core for PageTriage, it might make more sense to commit it directly to the PageTriage repo.

Reason being that, as long as it is a jQuery plugin, it will affect the (globally shared) jQuery prototype. Regardless of being maintained in the extension directly, or copied into PageTriage/lib from another repo. It should probably also stay registered as jquery.badge from within PageTriage, and not ext.pageTriage.badge given the saving of name conflict in ResourceLoader won't prevent the name conflict at run-time. If anything, it'd be better to have the conflict in the registry so we get an early error.

Even cleaner would be to change it from a jQuery plugin to a module.export'ed function that is require()'ed and called directly.

Change 385489 had a related patch set uploaded (by Kaldari; owner: Kaldari):
[mediawiki/extensions/PageTriage@master] Migrate to using external jquery.badge plug-in

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

Change 385490 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] resources: Deprecate the 'jquery.badge' module

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

Change 385490 merged by jenkins-bot:
[mediawiki/core@master] resources: Deprecate the 'jquery.badge' module

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

Change 386024 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@REL1_30] resources: Deprecate the 'jquery.badge' module

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

Change 386024 merged by jenkins-bot:
[mediawiki/core@REL1_30] resources: Deprecate the 'jquery.badge' module

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

Change 386029 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] resources: Removed the deprecated 'jquery.badge' module

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

Change 385489 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Migrate to using external jquery.badge plug-in

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

Change 386029 merged by jenkins-bot:
[mediawiki/core@master] resources: Remove the deprecated 'jquery.badge' module

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

Legoktm reopened this task as Open.Nov 9 2017, 4:49 AM

jquery.badge is still used by gadgets on Commons. I'm going to revert this for 2 weeks, and then it'll go back in. That should give Commons admins enough time to copy the relevant parts of jquery.badge that they need, or migrate to a different solution.

RP88 added a subscriber: RP88.Nov 17 2017, 3:44 AM
Restricted Application reassigned this task from Jdforrester-WMF to R3609901. · View Herald TranscriptNov 17 2017, 3:44 AM
mmodell added a subscriber: R3609901.
mmodell removed a subscriber: R3609901.
Legoktm closed this task as Resolved.Dec 6 2017, 9:22 AM

This happened.