T178356: Raise Grade A JavaScript requirement from ES5 (2009) to ES6 (2015) | T395347: Raise Grade A JavaScript requirement from ES2017 to ES2018
Motivation
This ticket is to raise the Grade A requirement for the Modern JS layer, from ES2016 (aka "ES7") to the next milestone ES2017 ("ES8").
The primary motivation is native use of async-await syntax, as introduced in ES2017.
See also Promises and Async functions in Exploring JavaScript by Axel Rauschmayer.
function createQuux() { return getFoo .then(function (foo) { // ··· return getBar(); }) .then(function (bar) { // ··· return barToBaz(bar); }) .then(function (baz) { // ··· return Quux.newFromBaz(baz) .catch(function (error) { // ··· return false; }); }) }
async function createQuux() { const foo = await getFoo(); const bar = await getBar(); const baz = barToBaz(bar); try { return await Quux.newFromBaz(baz); } catch (error) { return false; } }
JavaScript features:
- ES7 / ES2016
- ** (exponential operator, to the power of)
- Array.includes()
- ES8 / ES2017
- async / await
- Object.values()
- Object.entries()
- Object.getOwnPropertyDescriptors()
- String.padStart(), String.padEnd()
- shared memory and atomics
- trailing commas
Blockers
- Peast validator: already supports any ES version upto ES2024
- JavaScriptMinifier: support ES2016 and ES2017: T277675: Add native support for ES2016-ES2017 to the minifier
- Browser market share for older browser versions is low enough. We should get signoff from a WMF dev for this. Maybe @Krinkle?
Todo
Once unblocked:
- ResourceLoader:
- eslint-config-wikimedia:
- update "client" preset to allow ES2016 (ES7) (PR)
- update "client" preset to allow ES2017 (ES8) (PR)
- publish release to npm
- notify LibUp to upgrade this across repos automatically. https://gitlab.wikimedia.org/repos/ci-tools/libup-config/-/merge_requests/76
- Documentation:
- Draft an entry for Tech News https://meta.wikimedia.org/wiki/Tech/News/2025/23
- Update https://www.mediawiki.org/wiki/Compatibility#General_information (Diff)