WordPress.org

Make WordPress Core

Ticket #49360: 49360-url-dom-rect-polyfills.diff

File 49360-url-dom-rect-polyfills.diff, 5.4 KB (added by aduth, 13 months ago)
  • package.json

    diff --git a/package.json b/package.json
    index bc4c7c36cc..a21dc152ed 100644
    a b  
    132132                "lodash": "4.17.15",
    133133                "masonry-layout": "3.3.2",
    134134                "moment": "2.22.2",
    135                 "polyfill-library": "3.27.4",
     135                "polyfill-library": "3.42.0",
    136136                "react": "16.9.0",
    137137                "react-dom": "16.9.0",
    138138                "twemoji": "12.1.3",
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index 9edc8be35b..e52da92520 100644
    a b function wp_default_packages_vendor( &$scripts ) { 
    8686                'wp-polyfill-fetch',
    8787                'wp-polyfill-formdata',
    8888                'wp-polyfill-node-contains',
     89                'wp-polyfill-url',
     90                'wp-polyfill-dom-rect',
    8991                'wp-polyfill-element-closest',
    9092                'wp-polyfill',
    9193        );
    function wp_default_packages_vendor( &$scripts ) { 
    9799                'lodash'                      => '4.17.15',
    98100                'wp-polyfill-fetch'           => '3.0.0',
    99101                'wp-polyfill-formdata'        => '3.0.12',
    100                 'wp-polyfill-node-contains'   => '3.26.0-0',
     102                'wp-polyfill-node-contains'   => '3.42.0',
     103                'wp-polyfill-url'             => '3.42.0',
     104                'wp-polyfill-dom-rect'        => '3.42.0',
    101105                'wp-polyfill-element-closest' => '2.0.2',
    102106                'wp-polyfill'                 => '7.4.4',
    103107        );
    function wp_default_packages_vendor( &$scripts ) { 
    122126                        array(
    123127                                '\'fetch\' in window' => 'wp-polyfill-fetch',
    124128                                'document.contains'   => 'wp-polyfill-node-contains',
     129                                'window.URL'          => 'wp-polyfill-url',
     130                                'window.DOMRect'      => 'wp-polyfill-dom-rect',
    125131                                'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
    126132                                'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
    127133                        )
  • tests/phpunit/tests/dependencies/scripts.php

    diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php
    index 16846147da..5b885fe1b2 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.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 ) || 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 81b2cca079..0da0fe0af4 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',
     81                'wp-polyfill-dom-rect.js': 'polyfill-library/polyfills/DOMRect/polyfill.js',
    8082                'wp-polyfill-formdata.js': 'formdata-polyfill/FormData.js',
    8183                'moment.js': 'moment/moment.js',
    8284                'react.js': 'react/umd/react.development.js',
    module.exports = function( env = { environment: 'production', watch: false, buil 
    9698                'wp-polyfill-fetch.min.js': 'whatwg-fetch/dist/fetch.umd.js',
    9799                'wp-polyfill-element-closest.min.js': 'element-closest/element-closest.js',
    98100                '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',
     102                'wp-polyfill-dom-rect.min.js': 'polyfill-library/polyfills/DOMRect/polyfill.js',
    99103        };
    100104
    101105        const blockNames = [