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

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.

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.

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?

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 triaged this task as Medium priority.Jul 24 2018, 1:46 PM
Jdlrobson moved this task from Triaged but Future to Upcoming on the Web-Team-Backlog board.
pmiazga set the point value for this task to 2.Aug 1 2018, 4:31 PM
pmiazga subscribed.

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

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

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 added a project: Product-QA.

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

ABorbaWMF subscribed.

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

Windows 10/Edge 14 - IE11

image.png (768×1 px, 280 KB)
image.png (768×1 px, 287 KB)

Mac 10.13/Safari 11 - Firefox - Opera

image.png (768×1 px, 428 KB)
image.png (768×1 px, 382 KB)
image.png (768×1 px, 416 KB)

Retina

Screen Shot 2018-08-15 at 1.14.10 PM.png (902×766 px, 782 KB)
Screen Shot 2018-08-15 at 1.20.12 PM.png (900×982 px, 602 KB)
phuedx added a subscriber: Ryasmeen.

I no longer see the notice on beta cluster.