Make WordPress Core


Ignore:
Timestamp:
08/29/2024 06:04:02 AM (2 months ago)
Author:
swissspidy
Message:

Script Loader: Remove importmap polyfill.

The polyfill was added in [57492], but all browsers supported by WordPress already support import maps.

This not only disables the polyfill, but completely removes it as it was only added recently and there is no usage outside of core.

Props swissspidy, desrosj, luisherranz, gziolo.
Fixes #60970.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r58163 r58952  
    31183118    public function test_wp_get_script_polyfill() {
    31193119        global $wp_scripts;
    3120         $script_name = 'wp-polyfill-importmap';
    3121         $test_script = 'HTMLScriptElement.supports && HTMLScriptElement.supports("importmap")';
    3122         $script_url  = 'https://example.com/wp-polyfill-importmap.js';
     3120        $script_name = 'tmp-polyfill-foo';
     3121        $test_script = 'HTMLScriptElement.supports && HTMLScriptElement.supports("foo")';
     3122        $script_url  = 'https://example.com/polyfill-foo.js';
    31233123        wp_register_script( $script_name, $script_url );
    31243124
     
    31343134        $expected = '( ' . $test_script . ' ) || document.write( \'<script src="' . $script_url . '"></scr\' + \'ipt>\' );';
    31353135
    3136         $this->assertEquals( $expected, $polyfill );
     3136        $this->assertSame( $expected, $polyfill );
    31373137    }
    31383138
Note: See TracChangeset for help on using the changeset viewer.