[wp-trac] [WordPress Trac] #52941: Remove `@babel/polyfill` in favor of `core-js/stable`.

WordPress Trac noreply at wordpress.org
Fri Jun 18 06:41:17 UTC 2021


#52941: Remove `@babel/polyfill` in favor of `core-js/stable`.
------------------------------+-----------------------
 Reporter:  desrosj           |       Owner:  desrosj
     Type:  task (blessed)    |      Status:  reopened
 Priority:  normal            |   Milestone:  5.8
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+-----------------------

Comment (by gziolo):

 I'm on board with the proposed approach. We had too many reports where the
 expectation is that `wp-polyfill` used by popular plugins that offer
 blocks crash with the changes introduced. The alternative approach we see
 in the new patch should make the transition seamless.

 The follow-up task would be to update`@wordpress/dependency-extraction-
 webpack-plugin` to allow setting `wp-polyfill-build` as the name for the
 injected polyfill and used that in WordPress core.

 One more thing that we should consider would be ensuring that when `wp-
 polyfill` and `wp-polyfill-build` are enqueued, only `wp-polyfill` gets
 sent to the user because in practice ``wp-polyfill-build` is a subset of
 the former.

 > A few notes. I haven't been able to figure out the reason for adding
 `wp-polyfill` as a dependency of itself. It's not clear to me if this
 should remain as is, changed to the new script handle, or both.

 It looks like this is an old change introduced while renaming the script
 handle from `wp-polyfill-ecmascript` to `wp-polyfill` in wp-polyfill-
 ecmascript. I would assume we can safely remove the line.

 > Also, the version for the new script should probably change to reflect
 the version of the @wordpress/babel-preset-default package. Right now it
 reflects the version of @babel/polyfill.

 Yes, I missed that one previously.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52941#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list