eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.44k stars 145 forks source link

Use just utilities instead of lodash #112

Open ksheedlo opened 6 years ago

ksheedlo commented 6 years ago

This change reduces the Javascript footprint of react-masonry-component by switching to https://github.com/angus-c/just

afram commented 6 years ago

hi @ksheedlo

Thanks for this PR, just wondering how do you use this library i your project?

We migrated over to the lodash library because most people these days if using React are using Webpack/Rollup with tree pruning so you wouldn't get all of the extra unused methods.

Have you had any particular issues?

ksheedlo commented 6 years ago

We are using browserify, but just should be lighter regardless of what bundler you are using.

Here's a table of imported package weights sourced from bundlephobia.com

Package Minified + gzipped size
just-merge 261 B
just-debounce-it 207 B
just-omit 208 B
lodash.omit 2.5 KB

Just lodash.omit by itself is 4X larger than all 3 just utilities put together.

kuznetsov-from-wonderland commented 6 years ago

Waiting for this PR being accepted. We have lodash as peer dep in our projects.