Preserve current wp-polyfill while adding a new, built version.#1405
Preserve current wp-polyfill while adding a new, built version.#1405desrosj wants to merge 1 commit intoWordPress:masterfrom
wp-polyfill while adding a new, built version.#1405Conversation
|
There was also a newer version of the |
peterwilsoncc
left a comment
There was a problem hiding this comment.
Looks like it will work but a minor - non-blocking this close to beta3 - question inline.
| } | ||
|
|
||
| $scripts->add( 'wp-polyfill', null, array( 'wp-polyfill' ) ); | ||
| $scripts->add( 'wp-polyfill', null, array( 'regenerator-runtime', 'wp-polyfill-built' ) ); |
There was a problem hiding this comment.
Is there a strong reason to avoid merging these two scripts in to one and retain the single script alias?
The though behind this question is two fold:
- next time WP changes polyfill libraries, avoiding a
-built-final-final-FINAL-2type of situation - performance cost/benefit of sending one script vs two
There was a problem hiding this comment.
I don't mind having two scripts here. In the future, we might be able to drop regenerator-runtime for core scripts and make it opt-in for 3rd projects for backward compatibility. I'm not sure if that is going to be a simple task though.
| 'wp-polyfill-object-fit' => '2.3.5', | ||
| 'wp-polyfill' => '7.4.4', | ||
| 'wp-polyfill-built' => '6.2.0', | ||
| 'wp-polyfill' => '7.10.1', |
There was a problem hiding this comment.
Should it be 7.12.1 to align with @babel/polyfill?
gziolo
left a comment
There was a problem hiding this comment.
Let's try it and see if it is compatible with all 3rd party scripts. Based on the feedback from some plugin authors it should be fine to replace the polyfill from Babel with the custom one without IE 11 support as long as we include regenerator-runtime. From the WP core perspective, regenerator-runtime is obsolete but maybe we can find a way in the future to make it opt-in for scripts that need it. We should encourage the community to start using the latest @wordpress/babel-preset-default so we can speed up the deprecation of regenerator-runtime.
|
Closing in favor of #1416, which was merged into Core. |
This is an alternate approach to fixing the regression in Core-52941.
In this PR:
wp-polyfill.jsandwp-polyfill.min.jsfiles are preserved to prevent 404 errors, just in case someone is targeting them directly.wp-polyfill-builtscript handle is added to represent the new, custom built polyfill.regenerator-runtimescript handle has been added representing theregenerator-runtimedependency. Scripts are built appropriately.wp-polyfillscript handle is updated to be a psuedo script withwp-polyfill-builtandregenerator-runtimeas dependencies.Trac ticket: https://core.trac.wordpress.org/ticket/52941.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.