diff --git a/package.json b/package.json
index 933aa4cb82..1e85090124 100644
--- a/package.json
+++ b/package.json
@@ -147,6 +147,7 @@
"polyfill-library": "3.105.0",
"react": "16.13.1",
"react-dom": "16.13.1",
+ "regenerator-runtime": "0.13.7",
"twemoji": "13.1.0",
"underscore": "1.13.1",
"whatwg-fetch": "3.0.0"
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index c7a6963f73..b2abe86f26 100644
--- a/src/wp-includes/script-loader.php
+++ b/src/wp-includes/script-loader.php
@@ -80,8 +80,9 @@ function wp_default_packages_vendor( $scripts ) {
$suffix = wp_scripts_get_suffix();
$vendor_scripts = array(
- 'react' => array( 'wp-polyfill' ),
- 'react-dom' => array( 'react' ),
+ 'react' => array( 'wp-polyfill' ),
+ 'react-dom' => array( 'react' ),
+ 'regenerator-runtime',
'moment',
'lodash',
'wp-polyfill-fetch',
@@ -91,12 +92,13 @@ function wp_default_packages_vendor( $scripts ) {
'wp-polyfill-dom-rect',
'wp-polyfill-element-closest',
'wp-polyfill-object-fit',
- 'wp-polyfill',
+ 'wp-polyfill' => array( 'regenerator-runtime' ),
);
$vendor_scripts_versions = array(
'react' => '16.13.1',
'react-dom' => '16.13.1',
+ 'regenerator-runtime' => '0.13.7',
'moment' => '2.29.1',
'lodash' => '4.17.19',
'wp-polyfill-fetch' => '3.0.0',
@@ -106,7 +108,7 @@ function wp_default_packages_vendor( $scripts ) {
'wp-polyfill-dom-rect' => '3.104.0',
'wp-polyfill-element-closest' => '2.0.2',
'wp-polyfill-object-fit' => '2.3.5',
- 'wp-polyfill' => '7.4.4',
+ 'wp-polyfill' => '3.15.0',
);
foreach ( $vendor_scripts as $handle => $dependencies ) {
@@ -121,8 +123,6 @@ function wp_default_packages_vendor( $scripts ) {
$scripts->add( $handle, $path, $dependencies, $version, 1 );
}
- $scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) );
-
did_action( 'init' ) && $scripts->add_inline_script( 'lodash', 'window.lodash = _.noConflict();' );
did_action( 'init' ) && $scripts->add_inline_script(
diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
index 533704ed09..ddcf04a85f 100644
--- a/tests/phpunit/tests/dependencies/scripts.php
+++ b/tests/phpunit/tests/dependencies/scripts.php
@@ -723,7 +723,7 @@ JS;
$ver = get_bloginfo( 'version' );
$suffix = wp_scripts_get_suffix();
- $expected = "\n";
+ $expected = "\n";
$expected .= "\n";
$expected .= "\n";
$expected .= "\n";
diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js
index 4a9f308e3a..80840b8b90 100644
--- a/tools/webpack/packages.js
+++ b/tools/webpack/packages.js
@@ -84,6 +84,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil
'moment.js': 'moment/moment.js',
'react.js': 'react/umd/react.development.js',
'react-dom.js': 'react-dom/umd/react-dom.development.js',
+ 'regenerator-runtime.js': 'regenerator-runtime/runtime.js',
};
const minifiedVendors = {
@@ -98,6 +99,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil
};
const minifyVendors = {
+ 'regenerator-runtime.min.js': 'regenerator-runtime/runtime.js',
'wp-polyfill-fetch.min.js': 'whatwg-fetch/dist/fetch.umd.js',
'wp-polyfill-element-closest.min.js': 'element-closest/element-closest.js',
'wp-polyfill-node-contains.min.js': 'polyfill-library/polyfills/__dist/Node.prototype.contains/raw.js',