Importing lodash methods directly in order to reduce bundle sizes
Addressing issue https://github.com/benwinding/react-admin-firebase/issues/266 It's a pretty small change, so should not be difficult to review it
- Changed misc arrayHelpers and translate-from-firestore lodash imports
- Changed FireClient database provider lodash imports
- Updated package.json and yarn.lock to reflect the dependency changes
@benwinding this could be a nice improvement to the actual bundle size of the project!
Just as I suspected, this seems to have 0 effect on the bundle size, which is already tiny at 10kb
I think the bundler already helps with this, due to tree-shaking... Unless anyone can prove otherwise?
Maintaining dependencies for each helper function of lodash seems a bit insane to me...
unfortunatly, i don't know how to analyze the bundle of this project (I will glad if you tell me how can i visualize it like webpack-bundle-analyzer), but as this commit of react-admin -> https://github.com/marmelab/react-admin/pull/9385 , cherry picking lodash is prefered due to dependencies resolution. In this way, you are 100% sure that you will inject only the lodash modules that are actually utilized.
As regards of maintaning each lodash dependency in the package.json, I agree with you that is not sustainable and importing just lodash is fine due treeshaking