Compat: Use core-js-url-browser for URL polyfill#20225
Conversation
Only scripts registered in gutenberg_register_vendor_scripts are downloaded as part of the plugin build script.
1f502c1 to
9fa86b9
Compare
|
Size Change: 0 B Total Size: 864 kB ℹ️ View Unchanged
|
|
Per #20628 (comment) , I've rebased the branch and updated script registrations in 9fa86b9. Specifically, calls to There is one minor difference to note: Previously, the logic would avoid calling cc @mcsf |
|
Note that this is meant to complement the downstream core revision r47416. |
Previously: #19871
Related: https://github.com/Financial-Times/polyfill-library/issues/462, #20172 (comment), Trac#49360
This pull request seeks to resolve issues where the current polyfill for
URLintroduced in #19871 is ineffective:window.URLdoes exist in IE11. It's specifically the constructor which is not supported (see related comment).The proposed changes improve the condition, and use
core-js-url-polyfillin place ofpolyfill-libraryfor the URL polyfill. This is a package I've published to NPM, and is a simple wrapper ofcore-js's URL polyfills. See Trac#49360 comment for more context on why a wrapper module is needed.Testing Instructions:
NOTE: The following can't yet be tested, because there is an unrelated error in IE11 preventing the page from being loaded. (TBD PR)
Prerequisites:
gutenberg/lib/compat.php
Line 55 in 5a5564b
wp-polyfill-url. Since this was already patched to core in 5.4-beta, the changes would not otherwise take effect.Test:
new URL( 'http://example.com' );new URL( 'invalid' );