-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in script dependencies in 19.5.0 #66552
Comments
Adding a few folks that have an interest here, from previous work on this: |
Yikes! Do we know when this regressed and whether this is in WP 6.7? We‘d need to prioritize it in that case. |
@swissspidy: As far as I can tell, it regressed with #65926, i.e. commit 72d2ff4. I'm not sure how to check whether that was part of WP 6.7 😕 |
#65926 was not backported to |
Another option to take care of a big chunk of the problem would be to drop support for chrome 109 (i.e. add |
Unfortunately, this kind of thing is an all-or-nothing affair, so we'd still need a way for common features not to be polyfilled at all 😕 Dropping support for chrome 109 while simultaneously excluding |
Dropping support for Chrome 109 means that as soon as we start using |
We don't really have any great solutions if we want to be able to use |
Description
#65292 introduced a mechanism to avoid adding
wp-polyfill
as a dependency to every package, based on what syntax features are actually in use. Unfortunately, a regression was since introduced where pretty much all packages now end up depending onwp-polyfill
again.The cause behind this is that new features are now being polyfilled, specifically new methods in arrays and sets.
Full list of polyfills
These new methods are not actually in use in all of these packages (if any?), but are being marked as needed due to severe limitations in
babel
. Essentially, and as far as I can tell, any code that uses anArray
will be marked as needing all of the array methods, even if they're not being used anywhere.There are two ways we could approach this:
polyfill-exclusions.js
Any of the above options will leave the methods unpolyfilled, however, and thus unavailable for general use in Gutenberg.
Beyond this, we should probably consider adding a CI job to detect similar issues in the future (e.g. by checking that a selection of basic packages, like
hooks
andi18n
, don't get a dependency onwp-polyfill
).I'd like to hear any of your thoughts in how to tackle this!
Step-by-step reproduction instructions
index.min.asset.php
files for packages likei18n
orhooks
, which shouldn't require polyfillsScreenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: