-
Notifications
You must be signed in to change notification settings - Fork 386
fix: use lodash version of unsupported Array.{fill, find} #1118
Conversation
Deploy preview for react-instantsearch ready! Built with commit 1766d70 https://deploy-preview-1118--react-instantsearch.netlify.com |
@@ -1,3 +1,4 @@ | |||
import { find, fill } from 'lodash'; |
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.
probably best to depend on /find and /fill ?
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 babel-plugin-lodash
handle that for us.
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.
didn't know we used it 🙌
In the future if we want to get rid of lodash, maybe we can use the automatic polyfill features of babel? Any of you have experience using https://babeljs.io/docs/plugins/transform-runtime? |
Would be better to use core-js directly rather than babel, I think that seems to be more of the recommendation. I fear that core-js is actually bigger than lodash usually though |
|
The good part versus using core-js is that I'd prefer to have a codebase that use RealJavaScript™️ whenever possible rather than relying on external modules inside the code itself. If Babel is smart enough to import core-js automatically for us at compile time it's fine for me and a better solution. So incrementally you can remove those directives based on the browsers you support/browser evolution. Which is great! |
Summary
Close #1115