Generating a Browser Coverage List
While the MongoDB frontend stack is increasingly making use of new and nonstandard Web platform features (such as ES6 modules and candidate ES7 language features), a significant chunk of our users are not using evergreen browsers that are required for these features.
For this reason, we compile our JavaScript and CSS into a form that these older browsers support. However, we want to take a data-driven approach to choosing which older browsers to support using browserslist-ga.
Prerequisites
Ensure that you have a current version of Node.js,
and run the following to install browserslist-ga
and browserslist
:
npm install -g browserslist-ga browserslist
Generate a Stats File
Run the following to generate a browserslist statistics file:
browserslist-ga
This will open a Google authentication workflow in your default browser. Sign in, and return to your terminal to provide the following answers:
Please select an account: |
|
Please select a property: |
|
Please select a profile: |
|
Specify a start date: | Default is 90 days prior |
Specify an end date: | Default is today |
After a moment, browserslist-ga
should return and write a file called
browserslist-stats.json
that you will provide to browserslist
.
Generate a Browser Coverage List
In the same directory, run the following to return a list of browsers that provide 99.5% coverage of docs visitors:
browserslist --stats=browserslist-stats.json 'cover 99.5% in my stats'