Script Loader: stop enqueueing some now obsolete polyfills.

Stop enqueueing polyfills such as `wp-polyfill-inert` (for the `inert` attribute) and `regenerator-runtime` (for generator functions), as they are no longer needed, considering the WordPress project's [https://make.wordpress.org/core/handbook/best-practices/browser-support/ browser support policy].

In addition to that, `wp-polyfill` (essentially `core-js`) is no longer enqueued as a dependency of `react`. This was added in [43903] to ensure compatibility with IE 11, which is no longer supported by WordPress. Developers requiring `wp-polyfill` need to manually add it as a dependency for their scripts.

Props swissspidy, flixos90, adamsilverstein, youknowriad, gziolo.
Fixes #60962.
Built from https://develop.svn.wordpress.org/trunk@57981


git-svn-id: http://core.svn.wordpress.org/trunk@57467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2024-04-10 14:42:17 +00:00
parent a04dc48ea7
commit a6b9c3d542
2 changed files with 4 additions and 4 deletions

View File

@ -89,8 +89,8 @@ function wp_default_packages_vendor( $scripts ) {
$suffix = wp_scripts_get_suffix();
$vendor_scripts = array(
'react' => array( 'wp-polyfill' ),
'react-dom' => array( 'react' ),
'react',
'react-dom' => array( 'react' ),
'regenerator-runtime',
'moment',
'lodash',
@ -103,7 +103,7 @@ function wp_default_packages_vendor( $scripts ) {
'wp-polyfill-element-closest',
'wp-polyfill-object-fit',
'wp-polyfill-inert',
'wp-polyfill' => array( 'wp-polyfill-inert', 'regenerator-runtime' ),
'wp-polyfill',
);
$vendor_scripts_versions = array(

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-57949';
$wp_version = '6.6-alpha-57981';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.