piotrwitek / typesafe-actions

Typesafe utilities for "action-creators" in Redux / Flux Architecture
https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
MIT License
2.41k stars 98 forks source link

The size of the npm package is unrealistic. #31

Closed kjr247 closed 6 years ago

kjr247 commented 6 years ago

NPM package size: 53.2 KB NPM package size on disk: 112 KB

If I'm not mistaken the size of the actual solution is only about 5.5 KB, which should be something to boast about.

The problem is the dev dependencies. The yarn file alone is 100 KB. For a production application these dev dependencies should not be included in the node modules package, only the git repository.

Love this solution btw, Keep up the great work. Please be sure to ping me if there is anything I can do! ;)

piotrwitek commented 6 years ago

Hello @kjr247 Thanks for your feedback. Not sure which version you're referring to but I'll be talking about 2.0.0-1, as I have it opened at the moment. So v2 currently is 876 B min + gzip (this is what is included in your project when you're importing it) Regarding npm package folder size, I was inspired by most popular libraries (redux specifically) and basically they include the same content as "typesafe-actions", which is:

What I plan to optimize further is to unify type declarations with a separate build process and the second one would be to include optimized AMD "dist/" bundle (same as in redux package).

Also I'm not sure if *.map files should be included as it's currently (redux doesn't have them) 🤔

Is there anything else you'd like to suggest should be removed from above list?

kjr247 commented 6 years ago

Awesome support! I re-implemented your entire solution here, and thought it was very elegant. I will be using it in many projects. ;)