Page MenuHomePhabricator

jQuery migration warning printed in Page.js
Closed, ResolvedPublic

Description

Visiting https://en.m.wikipedia.beta.wmflabs.org/wiki/User:Wik781?debug=true#/talk prints the following migration warning:

JQMIGRATE: jQuery(window).on('load'...) called after load event occurred
migrateWarn @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:10340
jQuery.event.add @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:10698
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:4962
each @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:362
each @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:157
on @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:4961
on @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:5570
postRender @ Page.js?ce23d:235
render @ View.js?d4b09:244
_postInitialize @ View.js?d4b09:203
initialize @ View.js?d4b09:184
View @ View.js?d4b09:88
Page @ Page.js?ce23d:24
_addContent @ TalkOverlay.js?e4d40:127
(anonymous) @ TalkOverlay.js?e4d40:105
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
deferred.(anonymous function) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3778
proxy @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:496
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
deferred.(anonymous function) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3778
(anonymous) @ api.js?8308a:268
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
done @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9272
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9514
XMLHttpRequest.send (async)
send @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9566
ajax @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9173
jQuery.ajax @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:10483
ajax @ api.js?8308a:246
get @ api.js?8308a:134
getPage @ PageGateway.js?90ce1:117
_loadContent @ TalkOverlay.js?e4d40:100
postRender @ TalkOverlay.js?e4d40:61
render @ View.js?d4b09:244
_postInitialize @ View.js?d4b09:203
initialize @ View.js?d4b09:184
View @ View.js?d4b09:88
Overlay @ Overlay.js?64e89:21
TalkOverlayBase @ TalkOverlayBase.js?f3a41:19
TalkOverlay @ TalkOverlay.js?e4d40:16
(anonymous) @ init.js?0ab03:56
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
mightThrow @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3642
process @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3651
setTimeout (async)
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3689
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3455
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
deferred.(anonymous function) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3778
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:12912
handlePending @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:11945
markModuleReady @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:12186
nestedAddScript @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:12193
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:12198
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
deferred.(anonymous function) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3778
(anonymous) @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:12123
fire @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3317
fireWith @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:3447
done @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9272
callback @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:9639
dispatch @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:5206
elemData.handle @ load.php?debug=true&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=09gt2zl:5014

Page::postRender binds an event to window.load which will never run. It was introduced to fix T91882 however removing the code doesn't seem to cause any problems as T141452 fixed this problem in a more generic fashion in resources/mobile.toggle/toggle.js

Upgrade instructions here: https://github.com/jquery/jquery-migrate/blob/master/warnings.md#jqmigrate-jquerywindowonload-called-after-load-event-occurred

Acceptance criteria

  • Remove the postRender method

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 26 2018, 11:51 PM
Jdlrobson updated the task description. (Show Details)Feb 27 2018, 9:44 PM

Change 415163 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Do not unnecessarily bind Page to window load event

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

Change 415163 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Do not unnecessarily bind Page to window load event

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

Jdlrobson closed this task as Resolved.Feb 27 2018, 10:50 PM
Jdlrobson claimed this task.