Versent / redux-crud

A set of standard actions and reducers for Redux CRUD Applications
MIT License
624 stars 54 forks source link

redux-crud in production #35

Closed dvreed77 closed 7 years ago

dvreed77 commented 8 years ago

When trying to minimize/optimize my project using Webpack. The redux-crud library is huge since you are bringing in the entire lodash library everytime you are calling it. See here: http://stackoverflow.com/questions/35250500/correct-way-to-import-lodash

Also the SIU library is doing the same.

I'm not sure if there is an easy way around this, but it making my bundle.js huge.

Awesome library otherwise

sporto commented 8 years ago

I see, I will take the time to use lodash in the recommended way. Will let you know.

amok commented 8 years ago

@dvreed77 I'm not sure, but might be lodash/babel-plugin-lodash would help you need then transpile redux-crud with babel

sporto commented 7 years ago

Published v2, it removes all the heavy dependencies. Now it only uses individual lodash functions to transform the collections. No more deps on the whole lodash, seamless-immutable and Immutable.js.

niksosf commented 7 years ago

What was the reason to drop seamless-immutable?

niksosf commented 7 years ago

I am running into errors like these when upgrading from v1 to v3 with still with seamless immutable.

Uncaught TypeError: Cannot assign to read only property '0' of object '[object Array]'

in the merge(current, records, key) function.

Is there still an option to use seamless-immutable with v3?

sporto commented 7 years ago

@niksosf all those deps were very heavy. If you chose to use Immutable this lib will still import the others, making your bundle huge. The lib uses ramda now. All operations are immutable anyway by using ramda.

niksosf commented 7 years ago

@sporto thanks for the explanation. I can see the decision to avoid lugging around a large library like immutablejs or seamless.

Now for what I can understand about optimization like shouldComponentUpdate() that often times benefits, though does not require, shallow equality comparison, which immutable data excel, how have you dealt with that loss?