You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In WordPress 5.0 we now have wp_get_script_polyfill() and the wp-polyfill script handle.
wp_default_packages_vendor() does register some polyfills by default when enqueuing wp-polyfill: wp-polyfill-fetch, wp-polyfill-node-contains, wp-polyfill-formdata, wp-polyfill-element-closest. wp-polyfill itself contains polyfills for things like Promises.
In this plugin, we manually add polyfills for #Element.closest and window.fetch, as well as Promises.
To make things easier for us, it would make sense to use the polyfills provided by WordPress for this. Makes maintenance a bit easier again. For WordPress < 5.0 we could still use the current approach.
The text was updated successfully, but these errors were encountered:
In WordPress 5.0 we now have
wp_get_script_polyfill()
and thewp-polyfill
script handle.wp_default_packages_vendor()
does register some polyfills by default when enqueuingwp-polyfill
:wp-polyfill-fetch
,wp-polyfill-node-contains
,wp-polyfill-formdata
,wp-polyfill-element-closest
.wp-polyfill
itself contains polyfills for things like Promises.In this plugin, we manually add polyfills for
#Element.closest
andwindow.fetch
, as well as Promises.To make things easier for us, it would make sense to use the polyfills provided by WordPress for this. Makes maintenance a bit easier again. For WordPress < 5.0 we could still use the current approach.
The text was updated successfully, but these errors were encountered: