Skip to content

Remove lodash dependency #741

@rtorrente

Description

@rtorrente

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions