Re:No Lodash
by hot_gril on Tuesday March 07, 2023 @01:13PM
(#35058863)
If someone on my team imports Lodash and uses it all over the place to significantly reduce our LoC, fine by me. What makes it annoying is when someone adds that whole dep just to use it once, or for something ES6 already has (e.g. map). Same with Axios instead of fetch.
[ Parent
| on HN ]
Re:No Lodash
by wdhilliard on Tuesday March 07, 2023 @01:29PM
(#35059110)
It is really annoying (and in my opinion, almost misleading) that named imports from lodash do not tree shake. That said, you still can import individual modules without having to use the entire library. At my company we had to turn on linting rules to make sure our developers do not continue to import the entire library. Or even worse, import '_'
I don't even want to concern myself with that to begin with for something that's hardly used. Even if you are tree-shaking, it's one more dep and one more thing that can go wrong. But yeah at a big company it's someone's job to deal with it.