-
Notifications
You must be signed in to change notification settings - Fork 213
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: Avoid polyfill requirements #492
Conversation
0b45c7d
to
1131f73
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
This isn't the only place in our codebase that does Object.entries though, should this be something we polyfill? Or should we change everywhere?
Hmm. Maybe we should update our Or perhaps an ESLint rule for detecting compat features? https://www.npmjs.com/package/eslint-plugin-compat |
@NicholasBoll @lychyi After adding the linting rule, I found two more issues: I fixed both, so we should be good now! |
Co-Authored-By: Cody Towstik <ctowstik@gmail.com>
78298d3
to
f3d776a
Compare
* refactor(icon): Update to remove Object.entries usage * feat: Add linting for browser compatible functions * fix: Fix two browser compatibility issues * refactor(icon): Simplify color lookup Co-Authored-By: Cody Towstik <ctowstik@gmail.com> * fix(core): Use Object.keys instead of Object.entries Co-authored-by: Cody Towstik <ctowstik@gmail.com>
* refactor(icon): Update to remove Object.entries usage * feat: Add linting for browser compatible functions * fix: Fix two browser compatibility issues * refactor(icon): Simplify color lookup Co-Authored-By: Cody Towstik <ctowstik@gmail.com> * fix(core): Use Object.keys instead of Object.entries Co-authored-by: Cody Towstik <ctowstik@gmail.com>
* refactor(icon): Update to remove Object.entries usage * feat: Add linting for browser compatible functions * fix: Fix two browser compatibility issues * refactor(icon): Simplify color lookup Co-Authored-By: Cody Towstik <ctowstik@gmail.com> * fix(core): Use Object.keys instead of Object.entries Co-authored-by: Cody Towstik <ctowstik@gmail.com> Co-authored-by: Alex Nicholls <anicholls3@gmail.com> Co-authored-by: Cody Towstik <ctowstik@gmail.com>
We were unnecessarily using
Object.entries
in the check for an empty context inuseTheme
. This function requires a polyfill in IE 11, so I've switched it to useObject.keys
instead, since this is equivalent for checking whether an object is empty.Continued:
After a bit more exploration, we were using several functions that required polyfills. This PR now adds a lint check to ensure we don't do this in the future.