From 6e232afff2c61148f4be41f20e17afbe2ffac345 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Mon, 26 Jun 2023 16:50:49 +0100 Subject: [PATCH] Add Browserslist `javascripts` environment for JavaScripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re using Safari 11 as a minimum so that checks for `nomodule` will also pass ``` 'noModule' in HTMLScriptElement.prototype ``` Using the query `> 0.1% in GB` unintentionally brings in Safari on iOS 8.1-8.4, 9.3 with only Safari 9+ supporting ES2015 modules, and Safari 11+ supporting `nomodule` --- docs/examples/webpack/.browserslistrc | 10 ++++++++++ docs/examples/webpack/babel.config.js | 2 +- packages/govuk-frontend-review/.browserslistrc | 10 ++++++++++ packages/govuk-frontend/.browserslistrc | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/examples/webpack/.browserslistrc b/docs/examples/webpack/.browserslistrc index ad5567eec6..25de95fef0 100644 --- a/docs/examples/webpack/.browserslistrc +++ b/docs/examples/webpack/.browserslistrc @@ -7,6 +7,16 @@ Firefox ESR Safari >= 12 iOS >= 12.1 +[javascripts] +> 0.1% in GB and supports es6-module +last 6 Chrome versions +last 6 Firefox versions +last 6 Edge versions +last 2 Samsung versions +Firefox ESR +Safari >= 12 and not Safari < 11 +iOS >= 12.1 and not iOS < 11 + [stylesheets] > 0.1% in GB and not dead last 6 Chrome versions diff --git a/docs/examples/webpack/babel.config.js b/docs/examples/webpack/babel.config.js index 621756485a..37705adb24 100644 --- a/docs/examples/webpack/babel.config.js +++ b/docs/examples/webpack/babel.config.js @@ -5,7 +5,7 @@ */ module.exports = function (api) { const browserslistEnv = !api.env('test') - ? 'production' + ? 'javascripts' : 'node' return { diff --git a/packages/govuk-frontend-review/.browserslistrc b/packages/govuk-frontend-review/.browserslistrc index ad5567eec6..25de95fef0 100644 --- a/packages/govuk-frontend-review/.browserslistrc +++ b/packages/govuk-frontend-review/.browserslistrc @@ -7,6 +7,16 @@ Firefox ESR Safari >= 12 iOS >= 12.1 +[javascripts] +> 0.1% in GB and supports es6-module +last 6 Chrome versions +last 6 Firefox versions +last 6 Edge versions +last 2 Samsung versions +Firefox ESR +Safari >= 12 and not Safari < 11 +iOS >= 12.1 and not iOS < 11 + [stylesheets] > 0.1% in GB and not dead last 6 Chrome versions diff --git a/packages/govuk-frontend/.browserslistrc b/packages/govuk-frontend/.browserslistrc index ae4358274f..9806cf15c2 100644 --- a/packages/govuk-frontend/.browserslistrc +++ b/packages/govuk-frontend/.browserslistrc @@ -10,6 +10,16 @@ Firefox ESR Safari >= 12 iOS >= 12.1 +[javascripts] +> 0.1% in GB and supports es6-module +last 6 Chrome versions +last 6 Firefox versions +last 6 Edge versions +last 2 Samsung versions +Firefox ESR +Safari >= 12 and not Safari < 11 +iOS >= 12.1 and not iOS < 11 + [stylesheets] > 0.1% in GB and not dead last 6 Chrome versions