Depend es5-shim to make popups behave on ES3 browsers
Closed, ResolvedPublic

Description

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 27 2017, 5:28 PM

@Jdlrobson Do you know if we can use ES5 in desktop? Should we change Object.keys to a for in to collect the keys?

Jhernandez renamed this task from Popups uses ES5 Object.keys to [Spike] Popups uses EcmaScript5 Object.keys construct.Mar 2 2017, 3:30 PM

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)

About ECMAScript < 5 browsers see T128115

@Jdlrobson Do you know if we can use ES5 in desktop? Should we change Object.keys to a for in to collect the keys?

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.

Krinkle added a subscriber: Krinkle.Mar 3 2017, 2:08 AM

@Jdlrobson Do you know if we can use ES5 in desktop? [..]

Neither desktop nor mobile currently, we're still in ES3-parsing UA support for at least a little while. [..]

[..] Should we change Object.keys to a for in to collect the keys?

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

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

Jhernandez renamed this task from [Spike] Popups uses EcmaScript5 Object.keys construct to Depend es5-shim to make popups behave on ES3 browsers.Mar 3 2017, 10:57 AM
Jhernandez updated the task description. (Show Details)

Change 340949 merged by jenkins-bot:
[mediawiki/extensions/Popups] Specify es5-shim as a dependency

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