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.