-
Notifications
You must be signed in to change notification settings - Fork 282
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
Only import lodash's sortBy method #2858
Conversation
My goal here is to hopefully eventually reduce package sizes by restricting |
@@ -9,7 +9,7 @@ | |||
/* eslint-disable @typescript-eslint/no-unused-vars */ | |||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | |||
import { Constant } from './constant'; | |||
import * as lodash from 'lodash'; | |||
import { sortBy as lodashSortBy } 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.
I think this will be more effective: https://stackoverflow.com/questions/35250500/correct-way-to-import-lodash
Feel free to verify that this gives the expected package size reductions.
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.
Thanks!
thanks everyone! 💯 |
Description
Instead of
import
ing all oflodash
infunctionUtils.internal.ts
, import only thesortBy
method, which is the only one needed.Testing
Already covered by existing
sortBy
tests (which pass).