Skip to content

Commit

Permalink
build: drop support for legacy browsers (IE11, Safari 10)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop support for browsers that don't correctly
implement const/let and no longer transpile the browser build to ES2015.

Browser tests are run in the first supported version of each supported
browser and in the latest (as of this commit) version available on
Browserstack.
  • Loading branch information
ctavan committed Dec 2, 2021
1 parent aa11485 commit 43fc39c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For the creation of [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) UUIDs
- **Cross-platform** - Support for ...
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
- Node 10, 12, 14, 16
- Chrome, Safari, Firefox, Edge, IE 11 browsers
- Chrome, Safari, Firefox, Edge browsers
- Webpack and rollup.js module bundlers
- [React Native / Expo](#react-native--expo)
- **Secure** - Cryptographically-strong random values
Expand Down Expand Up @@ -417,6 +417,10 @@ Note: If you are using Expo, you must be using at least `react-native-get-random

[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).

### IE 11 (Internet Explorer)

Support for IE11 and other legacy browsers has been dropped as of `uuid@9`. If you need to support legacy browsers, you can always transpile the uuid module source yourself (e.g. using [Babel](https://babeljs.io/)).

## Upgrading From `uuid@7`

### Only Named Exports Supported When Using with Node.js ESM
Expand Down
6 changes: 5 additions & 1 deletion README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For the creation of [RFC4122](https://www.ietf.org/rfc/rfc4122.txt) UUIDs
- **Cross-platform** - Support for ...
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
- Node 10, 12, 14, 16
- Chrome, Safari, Firefox, Edge, IE 11 browsers
- Chrome, Safari, Firefox, Edge browsers
- Webpack and rollup.js module bundlers
- [React Native / Expo](#react-native--expo)
- **Secure** - Cryptographically-strong random values
Expand Down Expand Up @@ -426,6 +426,10 @@ Note: If you are using Expo, you must be using at least `react-native-get-random

[In Edge <= 18, Web Crypto is not supported in Web Workers or Service Workers](https://caniuse.com/#feat=cryptography) and we are not aware of a polyfill (let us know if you find one, please).

### IE 11 (Internet Explorer)

Support for IE11 and other legacy browsers has been dropped as of `uuid@9`. If you need to support legacy browsers, you can always transpile the uuid module source yourself (e.g. using [Babel](https://babeljs.io/)).

## Upgrading From `uuid@7`

### Only Named Exports Supported When Using with Node.js ESM
Expand Down
15 changes: 14 additions & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@
"presets": [["@babel/preset-env", { "targets": { "node": "10" }, "modules": "commonjs" }]]
},
"esmBrowser": {
"presets": [["@babel/preset-env", { "modules": false }]]
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": "49",
"edge": "14",
"firefox": "51",
"safari": "11"
},
"modules": false
}
]
]
},
"esmNode": {
"presets": [["@babel/preset-env", { "targets": { "node": "10" }, "modules": false }]]
Expand Down
34 changes: 15 additions & 19 deletions wdio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,11 @@ const capabilities = [
'bstack:options': {
...commonCapabilities,
os: 'Windows',
osVersion: '10',
osVersion: '11',
},
browserName: 'Chrome',
browserVersion: '92.0',
},
{
'bstack:options': {
...commonCapabilities,
os: 'Windows',
osVersion: '10',
},
browserName: 'Chrome',
browserVersion: '81.0',
},
// Chrome 49 released on 2016-03-02 was the last version supported on Windows XP, Windows Vista, Mac OS X 10.6, 10.7, and 10.8
{
'bstack:options': {
Expand All @@ -66,35 +57,39 @@ const capabilities = [
},

// Firefox
// Latest
{
'bstack:options': {
...commonCapabilities,
os: 'Windows',
osVersion: '10',
osVersion: '11',
},
browserName: 'Firefox',
browserVersion: '75.0',
browserVersion: '94.0',
},
// Firefox 51 was the first Firefox to correctly support const/let
{
'bstack:options': {
...commonCapabilities,
os: 'Windows',
osVersion: '10',
},
browserName: 'Firefox',
browserVersion: '44.0',
browserVersion: '51.0',
},

// Edge
{
'bstack:options': {
...commonCapabilities,
os: 'Windows',
osVersion: '10',
osVersion: '11',
},
browserName: 'Edge',
browserVersion: '81.0',
browserVersion: '96.0',
},
// While Edge 12 already supported const/let, Edge 15 is the earliest Edge available on
// Browserstack
{
'bstack:options': {
...commonCapabilities,
Expand All @@ -110,19 +105,20 @@ const capabilities = [
'bstack:options': {
...commonCapabilities,
os: 'OS X',
osVersion: 'Catalina',
osVersion: 'Monterey',
},
browserName: 'Safari',
browserVersion: '13.0',
browserVersion: '15.0',
},
// Safari 11 was the first Safari to correctly support const/let
{
'bstack:options': {
...commonCapabilities,
os: 'OS X',
osVersion: 'Sierra',
osVersion: 'High Sierra',
},
browserName: 'Safari',
browserVersion: '10.0',
browserVersion: '11.0',
},
];

Expand Down

0 comments on commit 43fc39c

Please sign in to comment.