Opened 4 years ago
Closed 4 years ago
#52854 closed enhancement (fixed)
Update polyfill libraries for 5.8
Reported by: | desrosj | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | has-patch |
Focuses: | javascript | Cc: |
Description (last modified by )
There are a handful of polyfill libraries listed as devDependencies
that have available updates:
objectFitPolyfill
: Core has2.3.4
, latest is2.3.5
(introduced in [50048]).formdata-polyfill
: Core has3.0.13
, latest is3.0.20
(last updated in [44728]).polyfill-library
: Core has3.42.0
, latest is3.103.0
(last updated in [47238]).
These are block editor related, but they do not appear to be listed as dependencies in the Gutenberg repo anymore.
We should:
- Confirm they are still required.
- Remove them if not.
- Update to the latest versions.
The scenarios where they are used need to be identified and tested.
Related: #52851.
Change History (14)
This ticket was mentioned in Slack in #core-editor by desrosj. View the logs.
4 years ago
#4
follow-up:
↓ 5
@
4 years ago
They aren't listed in the Gutenberg plugin anymore because they are handled in WordPress core here:
My quick guess is - as long as we support IE 11 we need all those polyfills so it would be a good idea to upgrade them.
I also see that @babel/polyfill
is deprecated and should be replaced with core-js/stable
:
https://babeljs.io/docs/en/babel-polyfill
It also looks like we need to sync the version of objectFitPolyfill
in the Gutenberg plugin as it is outdated (it adds it for older versions of WP):
#5
in reply to:
↑ 4
@
4 years ago
Replying to gziolo:
My quick guess is - as long as we support IE 11 we need all those polyfills so it would be a good idea to upgrade them.
I think, unfortunately, because they are bundled in Core, we'll need to keep them in Core for some time. If a plugin or theme is adding the script as a dependency, removing it could break their code.
I checked out the changes in these polyfills, and they all seem relatively safe to include. I'm going to update them, and then I'll open a PR for updating objectFitPolyfill
in Gutenberg.
I think we should split off a separate ticket for the @babel/polyfill
library update.
This ticket was mentioned in PR #1140 on WordPress/wordpress-develop by desrosj.
4 years ago
#6
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/52854
#7
@
4 years ago
- Owner set to desrosj
- Resolution set to fixed
- Status changed from new to closed
In 50615:
4 years ago
#8
Merged into Core in https://core.trac.wordpress.org/changeset/50615.
#11
@
4 years ago
Updating those polyfill libraries isn't the most intuitive process :(
I think we should split off a separate ticket for the @babel/polyfill library update.
I agree. It's going to be its own set of issues because we will have to create a webpack entry point that imports core-js
and regenerator-runtime
.
import 'core-js/stable'; import 'regenerator-runtime/runtime';
They aren't defined as dependencies in package.json
at the moment.
#12
@
4 years ago
I created #52946 for @babel/polyfill
changes, but I won't have time to work on it this week.
These polyfills are also documented here: https://github.com/WordPress/gutenberg/blob/08002b8dcb657145e986b257923440be081f9024/docs/contributors/code/scripts.md#polyfill-scripts.