Skip to content
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

Size of library too large #4

Closed
tomfa opened this issue Aug 8, 2016 · 5 comments
Closed

Size of library too large #4

tomfa opened this issue Aug 8, 2016 · 5 comments

Comments

@tomfa
Copy link

tomfa commented Aug 8, 2016

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
Copy link
Owner

gor181 commented Aug 8, 2016

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
Copy link
Author

tomfa commented Aug 8, 2016

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
Copy link
Author

tomfa commented Aug 8, 2016

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
Copy link
Owner

gor181 commented Aug 9, 2016

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
Copy link
Owner

gor181 commented Aug 9, 2016

hey @tomfa

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants