Page MenuHomePhabricator

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

Assigned To
Authored By
Reedy
Jan 3 2016, 1:17 AM
Referenced Files
F7495864: Screen Shot 2017-04-11 at 15.53.57.png
Apr 11 2017, 10:54 PM
F3196258: checkboxes.txt
Jan 3 2016, 2:18 AM
F3196252: injectSpinner.txt
Jan 3 2016, 2:18 AM
F3196255: onloadFuncts-user.txt
Jan 3 2016, 2:18 AM
F3196247: writeln.txt
Jan 3 2016, 2:18 AM
F3196250: getInnerText-user.txt
Jan 3 2016, 2:18 AM
F3196254: jsMsg.txt
Jan 3 2016, 2:18 AM
F3196260: opera7_bugs-user.txt
Jan 3 2016, 2:18 AM
Tokens
"Mountain of Wealth" token, awarded by Liuxinyu970226."Mountain of Wealth" token, awarded by RandomDSdevel.

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)

Screen Shot 2017-04-11 at 15.53.57.png (836×2 px, 646 KB)

Event Timeline

Reedy raised the priority of this task from to Needs Triage.
Reedy updated the task description. (Show Details)
Reedy added subscribers: Aklapper, Florian, Reedy, StudiesWorld.
Reedy set Security to None.
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 :/

Danny_B moved this task from Unsorted to Cleanup on the Technical-Debt board.
Danny_B subscribed.
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 edited projects, added MediaWiki-ResourceLoader; removed MediaWiki-General.

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

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

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.

In T122755#3220618, @TheDJ wrote:

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

Nemo_bis subscribed.

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.)

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.

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.

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?

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.