Skip to content

Commit

Permalink
Exclude polyfills for DOM collection iteration
Browse files Browse the repository at this point in the history
Although these polyfills are required to iterate DOM collections, we always use `Array.from()` so don’t need them:

```
The corejs3 polyfill added the following polyfills:
  es.array.iterator { "chrome":"61", "opera":"48", "samsung":"8.2" }
  web.dom-collections.iterator { "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 7280cf1 commit 0d5dc7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/govuk-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ module.exports = function (api) {
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
'es.error.cause',

// DOM collection iteration is unnecessary with `Array.from()`
// see https://github.com/zloirock/core-js/issues/1003
'web.dom-collections.iterator',

// 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
Expand Down

0 comments on commit 0d5dc7d

Please sign in to comment.