chore: use lodash-es over per-function packages #1109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
lodash per-function packages are discouraged in the lodash docs (see M2-720 description for more details).
eg. lodash.debounce was last updated 6 years ago, yet lodash-es's repo has changed to debounce 3 years ago, so the per-package modules are not updated
In case you're worried this will increase the bundle size since there's one big package rather than 3 small ones - the difference between the
lodash-esandlodashpackage on NPM is thatlodash-esis published as an ES module, so doing things likewill put only files related to debounce into the bundle, not whole lodash (if you wrote
from 'lodash'though, it'd import it all)The main bundle generated in this PR is 500 bytes heavier than develop, but avoids the pitfalls mentioned in M2-720 lodash docs link