Skip to content

Commit

Permalink
Exclude polyfill for WHATWG URL constructor undefined base issue
Browse files Browse the repository at this point in the history
Although this polyfill is required for bug-free `new URL('http://x', undefined)` in Safari versions < 14 with an `undefined` base, we don’t use it:

```
The corejs3 polyfill added the following polyfills:
  web.url { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
  web.url-search-params { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1", "samsung":"8.2" }
```
  • Loading branch information
colinrotherham committed Jan 8, 2024
1 parent f457c49 commit 7280cf1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/govuk-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ module.exports = function (api) {
exclude: [
// ES2022 Error cause is unused
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
'es.error.cause'
'es.error.cause',

// WHATWG URL constructor `undefined` base fix is unnecessary
// https://bugs.webkit.org/show_bug.cgi?id=216841
// https://github.com/zloirock/core-js/commit/0ef4be7352e900dfa6f1eda27de22f7974576531
'web.url',
'web.url-search-params'
],

// Replace unsupported code with polyfills
Expand Down

0 comments on commit 7280cf1

Please sign in to comment.