Only import required lodash methods to reduce bundle size - #175
Conversation
|
Sorry can't merge it for now because can't test it without setting up an proper environment. |
|
@Eliav2 I had a good look around when I introduced your lib to my work's codebase, and couldn't find anything as good that satisfied these points:
I had a look around again this weekend after I saw the deprecation notice, and still couldn't find anything that was as elegant. Today I tried implementing something custom within our codebase, but struggled with positioning, re-rendering, etc. I also tried patching your lib via I appreciate that it's a niche case! |
|
Superseded, and thanks for this. Your diagnosis was right: the whole of lodash was ending up in the bundle, which is what #118 was reporting. We went further than the targeted imports here. In #212 lodash was removed entirely, along with prop-types and @types/react, so the package now has zero runtime dependencies. The two lodash call sites turned out to be doing very little: isEqual was comparing four numbers, and the other use was a plain object spread. The fix ships in 2.1.0. |
|
Even better - thanks! Appreciate the revival of this package, still using it today in production :) |
|
awesome to hear that @joealden |
No description provided.