Popups uses ES5 constructs: https://github.com/wikimedia/mediawiki-extensions-Popups/blob/master/src/processLinks.js#L32 and the redux library.
In order to behave in ES3 browsers until deprecated, we need to specify a dependency on es5-shim
Popups uses ES5 constructs: https://github.com/wikimedia/mediawiki-extensions-Popups/blob/master/src/processLinks.js#L32 and the redux library.
In order to behave in ES3 browsers until deprecated, we need to specify a dependency on es5-shim
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/extensions/Popups | master | +1 -0 | Specify es5-shim as a dependency |
@Jdlrobson Do you know if we can use ES5 in desktop? Should we change Object.keys to a for in to collect the keys?
I see in https://www.mediawiki.org/wiki/Compatibility#cite_note-1 that from 1.27 IE8 doesn't get JS. Does that mean we can target basic ES5 in desktop? (.forEach, .map, etc)
Neither desktop nor mobile currently, we're still in ES3-parsing UA support for at least a little while. In T128115 as @Ricordisamoa says we're looking at upgrading that requirement, but it's certainly not going to happen in the next month or two.
No, I'd recommend keeping it and just adding a dependency on the es5-shim module in the extension registration. This module has a special skip-function to make sure we don't download anything extra on modern browsers. On older browsers, it'll ensure this extra module is loaded to polyfill the missing ES5 methods.
Change 340949 had a related patch set uploaded (by jhernandez):
[mediawiki/extensions/Popups] Specify es5-shim as a dependency
Change 340949 merged by jenkins-bot:
[mediawiki/extensions/Popups] Specify es5-shim as a dependency