From 86dc3ffe0bdcde726ac967efa3e6df508fc68617 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 7 Feb 2023 16:46:34 +0000 Subject: [PATCH] External Libraries: Update `element-closest`. This updates the `element-closest` polyfill to the latest version, `3.0.2`. Because of changes to how the package is now built and distributed, both files for the library now contain minified code. This library is no longer used by Core itself and maintained as a courtesy. Any projects utilizing it should reevaluate their usage requirements with modern browsers. Props hareesh-pillai, gziolo, mukesh27, costdev. Fixes #52851. git-svn-id: https://develop.svn.wordpress.org/trunk@55275 602fd350-edb4-49c9-b593-d223f7449a82 --- package-lock.json | 6 +++--- package.json | 2 +- src/wp-includes/script-loader.php | 2 +- tools/webpack/packages.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9420551d9..dd8cfeb3c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9545,9 +9545,9 @@ "dev": true }, "element-closest": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/element-closest/-/element-closest-2.0.2.tgz", - "integrity": "sha1-cqdAoQdFM4LijfnOXbtajfD5Zuw=" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/element-closest/-/element-closest-3.0.2.tgz", + "integrity": "sha512-JxKQiJKX0Zr5Q2/bCaTx8P+UbfyMET1OQd61qu5xQFeWr1km3fGaxelSJtnfT27XQ5Uoztn2yIyeamAc/VX13g==" }, "emittery": { "version": "0.8.1", diff --git a/package.json b/package.json index b5853ade8a..df81c6d13e 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "backbone": "1.4.1", "clipboard": "2.0.11", "core-js-url-browser": "3.6.4", - "element-closest": "^2.0.2", + "element-closest": "^3.0.2", "formdata-polyfill": "4.0.10", "hoverintent": "2.2.1", "imagesloaded": "4.1.4", diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 359e172a7f..a150dd9474 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -114,7 +114,7 @@ function wp_default_packages_vendor( $scripts ) { 'wp-polyfill-node-contains' => '4.6.0', 'wp-polyfill-url' => '3.6.4', 'wp-polyfill-dom-rect' => '4.6.0', - 'wp-polyfill-element-closest' => '2.0.2', + 'wp-polyfill-element-closest' => '3.0.2', 'wp-polyfill-object-fit' => '2.3.5', 'wp-polyfill-inert' => '3.1.2', 'wp-polyfill' => '3.15.0', diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 671fb4a099..9789103e2c 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -65,7 +65,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil 'lodash.js': 'lodash/lodash.js', 'wp-polyfill.js': '@wordpress/babel-preset-default/build/polyfill.js', 'wp-polyfill-fetch.js': 'whatwg-fetch/dist/fetch.umd.js', - 'wp-polyfill-element-closest.js': 'element-closest/element-closest.js', + 'wp-polyfill-element-closest.js': 'element-closest/browser.js', 'wp-polyfill-node-contains.js': 'polyfill-library/polyfills/__dist/Node.prototype.contains/raw.js', 'wp-polyfill-url.js': 'core-js-url-browser/url.js', 'wp-polyfill-dom-rect.js': 'polyfill-library/polyfills/__dist/DOMRect/raw.js', @@ -81,6 +81,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil const minifiedVendors = { 'lodash.min.js': 'lodash/lodash.min.js', 'wp-polyfill.min.js': '@wordpress/babel-preset-default/build/polyfill.min.js', + 'wp-polyfill-element-closest.min.js': 'element-closest/browser.js', 'wp-polyfill-formdata.min.js': 'formdata-polyfill/formdata.min.js', 'wp-polyfill-url.min.js': 'core-js-url-browser/url.min.js', 'wp-polyfill-object-fit.min.js': 'objectFitPolyfill/dist/objectFitPolyfill.min.js', @@ -93,7 +94,6 @@ 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', 'wp-polyfill-dom-rect.min.js': 'polyfill-library/polyfills/__dist/DOMRect/raw.js', };