WordPress.org

Make WordPress Core

Ticket #49360: 49360-core-js-url.diff

File 49360-core-js-url.diff, 8.9 KB (added by aduth, 13 months ago)
  • package-lock.json

    diff --git a/package-lock.json b/package-lock.json
    index 20959ee676..28de38db04 100644
    a b  
    58585858                                }
    58595859                        }
    58605860                },
     5861                "core-js-url-browser": {
     5862                        "version": "3.6.4",
     5863                        "resolved": "https://registry.npmjs.org/core-js-url-browser/-/core-js-url-browser-3.6.4.tgz",
     5864                        "integrity": "sha512-VCMkPikOVp5JXftTj0E3gPZNKa0exQX837KxyPcnMAKvImWG8+RbXwEHEGMjiNz+9Vl2YgutkVYOpq7iaSOt/Q=="
     5865                },
    58615866                "core-util-is": {
    58625867                        "version": "1.0.2",
    58635868                        "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
     
    59055910                },
    59065911                "create-hash": {
    59075912                        "version": "1.2.0",
    5908                         "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
     5913                        "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
    59095914                        "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
    59105915                        "dev": true,
    59115916                        "requires": {
     
    59185923                },
    59195924                "create-hmac": {
    59205925                        "version": "1.1.7",
    5921                         "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
     5926                        "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
    59225927                        "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
    59235928                        "dev": true,
    59245929                        "requires": {
     
    59845989                },
    59855990                "css-color-names": {
    59865991                        "version": "0.0.4",
    5987                         "resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
     5992                        "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
    59885993                        "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=",
    59895994                        "dev": true
    59905995                },
     
    68676872                },
    68686873                "diffie-hellman": {
    68696874                        "version": "5.0.3",
    6870                         "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
     6875                        "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
    68716876                        "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
    68726877                        "dev": true,
    68736878                        "requires": {
     
    1758917594                },
    1759017595                "react-autosize-textarea": {
    1759117596                        "version": "3.0.3",
    17592                         "resolved": "http://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-3.0.3.tgz",
     17597                        "resolved": "https://registry.npmjs.org/react-autosize-textarea/-/react-autosize-textarea-3.0.3.tgz",
    1759317598                        "integrity": "sha512-iOSZK7RUuJ+iEwkJ9rqYciqtjQgrG1CCRFL6h8Bk61kODnRyEq4tS74IgXpI1t4S6jBBZVm+6ugaU+tWTlVxXg==",
    1759417599                        "requires": {
    1759517600                                "autosize": "^4.0.0",
     
    1898418989                },
    1898518990                "sha.js": {
    1898618991                        "version": "2.4.11",
    18987                         "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
     18992                        "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
    1898818993                        "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
    1898918994                        "dev": true,
    1899018995                        "requires": {
  • package.json

    diff --git a/package.json b/package.json
    index 97029bd35c..a810c42aeb 100644
    a b  
    121121                "@wordpress/wordcount": "2.7.0",
    122122                "backbone": "1.4.0",
    123123                "clipboard": "2.0.4",
     124                "core-js-url-browser": "3.6.4",
    124125                "element-closest": "^2.0.2",
    125126                "formdata-polyfill": "3.0.13",
    126127                "hoverintent": "2.2.1",
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index ef085b5c93..f8e6c4383a 100644
    a b function wp_default_packages_vendor( &$scripts ) { 
    100100                'wp-polyfill-fetch'           => '3.0.0',
    101101                'wp-polyfill-formdata'        => '3.0.12',
    102102                'wp-polyfill-node-contains'   => '3.42.0',
    103                 'wp-polyfill-url'             => '3.42.0',
     103                'wp-polyfill-url'             => '3.6.4',
    104104                'wp-polyfill-dom-rect'        => '3.42.0',
    105105                'wp-polyfill-element-closest' => '2.0.2',
    106106                'wp-polyfill'                 => '7.4.4',
    function wp_default_packages_vendor( &$scripts ) { 
    126126                        array(
    127127                                '\'fetch\' in window' => 'wp-polyfill-fetch',
    128128                                'document.contains'   => 'wp-polyfill-node-contains',
    129                                 'window.URL'          => 'wp-polyfill-url',
    130129                                'window.DOMRect'      => 'wp-polyfill-dom-rect',
     130                                'window.URL && window.URL.prototype && window.URLSearchParams' => 'wp-polyfill-url',
    131131                                'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
    132132                                'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
    133133                        )
  • tests/phpunit/tests/dependencies/scripts.php

    diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
    index 5b885fe1b2..460c35e8a9 100644
    a b JS; 
    717717                $expected .= "<script type='text/javascript' src='http://example.com'></script>\n";
    718718                $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/vendor/wp-polyfill.min.js'></script>\n";
    719719                $expected .= "<script type='text/javascript'>\n";
    720                 $expected .= "( 'fetch' in window ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js\"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js\"></scr' + 'ipt>' );( window.URL ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-url.min.js\"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-dom-rect.min.js\"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js\"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js\"></scr' + 'ipt>' );\n";
     720                $expected .= "( 'fetch' in window ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js\"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js\"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-url.min.js\"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-dom-rect.min.js\"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js\"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js\"></scr' + 'ipt>' );\n";
    721721                $expected .= "</script>\n";
    722722                $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/dom-ready.min.js'></script>\n";
    723723                $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/a11y.min.js'></script>\n";
  • tools/webpack/packages.js

    diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js
    index bf05904e61..167ce0110a 100644
    a b module.exports = function( env = { environment: 'production', watch: false, buil 
    7777                'wp-polyfill-fetch.js': 'whatwg-fetch/dist/fetch.umd.js',
    7878                'wp-polyfill-element-closest.js': 'element-closest/element-closest.js',
    7979                'wp-polyfill-node-contains.js': 'polyfill-library/polyfills/Node/prototype/contains/polyfill.js',
    80                 'wp-polyfill-url.js': 'polyfill-library/polyfills/URL/polyfill.js',
     80                'wp-polyfill-url.js': 'core-js-url-browser/url.js',
    8181                'wp-polyfill-dom-rect.js': 'polyfill-library/polyfills/DOMRect/polyfill.js',
    8282                'wp-polyfill-formdata.js': 'formdata-polyfill/FormData.js',
    8383                'moment.js': 'moment/moment.js',
    module.exports = function( env = { environment: 'production', watch: false, buil 
    8989                'lodash.min.js': 'lodash/lodash.min.js',
    9090                'wp-polyfill.min.js': '@babel/polyfill/dist/polyfill.min.js',
    9191                'wp-polyfill-formdata.min.js': 'formdata-polyfill/formdata.min.js',
     92                'wp-polyfill-url.min.js': 'core-js-url-browser/url.min.js',
    9293                'moment.min.js': 'moment/min/moment.min.js',
    9394                'react.min.js': 'react/umd/react.production.min.js',
    9495                'react-dom.min.js': 'react-dom/umd/react-dom.production.min.js',
    module.exports = function( env = { environment: 'production', watch: false, buil 
    9899                'wp-polyfill-fetch.min.js': 'whatwg-fetch/dist/fetch.umd.js',
    99100                'wp-polyfill-element-closest.min.js': 'element-closest/element-closest.js',
    100101                'wp-polyfill-node-contains.min.js': 'polyfill-library/polyfills/Node/prototype/contains/polyfill.js',
    101                 'wp-polyfill-url.min.js': 'polyfill-library/polyfills/URL/polyfill.js',
    102102                'wp-polyfill-dom-rect.min.js': 'polyfill-library/polyfills/DOMRect/polyfill.js',
    103103        };
    104104