Page MenuHomePhabricator

Popups triggers "deprecated ResourceLoader module jquery.hidpi" on several pages
Closed, ResolvedPublic2 Estimated Story Points

Description

When opening a page with or without an account, I see message in the browser-console:

This page is using the deprecated ResourceLoader module "jquery.hidpi".
Use of the srcset polyfill is deprecated since MediaWiki 1.32.0

Browser Console in (german localized) Firefox: Extras --> Webentwickler --> Browser-Konsole (in english maybe Extra --> Web Development --> Browser Console)

Developer notes

"jquery.hidpi" was introduced to Popups in https://gerrit.wikimedia.org/r/208515
It was deprecated in T127328 by https://gerrit.wikimedia.org/r/441614
Popups uses jquery.hidpi bracketedDevicePixelRatio provided by jquery.hidpi

We should use https://caniuse.com/#search=window.devicePixelRatio instead.

QA notes

Quick test: Check that images inside page previews are still rendering as expected on https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:AllPages&from=Asian+badger

Test on a retina device - images should be higher resolution.
(note if no retina device you can test this in Firefox by using about:config and setting layout.css.devPixelsPerPx to 2)

Event Timeline

Wurgl created this task.Jul 1 2018, 10:59 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 1 2018, 10:59 PM

See T196802 regarding the first error message ("mediawiki.api.options").

Aklapper changed the task status from Open to Stalled.Jul 2 2018, 2:21 PM

@Wurgl: For the second warning, please provide the path to the source code file in which this warning is triggered.
https://www.mediawiki.org/wiki/Help:Locating_broken_scripts explains how to use debug=true for this. Thanks!

Removing project tag as this is not about any extensions in general.

Wurgl added a comment.Jul 2 2018, 3:01 PM

Just an example: https://de.wikipedia.org/wiki/Internet_Movie_Database or en-wp: https://en.wikipedia.org/wiki/Robert_W._Chambers

Both pages: not logged in, so no user-scripts are active.

In a private browser window, going to https://de.wikipedia.org/wiki/Internet_Movie_Database?debug=true in both Firefox 61 and Chromium 67 I do not see any such output in the console of the developer tools. Cannot reproduce.

Please see and follow T198579#4384825 to provide more information.

Oh, I am sorry! I can reproduce and this only happens when not using debug=true. How weird...

Aklapper renamed this task from This page is using the deprecated ResourceLoader module "mediawiki.api.options". to Error: "Unknown dependency: mediawiki.hidpi" on several pages.Jul 2 2018, 11:25 PM
Aklapper changed the task status from Stalled to Open.
Restricted Application added a project: Performance-Team. · View Herald TranscriptJul 2 2018, 11:25 PM

I also get Error: "Unknown dependency: mediawiki.hidpi" in a private Firefox 61 window on https://de.wikipedia.org/wiki/Internet_Movie_Database :

Error: "Unknown dependency: mediawiki.hidpi"
sortDependencies  https://de.wikipedia.org/w/load.php?debug=false&lang=de&modules=jquery%2Cmediawiki%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=06sarth:157:614
resolveStubbornly https://de.wikipedia.org/w/load.php?debug=false&lang=de&modules=jquery%2Cmediawiki%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=06sarth:158:517
load              https://de.wikipedia.org/w/load.php?debug=false&lang=de&modules=jquery%2Cmediawiki%7Cmediawiki.base%7Cmediawiki.legacy.wikibits&only=scripts&skin=vector&version=06sarth:169:484
<anonymous>       https://de.wikipedia.org/wiki/Internet_Movie_Database:9:4
startUp           https://de.wikipedia.org/w/load.php?debug=false&lang=de&modules=startup&only=scripts&skin=vector:83:843
onload             https://de.wikipedia.org/w/load.php?debug=false&lang=de&modules=startup&only=scripts&skin=vector:84:256

jquery.hidpi is called in e.g. https://en.wikipedia.org/w/load.php?debug=true&lang=en&modules=startup&only=scripts&skin=vector

@Wurgl: I cannot reproduce this anymore. Can you?

Wurgl added a comment.Jul 15 2018, 9:01 PM

On my local machine here at home I have installed a version from december 2017, when I grep in the source-hell I find …

$ grep -r jquery.hidpi wiki
wiki/resources/Resources.php: 'jquery.hidpi' => [
wiki/resources/Resources.php: 'scripts' => 'resources/src/jquery/jquery.hidpi.js',
wiki/resources/Resources.php: 'dependencies' => 'jquery.hidpi',
wiki/includes/DefaultSettings.php: * The polyfill can be found in the jquery.hidpi module.
wiki/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js: QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() );
wiki/tests/qunit/QUnitTestResources.php: 'tests/qunit/suites/resources/jquery/jquery.hidpi.test.js',
wiki/tests/qunit/QUnitTestResources.php: 'jquery.hidpi',
wiki/jsduck.json: "resources/src/jquery/jquery.hidpi.js",

@Wurgl: I cannot reproduce this anymore. Can you?

@Aklapper: Sadly, I can! Both, with en.wikipedia.org and de.wikipedia.org
JQMIGRATE: Migrate is installed with logging active, version 3.0.1 load.php:139:615
This page is using the deprecated ResourceLoader module "mediawiki.api.options".
Use "mediawiki.api" instead. load.php:288:706
This page is using the deprecated ResourceLoader module "jquery.hidpi".
Use of the srcset polyfill is deprecated since MediaWiki 1.32.0 load.php:42:965

Note: Browser-Konsole, not Web-Konsole (sorry, german localization)

Hmm, did you explicitly bypass your browser cache on de.wp / en.wp?
(I'm confused why I cannot reproduce it anymore on de.wp and en.wp while I could easily two weeks ago.)

Yes! I have even started some virtual machine which I did not use for month and there the errors show up too, I tried en.wikipedia.org and fr.wikipedia.org (for sure I never visitied fr.wikipedia.org, since I do not understand that language).

Do you have some Linux?

Here the simplest browser ever, Compile it with
g++ -fPIC -I /usr/include/qt5 test.cpp -lQt5WebEngineWidgets -lQt5Widgets -lQt5Core

----8<----
#include <QtWebEngineWidgets/qwebengineview.h>
#include "QtWidgets/qapplication.h"

int main(int argc, char **argv) {

QApplication app(argc, argv);
QWebEngineView w;
w.show();
w.load(QUrl("https://en.wikipedia.org"));
app.exec();
return 0;

}
----8<----

and start it from the command line, you see the same errors (It compiles on Windows too, but I am not sure where the errors can be seen there)
----8<----
js: This page is using the deprecated ResourceLoader module "mediawiki.api.options".
Use "mediawiki.api" instead.
js: This page is using the deprecated ResourceLoader module "jquery.hidpi".
Use of the srcset polyfill is deprecated since MediaWiki 1.32.0
----8<----

and this minimalst code snipplet uses just a memory cache.

https://de.wikipedia.org/wiki/Internet_Movie_Database

This page is using the deprecated ResourceLoader module "jquery.hidpi".
Use of the srcset polyfill is deprecated since MediaWiki 1.32.0

Using findAll.js:

findAll('hidpi')
(3) [Array(1), Array(1), Array(1)]
↳ ["jquery.hidpi"]
   ↳ ["ext.popups.main"]
      ↳ ["ext.popups"]
Krinkle renamed this task from Error: "Unknown dependency: mediawiki.hidpi" on several pages to Popups triggers "deprecated ResourceLoader module jquery.hidpi" on several pages.Jul 16 2018, 9:14 PM
Jdlrobson updated the task description. (Show Details)Jul 24 2018, 10:53 AM
Jdlrobson triaged this task as Medium priority.Jul 24 2018, 1:46 PM
Jdlrobson moved this task from Triaged but Future to Upcoming on the Readers-Web-Backlog board.
Jdlrobson moved this task from Backlog to Next Up on the Page-Previews board.Jul 25 2018, 8:37 AM
pmiazga set the point value for this task to 2.Aug 1 2018, 4:31 PM
pmiazga added a subscriber: pmiazga.

We estimated this task as 2 as we're not sure are there any differences between window.devicePixelRatio and $.bracketedDevicePixelRatio.

nray added subscribers: ovasileva, nray.

Discussed with @ovasileva that this would be a good on-boarding task for me so I'm moving this onto the board

nray claimed this task.Aug 3 2018, 4:46 PM
nray moved this task from To Do to Doing on the Readers-Web-Kanbanana-Board-Old board.

Change 450420 had a related patch set uploaded (by Nray; owner: Nray):
[mediawiki/extensions/Popups@master] Use window.devicePixelRatio instead of deprecated jQuery.hidpi

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

Jdlrobson updated the task description. (Show Details)Aug 10 2018, 5:56 PM

Change 450420 merged by jenkins-bot:
[mediawiki/extensions/Popups@master] Use window.devicePixelRatio instead of deprecated jQuery.hidpi

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

Jdlrobson reassigned this task from nray to Ryasmeen.Aug 10 2018, 6:50 PM
Jdlrobson added a project: Product-QA.
Jdlrobson added subscribers: alexhollender, Jdlrobson.

@alexhollender this has skipped design review as this is a purely programmatic change. Have added testing steps. Please use beta cluster!

ABorbaWMF added a subscriber: ABorbaWMF.

Looks good to me across a number of browsers/devices, including a retina display. Tested in beta.

Windows 10/Edge 14 - IE11

Mac 10.13/Safari 11 - Firefox - Opera

Retina

phuedx removed Ryasmeen as the assignee of this task.Aug 16 2018, 10:37 AM
phuedx added a subscriber: Ryasmeen.
Jdlrobson closed this task as Resolved.Aug 20 2018, 11:44 PM

I no longer see the notice on beta cluster.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptAug 20 2018, 11:44 PM