gor181 / react-notification-system-redux

Redux wrapper for react-notification-system
MIT License
324 stars 59 forks source link

Size of library too large #4

Closed tomfa closed 8 years ago

tomfa commented 8 years ago

importing react-notification-system-redux into my application increases the size by ~1.45 MB for me, as opposed to only react-notification-system, which adds 60 KB.

Not sure what's up, but it's not good.

gor181 commented 8 years ago

hey @tomfa ,

Which npm are you on?

https://github.com/gor181/react-notification-system-redux/blob/master/package.json#L28-L33 are the dependencies.

How did you measure the size?

Cheers

tomfa commented 8 years ago

I measured the size by using webpack, and by adding and removing import Notifications from 'react-notification-system-redux'; from my source files (not using it).

It seems to me it was the usage of lodash that was the cause of almost all of the size increase (1.37 of 1.45 MB). (Tested by replacing the import with import {each, extend} from 'lodash';

npm was on version 3.9.2. Upgrading to 3.10.5 did not help.

tomfa commented 8 years ago

E.g. I guess this is not your fault? I'll figure out where I've gone wrong :) Thanks for the library, btw! 👍

Edit: Could replace lodash with ES6 for the next version? (I presume there's not many people using ES5 with Redux)

gor181 commented 8 years ago

Yeh we can get rid of lodash, usage of 2 common simple functions is defeating the purpose of having the whole lib as dep.

thanks @tomfa

gor181 commented 8 years ago

hey @tomfa

Could be a bit better now. Lodash is only required in dev mode due to examples and the redux being there.