Page MenuHomePhabricator

Add body class to distinguish between ES6 and ES5 browsers
Closed, DeclinedPublicFeature

Description

There hare several instances now (Abstract Wikipedia, Nearby), of ES6 modules being added to the page via OutputPage::addHTML.

Consider the following:
A page with:

<div id="app"><div class="browser-error">This page cannot be loaded on your browser</div></div>

and CSS:

.client-js .error { display: none; }

and ES6 module

function init() {
/* enhances #app with Vue App */
}
init( document.getElementById('app') );

On a basic support browser (no JavaScript) the error shows
However, on an ES5 browser, we get a blank screen as the ES6 module does not load and client-js exists.

Proposal

A new class client-es6 is added, allowing the .client-js .error { display: none; } rule to be rewritten to .client-es6 .error { display: none; }

Without this, the current pattern is to create an es5 module and load the es6 module
mw.loader.using('module.es6').then(null, function () { document.documentElement.classList.add( 'client-es5' ); }
While this works, it adds an additional ResourceLoader module for every ES6 initialization module.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This would be redundant if we do T178356: Raise Grade A JavaScript requirement from ES5 (2009) to ES6 (2015), but I guess we'd want to check in with the various product stakeholders where we stand today. I imagine the most impacted there would be editing, since most other features degrade to almost an identical Basic-level experience.

@Esanders @ppelberg How far along the IE11 transition are we from your point of view? Are you already effectively not supporting it in VisualEditor, or neutrally supporting it as part of the platform, or would you actively prefer we push back T178356 for e.g. one more year?

https://www.mediawiki.org/wiki/Compatibility#Special_treatment_for_IE11
https://www.mediawiki.org/wiki/Compatibility/IE11

We haven't done anything to drop support for IE11. As far as we know VE still works in it, although we don't regularly test.