Page MenuHomePhabricator

Update ArticleFeedbackv5 JS to not require deprecated jQuery things to be bundled into its ResourceLoader modules
Open, LowPublic

Description

Earlier this year, in March, I had to bring back jquery.appear for AFTv5 (commit 775bc578d73b5c9d55707857eb756a478a6a389d / T159058). Now I've had to do the same for jquery.localize (see this patchset in gerrit) as it was removed from core in dd6c05481068f8105d11d6b9be6c65c379e9cbda/MediaWiki 1.33 (August/October 2018) but AFTv5 uses and requires it, and we want to make sure that AFTv5 works on Brickimedia (a ShoutWiki wiki) once ShoutWiki upgrades to MW 1.33.

Core has jquery.i18n as the suggested replacement for jquery.localize, though porting code to use jquery.i18n takes a bit more than just s/jquery\.localize/jquery\.i18n/g against the extension.json file. Given that the uses of jquery.localize relate to HTML templates (embedded into the two JS files affected), I'm thinking that this would be an appropriate use case for the Mustache engine included in MW core since 1.25. It would probably also increase code readability a bit.

Whatever the case, "let's just copy over the removed RL module into /extensions/ArticleFeedbackv5" isn't quite the right solution and it's gotta stop.

Event Timeline

Change 521022 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/extensions/ArticleFeedbackv5@master] Mustache-ify HTML templates, moving them into their own, separate files from main .js file(s)

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

Change 521022 merged by jenkins-bot:
[mediawiki/extensions/ArticleFeedbackv5@master] Mustache-ify HTML templates, moving them into their own, separate files from main .js file(s)

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