Page MenuHomePhabricator

Raise Grade A JavaScript requirement from ES2019 to ES2020 (ECMAScript 11)
Open, Needs TriagePublic

Description

T419142: Raise Grade A JavaScript requirement from ES2017 to ES2019 (ECMAScript 10) | T434710: Raise Grade A JavaScript requirement from ES2020 to ES2021 (ECMAScript 12)

What

This task is for raising the Grade A requirement for the Modern JS layer from ES2019 to the next milestone ES2020 (ECMAScript 11).

Why

This will allow MediaWiki JavaScript code to use the following syntax, internal functions, and other features, improving the developer experience:

  • ES2020
    • String.prototype.matchAll()
    • 123n BigInt notation
    • Promise.allSettled()
    • ?? nullish operator
    • ?. optional chaining operator
    • extended import/export syntax (not applicable within MediaWiki)
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 ES2020
    • 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 ES2020
    • Update Peast calls in Module::validateScriptFile(), maintenance/benchmarks/benchmarkJsValidate.php, and bump USERJSPARSE_CACHE_VERSION
  4. CodeMirror: update JavaScriptValidator to allow ES2020
  5. Documentation:

Event Timeline

Minimum browser versions required for new features:

Overall: Chrome 80, Edge 80, Firefox 74, Opera 67, Safari 14, iOS 14

?? nullish operator: Chrome 80, Edge 80, Firefox 72, Opera 67, Safari 13.1, iOS 13.4
Note: Caniuse differs from MDN and incorrectly shows Chrome 85+. Confirmed using Browserstack that Chrome 80 supports this.

Caniuse shows data for nullish coalescing assignment (x ??= y), which I assume is due to a devUX consideration on their part. The assignment operator was introduced in ES2021: https://tc39.es/ecma262/2021/#sec-assignment-operators-static-semantics-early-errors (so next version)... So SD0001 is correct, but Caniuse is also kind of correct :)

Something to keep in mind in this part: CodeMirror: update JavaScriptValidator to allow ES2020, as ??= would have to be considered invalid syntax.

Note: Caniuse differs from MDN and incorrectly shows Chrome 85+. Confirmed using Browserstack that Chrome 80 supports this.

[…] Caniuse shows data for nullish coalescing assignment (x ??= y), which I assume is due to a devUX consideration on their part. […]

This is a link to the CanIUse entry for wf-nullish-coalescing which refers to group of features. This is not a decision by CanIUse. It is from the Baseline Web Features dataset, which is one of the two datasets that CanIUse includes in its results. It simply joins two MDN features together.

Screenshot 2026-08-06 at 15.53.46.png (1,331×1,438 px, 258 KB)

When you search for "nullish", there are several results and the second result is for ??:

Screenshot 2026-08-06 at 15.56.36.png (1,436×1,662 px, 311 KB)Screenshot 2026-08-06 at 15.53.58.png (1,562×916 px, 249 KB)

Now that the T434032 is closed as a "duplicate" of this active task, I can't help wondering how this active task will affect macOS Safari 13 and iOS Safari 15.

...I can't help wondering how this active task will affect macOS Safari 13 and iOS Safari 15.

According to CanIUse.com, ES2020 is fully supported in Safari 14.1+, so we'll probably drop Safari 12 and 13 when we next raise the JS requirement.

...I can't help wondering how this active task will affect macOS Safari 13 and iOS Safari 15.

According to CanIUse.com, ES2020 is fully supported in Safari 14.1+, so we'll probably drop Safari 12 and 13 when we next raise the JS requirement.

Any other tool besides CanIUse.com?

Also, may I please propose extending some further support for (macOS) Safari 13 on macOS 10.13 High Sierra, the final version for a unibody iMac 2009–11 and polycarbonate unibody macBook 2009–10? Indeed, I hate to drop Modern (Grade A) support for Safari 13 just because ES2020 is not supported on Safari 13

@Mr._Starfleet_Command Just in case, list of iMac and macBook models for you to look at.

Any other tool besides CanIUse.com?

For me, CanIUse.com is the easiest way to check cross-browser support for several features at once, particularly ES versions. MDN Web Docs is the other resource I use, although I'm sure there are other good ones out there.

Also, may I please propose extending some further support for (macOS) Safari 13 on macOS 10.13 High Sierra, the final version for a unibody iMac 2009–11 and polycarbonate unibody macBook 2009–10?

We only just raised the JS requirement to ES2019 within the last week, so the earliest we might fulfill this task is some time next year, so not an immediate worry.

Indeed, I hate to drop Modern (Grade A) support for Safari 13 just because ES2020 is not supported on Safari 13

The only practical impact is that Safari 13 won't receive the Modern layer anymore (JS enhancements). MediaWiki sites will still be accessible and usable for the most part. Is there a particular reason you think we need to continue to fully support Safari 13 for much longer?

The only practical impact is that Safari 13 won't receive the Modern layer anymore (JS enhancements). MediaWiki sites will still be accessible and usable for the most part. Is there a particular reason you think we need to continue to fully support Safari 13 for much longer?

For all I know, page views from macOS Safari 13 aren't that stellar. Indeed, the stats for that version been 0.009%, compared to stats from iOS Safari 13.

Also, macOS High Sierra has been the latest and final version for certain iMacs and macBooks.

Well, those still using macOS 10.12 Sierra, 10.13 High Sierra, or 10.14 Mojave may have to migrate to Firefox ESR 115, whose official support is supposed to end in March 2027. (Sources: Wikipedia, Mozilla)

I'm not asking for a lifetime or indefinite Modern support for macOS Safari 13. Rather perhaps give macOS Safari 13 either six more months, one more year, or.... some time until the devs are ready to give up Modern support for macOS Safari 13.

MacOS Safari 13 may still enjoy Basic support when its Modern one ends, but I dunno how prioritized issues about macOS Safari 13 have been lately. Perhaps give macOS users some time to shift from macOS Safari to Firefox ESR or to change from macOS 13 to a later macOS version. Or...

Well, those still using macOS 10.12 Sierra, 10.13 High Sierra, or 10.14 Mojave may have to migrate to Firefox ESR 115, whose official support is supposed to end in March 2027. (Sources: Wikipedia, Mozilla)

Safari 13 is also long past the end of its official support. If people are okay using that they should be okay using Firefox ESR 115. I didn't think this is a convincing argument to hold back the entire site for the sake of 0.009% of readers (most of whom are just reading and not using modern features).

...perhaps give macOS Safari 13 either six more months, [or] one more year...

Did you read my comment above, where I said, "the earliest we might fulfill this task is some time next year, so not an immediate worry"?

I ask again: Is there a particular reason you think we need to continue to fully support Safari 13 for much longer? (For example, do you perhaps use Safari 13? Or is there some other reason?)

Did you read my comment above, where I said, "the earliest we might fulfill this task is some time next year, so not an immediate worry"?

I acknowledge the comment that I read. Perhaps I should've replied that earlier.

I ask again: Is there a particular reason you think we need to continue to fully support Safari 13 for much longer? (For example, do you perhaps use Safari 13? Or is there some other reason?)

I guess I'll find public mac computers using macOS High Sierra before answering any further then

I'm sorry, I still don't quite understand. Probably my fault :)