Scripts: Upgrade babel-polyfill (or use core-js or alternative directly) #22417
Labels
Framework
Issues related to broader framework topics, especially as it relates to javascript
[Type] Enhancement
A suggestion for improvement.
Related: #21492 (comment)
As noted at #21492 (comment) , the version of
wp-polyfill
shipped in WordPress today is associated with@babel/polyfill@7.4.4
. The latest version of@babel/polyfill
is7.8.7
. It's assumed this would use a newer version ofcore-js
and thus, polyfills for more new language features in use today in Gutenberg.A few cases have occurred where a desire or attempt is made to use new language features which are newer than are shipped in polyfills:
Array#flat
(Cover: Add Padding Styles #21492 (comment))Object.fromEntries
(Add Block Pattern Categories support #22164 (comment))This may become an increasingly common scenario, as the availability and usage of newer language features starts to increase.
Implementation Notes:
Note that
@babel/polyfill
is officially deprecated. This doesn't necessarily mean we couldn't still choose to upgrade from 7.4.4 to 7.8.7 (the latest and probably last version).Alternatively, at its core,
@babel/polyfill
is essentially a small wrapper aroundcore-js
(source). We could choose to usecore-js
directly.Since this is a script handle shipped already with Core, it would inevitably need an upstream patch. It could be done sooner in Gutenberg following the pattern such as in #14400 / Trac#48121.
The text was updated successfully, but these errors were encountered: