-
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
Scripts: Remove inject polyfill by default #35436
Conversation
Size Change: +2.25 kB (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
@mkaz for testing do you have an example command of what we should run / see? For other reviewers, note that the block editors request wp-polyfill regardless of this change (and that this is expected). |
It is a little tricky to test because you'll need to run the wp-scripts out of the repo, and not NPM. The before case:
The after case is easiest to duplicate, so working off the same before case
|
Hmm, maybe we can leverage the create block test gutenberg/bin/test-create-block.sh Line 22 in 2c7ed62
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this by commenting out this line in test-create-block and ran npm run test:create-block
in this branch, then again in trunk. As we can see the wp-polyfill is omitted:
branch: esnext-test/build/index.asset.php
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n'), 'version' => 'daa4176be053b3cf84973d388f68b869');
trunk:
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'daa4176be053b3cf84973d388f68b869');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is fine I just added a comment to improve the changelog (minor typo). 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you for wrangling this change 👍🏻
Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
Description
The default behavior for the scripts when generating the assets.php file was to include the
wp-polyfill
by default. With the dropping of support for IE, this is no longer necessary. So this PR removes adding it by default.Fixes #35410
How has this been tested?
Confirm that when using script to generate assets.php script, that
wp-polyfill
is not included in the dependency list.Types of changes
This is a breaking change in that any scripts or plugins that rely on the polyfill must now explicitly declare it as a dependency, which they probably should of done in the first place to guarentee compatibility.