Remove mediawiki.legacy.wikibits methods deprecated since before 1.18
Closed, ResolvedPublic

Description

WARNING: Users using old user or local scripts and gadgets have JavaScript broken since 2017-04-27. Some advice on what to disable is available. See also mw:RL/MGU and mw:RL/JD.
REMINDER: If a Gadget or Common.js script uses mw.util, mw.notify, or any other module that wikibits happened to be loading previously, these must be declared as a dependency in [[MediaWiki:Gadgets-definition]] (adding |dependencies=mediawiki.util, example) or ensures through mw.loader.using(). See example edit.
	 * @deprecated since 1.17 Use jquery.client instead
	 * @deprecated since 1.17 Use jQuery instead
	 * @deprecated since 1.17 Use jquery.checkboxShiftClick instead
	 * @deprecated since 1.17 Use mw.toolbar instead
	 * @deprecated since 1.18 Use jquery.spinner instead
	 * @deprecated since 1.18 Use mw.html instead
	 * @deprecated since 1.17 Use mediawiki.notify instead
	 * @deprecated since 1.17 Use mediawiki.util or jquery.accessKeyLabel instead
	 * @deprecated since 1.17 Use mw.loader instead. Warnings added in 1.25.
	 * @deprecated since 1.17 Use mw.loader instead. Warnings added in 1.25.

I'm guessing most of them will be onwiki usages, which are more of a PITA to cleanup

mw-js-deprecate usage (logged-in users only, sampled 1:100)

Reedy created this task.Jan 3 2016, 1:17 AM
Reedy updated the task description. (Show Details)
Reedy raised the priority of this task from to Needs Triage.
Reedy added subscribers: Aklapper, Florian, Reedy, StudiesWorld.
Krenair added a subscriber: Krenair.Jan 3 2016, 1:20 AM
Reedy set Security to None.
Reedy updated the task description. (Show Details)Jan 3 2016, 1:28 AM
Reedy added a comment.Jan 3 2016, 1:47 AM
addCheckboxClickHandlers
checkboxClickHandler
ff2_bugs
is_chrome_mac
is_chrome
is_ff2
is_ff2_win
is_ff2_x11
is_opera_preseven
is_safari_win
opera6_bugs
opera7_bugs
opera95_bugs
removeHandler
runOnloadHook
setupCheckboxShiftClick
webkit_match

Have no usages onwiki in the MediaWiki namespace, but they do in User :/

Reedy added a comment.Jan 3 2016, 2:18 AM

He7d3r added a subscriber: He7d3r.Jan 7 2016, 4:03 PM
Danny_B moved this task from Unsorted to Cleanup on the Technical-Debt board.
Danny_B added a subscriber: Danny_B.
Krinkle renamed this task from Cleanup pre MW 1.20 deprecations in Wikibits.js to Remove legacy wikibits.Mar 24 2016, 2:27 AM
Krinkle triaged this task as Low priority.
Krinkle added a subscriber: Krinkle.EditedMar 24 2016, 2:33 AM

Detaching from parent task T122754 because this is not gonna happen in this release cycle.

wikibits.js only contains deprecation markers. There is nothing left. This is really about the removal of that library in general. However we're not ready for that yet:

  • Deprecation (2011; MediaWiki 1.17)
  • Announce deprecation (October 2013)
  • Deprecation warnings (MediaWiki 1.23)

Normally the next step would be removal. However we need an additional phase in our case because this module is loaded by default. Adding a blocker on T35836: Set $wgIncludeLegacyJavaScript = false by default (part of MediaWiki 1.27) which will ride the deployment train a few weeks from now. After that, people will have the option to temporary restore any breakage they find by adding an explicit dependency as stop-gap measure. Then (closer to when we'll cut the 1.28 branch in September 2016) we can remove the library.

Jdforrester-WMF renamed this task from Remove legacy wikibits to Remove use of legacy wikibits.Mar 24 2016, 8:54 PM
Krinkle renamed this task from Remove use of legacy wikibits to Remove mediawiki.legacy.wikibits module.Mar 25 2016, 10:49 PM
Krinkle renamed this task from Remove mediawiki.legacy.wikibits module to Remove mediawiki.legacy.wikibits methods deprecated since 1.17.Apr 10 2016, 2:12 AM
Krinkle renamed this task from Remove mediawiki.legacy.wikibits methods deprecated since 1.17 to Remove mediawiki.legacy.wikibits methods deprecated since before 1.18.

Change 282506 had a related patch set uploaded (by Krinkle):
[WIP] wikibits: Remove methods deprecated since 1.17 and 1.18

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

Krinkle moved this task from Accepted: Enhancement to Assigned on the MediaWiki-ResourceLoader board.
Krinkle claimed this task.
Krinkle moved this task from Inbox to Doing on the Performance-Team board.
Krinkle updated the task description. (Show Details)Apr 11 2017, 10:54 PM

Change 282506 merged by jenkins-bot:
[mediawiki/core@master] wikibits: Remove methods deprecated since 1.17 and 1.18

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

Krinkle closed this task as Resolved.Apr 12 2017, 2:35 AM
TheDJ added a subscriber: TheDJ.Apr 28 2017, 12:49 PM

Note that this change has two side effects I think, which are causing a lot of errors since deploy:

1: some variables that were silently failing are now hard failing, because the variable is no longer defined, yet still referenced.
2: mediawiki.util dependency was dropped, exposing a lot more user scripts that were not actively ensuring their dependency on mediawiki.util.

Nemo_bis updated the task description. (Show Details)Apr 29 2017, 1:04 PM
whym added a subscriber: whym.Apr 30 2017, 6:08 AM

2: mediawiki.util dependency was dropped, exposing a lot more user scripts that were not actively ensuring their dependency on mediawiki.util.

Just to make sure: does MediaWiki:Common.js need the same fix as user scripts do, if it uses mw.util without calling mw.loader.using first? (I'm asking because when I hear "user scripts" I think of scripts located under [[User:..., but not [[MediaWiki:...) Many sites might still be using mw.util in Common.js in that way.

I hope this fix is what is supposed to be done: https://ja.wikipedia.org/w/index.php?title=MediaWiki:Common.js&diff=63936276&oldid=62869164

@whym yes, that also goes for MediaWiki:Common.js

The list at https://www.mediawiki.org/wiki/ResourceLoader/Legacy_JavaScript#wikibits.js should be updated to reflect what has been removed.

Nemo_bis updated the task description. (Show Details)May 1 2017, 1:03 PM
Nemo_bis added a subscriber: Nemo_bis.

mw.util is probably used in a now-broken way in hundreds of gadgets and common.js. Someone please mwgrep the wikis to see the affected ns8 pages at least. Then we can notify the local administrators and hopefully the global interface editors can help as well.

(If we don't get some speed at fixing this breakage, a revert may be in order.)

TheDJ added a comment.EditedMay 1 2017, 3:17 PM

I have to agree. I think I fixed about 50 scripts now, just on en.wp. I assume this means that many thousands of users outside of en.wp now experience JS loading problems.

Krinkle updated the task description. (Show Details)May 1 2017, 11:36 PM
Krinkle updated the task description. (Show Details)May 1 2017, 11:54 PM
Nirmos added a subscriber: Nirmos.May 2 2017, 9:34 PM

I have requested global editinterface rights at https://meta.wikimedia.org/wiki/Steward_requests/Global_permissions#Global_editinterface_for_Nirmos

I'm seeing many projects in script error and I'd like to fix that.

Continuing this conversation at T164242.

Nemo_bis updated the task description. (Show Details)May 8 2017, 8:34 AM
Nemo_bis updated the task description. (Show Details)May 14 2017, 9:17 AM
Nirmos updated the task description. (Show Details)May 15 2017, 3:37 AM

By the way, why is mediawiki.util still listed in https://www.mediawiki.org/wiki/ResourceLoader/Core_modules#mediawiki.util which claims it's supposed to be always present?

Krinkle added a comment.EditedMon, Jun 5, 1:40 PM

By the way, why is mediawiki.util still listed in https://www.mediawiki.org/wiki/ResourceLoader/Core_modules#mediawiki.util which claims it's supposed to be always present?

Where does it say that?

The "Core modules" page intends to document all modules that ship with the MediaWiki core software, e.g. All available modules, or all modules that can be loaded. Not a single one of those modules can be assumed to be present by default. This has not changed.

ResourceLoader documentation consistently states that code/scripts/gadgets must always declare dependencies on what they need or use. Either through a "dependencies" list (like for extensions and gadgets) or through wrapping with mw.loader.using.

If something else on the page, or something else enabled by the user, happens to already provide that module, ResourceLoader knows to not load the same module twice.

Where does it say that?

Indeed it doesn't. I misread this sentence at the beginning:

The modules jquery and mediawiki together form the base environment ("startup") and are present always.