-
Notifications
You must be signed in to change notification settings - Fork 812
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
Tiled gallery: add wp-polyfill as a dependency #11487
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This is automated check which relies on |
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'll give this a test soon, but this looks preferable to Automattic/wp-calypso#31228
FYI @jeffersonrabb @ockham this might be a good solution for Slideshow block as well to shave some 50KB off from |
Not in this PR, but just noting down that it would be interesting to try detect old browsers either at the backend or in frontend and load |
D25143-code deployed. |
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've tested and this fixes the issue in ie11 for me 👍
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.
Looking good on my end. Merging.
The previous version of Tiled gallery had `wp-i18n` as a dependency which depends on `wp-polyfill` (https://github.com/WordPress/WordPress/blob/029fcf7791e425303d14328471ed61e9f0ecc1e1/wp-includes/script-loader.php#L424). We removed view side deps in #11326 By adding `wp-polyfill`, we ensure that `isNaN`, `Array.from` and other methods that need polyfilling to work in IE11. Editor side dependency isn't _really_ needed here since many other dependencies pull in wp-polyfill as well, but seems like it's good to be explicit? This fix is an alternative to Automattic/wp-calypso#31228 because of size considerations: Automattic/wp-calypso#31228 (comment): >wp-polyfill (v7.0.0) 30.7 KB minified > >view.js when building minified production versions from Automattic/wp-calypso#31228: >- without polyfill 7.96 KiB >- with polyfill 87.6 KiB #### Changes proposed in this Pull Request: - Add `wp-polyfill` as a dependency for tiled gallery block view side and editor side. #### Testing instructions: - Spin up jurassic ninja with this branch gutenpack-jn - Add Tiled gallery to a page where no other blocks are not present (to ensure you're not loading `wp-polyfill` via other sources) - open the saved page in IE11 and observe no more fatal errors in debugger Fixes Automattic/wp-calypso#31224 #### Proposed changelog entry for your changes: Fix regression that caused Tiled Gallery not function in Internet Explorer 11 browsers anymore.
Cherry-picked to |
The previous version of Tiled gallery had
wp-i18n
as a dependency which depends onwp-polyfill
(https://github.com/WordPress/WordPress/blob/029fcf7791e425303d14328471ed61e9f0ecc1e1/wp-includes/script-loader.php#L424).We removed view side deps in #11326
By adding
wp-polyfill
, we ensure thatisNaN
,Array.from
and other methods that need polyfilling to work in IE11.Editor side dependency isn't really needed here since many other dependencies pull in wp-polyfill as well, but seems like it's good to be explicit?
This fix is an alternative to Automattic/wp-calypso#31228 because of size considerations: Automattic/wp-calypso#31228 (comment):
Changes proposed in this Pull Request:
wp-polyfill
as a dependency for tiled gallery block view side and editor side.Testing instructions:
wp-polyfill
via other sources)Fixes Automattic/wp-calypso#31224
Proposed changelog entry for your changes:
Fix regression that caused Tiled Gallery not function in Internet Explorer 11 browsers anymore.