Page MenuHomePhabricator

Raise Grade A JavaScript requirement from ES2020 to ES2021 (ECMAScript 12)
Open, Needs TriagePublic

Description

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
Todo

Once unblocked: (see old ticket T395347 for patch examples)

  1. browserslist-config-wikimedia: Update modern.json reflect any decided change to the Compatibility policy (skip if Grade A was unchanged)
  2. 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.
  3. 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
  4. CodeMirror: update JavaScriptValidator to allow ES2021
  5. Documentation: