T429706: Raise Grade A JavaScript requirement from ES2019 to ES2020 (ECMAScript 11) | [None yet]
What
This task is for raising the Grade A requirement for the Modern JS layer from ES2020 to the next milestone ES2021 (ECMAScript 11).
Why
This will allow MediaWiki JavaScript code to use the following syntax, internal functions, and other features, improving the developer experience:
- ES2021
- ||= Logical OR assignment
- &&= Logical AND assignment
- ??= Nullish coalescing assignment
- any others?
Blockers
- Peast validator: already supports any ES version up to ES2024
- JavaScriptMinifier support for ES2021 syntax: T425099: Add native support for ES2021 to the minifier
- Figure out what browsers we would drop out of Grade A because of this
- Browser market share for older browser versions is low enough. Sign-off from MediaWiki Core Platform Team. Maybe @Krinkle or @JTweed-WMF
Todo
Once unblocked: (see old ticket T395347 for patch examples)
- browserslist-config-wikimedia: Update modern.json reflect any decided change to the Compatibility policy (skip if Grade A was unchanged)
- eslint-config-wikimedia:
- Update "client" preset to allow ES2021
- Publish release to npm
- Update mediawiki/core to use the latest eslint-config-wikimedia
- Notify LibUp which will automatically upgrade other repos.
- ResourceLoader:
- Update startup.js to raise feature tests requirement to ES2021
- Update Peast calls in Module::validateScriptFile(), maintenance/benchmarks/benchmarkJsValidate.php, and bump USERJSPARSE_CACHE_VERSION
- CodeMirror: update JavaScriptValidator to allow ES2021
- Documentation:
- Update https://www.mediawiki.org/wiki/Compatibility
- Draft an entry for Tech News