[wp-trac] [WordPress Trac] #53078: Stop loading polyfills specific to Internet Explorer

WordPress Trac noreply at wordpress.org
Mon Apr 26 15:54:31 UTC 2021


#53078: Stop loading polyfills specific to Internet Explorer
---------------------------+---------------------
 Reporter:  desrosj        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  5.8
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+---------------------
Changes (by desrosj):

 * component:  General => Script Loader


Comment:

 After some investigating, it looks like the following dependencies are
 polyfills specifically for IE11 only:
 - `whatwg-fetch`: polyfills the `window.fetch()` function. This is present
 in [https://caniuse.com/mdn-api_windoworworkerglobalscope_fetch all other
 supported browsers].
 - `element-closest`: polyfills `Element.closest()`.
 - `core-js-url-browser`: polyfills the [https://caniuse.com/url URL API].
 - `objectFitPolyfill`: polyfills support for the `object-fit` CSS
 property.

 The `polyfill-library` is responsible for 2 IE11 specific polyfills in
 Core:
 - One that polyfills the Node.contains() function.
 - One that backports the DOMRect API.

 The last one, `formdata-polyfill`, polyfills elements of the FormData API
 for consistent experience across browsers. It does look like some aspects
 are relevant for browsers other than IE. For example, `for...of` support
 is added in Edge, `set()` support in Opera, and it makes the API available
 in workers for Safari.

 Some other details to consider. These scripts are only loaded if they are
 actually needed. And the polyfills need to continue to be bundled in Core
 just in case a plugin or theme is specifying as a dependency or
 enqueueing. So it may be worth not making the changes in the PR. But, IE11
 was removed from the Gutenberg repository, so that may not even matter
 anymore.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53078#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list