File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/babel-preset-default Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,25 @@ module.exports = [
77 // This is an IE-only feature which we don't use, and don't want to polyfill.
88 // @see https://github.com/WordPress/gutenberg/pull/49234
99 'web.immediate' ,
10+ // Remove Set feature polyfills.
11+ //
12+ // The Babel/core-js integration has a severe limitation, in that any Set
13+ // objects (e.g. `new Set()`) are assumed to need all instance methods, and
14+ // get them all polyfilled. There is no validation as to whether those
15+ // methods are actually in use.
16+ //
17+ // This limitation causes a number of packages to unnecessarily get a
18+ // dependency on `wp-polyfill`, which in most cases gets loaded as part of
19+ // the critical path and can thus have an impact on performance.
20+ //
21+ // There is no good solution to this, and the one we've opted for here is
22+ // to disable polyfilling these features entirely. Developers will need to
23+ // take care not to use them in scenarios where the code may be running in
24+ // older browsers without native support for them.
25+ //
26+ // These need to be specified as both `es.` and `esnext.` due to the way
27+ // internal dependencies are set up in Babel / core-js.
28+ //
29+ // @see https://github.com/WordPress/gutenberg/pull/67230
30+ / ^ e s ( n e x t ) ? \. s e t \. / ,
1031] ;
You can’t perform that action at this time.
0 commit comments