Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyfills: exclude web.immediate #49234

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/babel-preset-default/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Enhancement

- Exclude IE-only `setImmediate`/`clearImmediate` from list of polyfills.
sgomes marked this conversation as resolved.
Show resolved Hide resolved

## 7.13.0 (2023-03-15)

## 7.12.0 (2023-03-01)
Expand Down
15 changes: 10 additions & 5 deletions packages/babel-preset-default/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ const { writeFile } = require( 'fs' ).promises;

builder( {
modules: [ 'es', 'web' ],
// core-js is extremely conservative in which polyfills to include.
// Knowing about tiny browser implementation bugs that anyone rarely cares about,
// we prevent some features from having the full polyfill included.
// @see https://github.com/WordPress/gutenberg/pull/31279
exclude: [ 'es.promise' ],
exclude: [
// core-js is extremely conservative in which polyfills to include.
// Since we don't care about the tiny browser implementation bugs behind its decision
// to polyfill these features, we forcefully prevent them from being included.
// @see https://github.com/WordPress/gutenberg/pull/31279
'es.promise',
// This is an IE-only feature which we don't use, and don't want to polyfill.
sgomes marked this conversation as resolved.
Show resolved Hide resolved
// @see https://github.com/WordPress/gutenberg/pull/49234
'web.immediate',
],
targets: require( '@wordpress/browserslist-config' ),
filename: './build/polyfill.js',
} )
Expand Down