-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(polyfill): Remove IE11 polyfills #1515
Conversation
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.
Can we remove the entire polyfill.js
file?
Looking at the PR's for the other shims, they don't seem to specify that they were only for IE11. I see that Number.isNaN, includes, and other functions arent unsupported by older Chrome, Firefox, Safari browsers. Need to check what specific browser versions we support. |
Reflect.construct isn't supported on the older versions of Chrome, Firefox, and Safari as well https://caniuse.com/mdn-javascript_builtins_reflect_construct. Given that, if we move forward with the removal, we should be okay with removing the other polyfills as well. |
Investigated the polyfilled functions using Reflect.construct: Array.find: Array.findIndex: Array.includes: String.endsWith: Number.isNaN: PerformanceObserver: These are all very old versions of browsers, I think we are safe to remove the polyfill file. We'll just have to make sure we thoroughly QA test. |
I agree, we can likely safely remove the polyfill. |
@@ -50,6 +50,10 @@ describe('lib/Preview', () => { | |||
preview.logger = new Logger(); | |||
stubs = {}; | |||
stubs.api = new Api(); | |||
window.PerformanceObserver = jest.fn(() => ({ |
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.
Mock needed, similar to PreviewPerf-test.js
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.
LGTM. Please check with the team on if they want to release this as a major version.
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.
Looks good. Don't see any problems with this. Let's just make sure all the tests pass. There could be some tests that rely on the polyfills.
IE11 is no longer supported. This removes some polyfills needed for IE11 as those polyfills can cause other issues as we move forward.