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

Remove lodash dependency #741

Open
rtorrente opened this issue Jan 15, 2025 · 0 comments
Open

Remove lodash dependency #741

rtorrente opened this issue Jan 15, 2025 · 0 comments

Comments

@rtorrente
Copy link

Hello,

When we use expo atlas to see dependency size and package contribution on the final bundle, we can see that lodash is loaded entirely and actually represent the second package contribution after React Native in the bundle size.
Almost 9% of the bundle size is due to lodash called only by this package in my app.

If we look in the code, we can see that the only lodash function used here is the range function in only one file (https://github.com/indiespirit/react-native-chart-kit/blob/master/src/contribution-graph/ContributionGraph.tsx#L311)

For only one function, I think it can be good to move away lodash and put the range function locally.
At least import only the required function (not _). But actually, tree shaking in expo is experimental

What do you think between this two solutions ?

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

1 participant