jwplayer / jwplayer-react-native

MIT License
32 stars 9 forks source link

[FEAT] replace lodash dep for improved bundle size #41

Closed chriszs closed 5 months ago

chriszs commented 5 months ago

Is your feature request related to a problem? Please describe. I'm trying out Expo's new Atlas bundle visualizer, and I notice that lodash is one of the largest dependencies in the app's bundle: it's about 559 kb or about 3.45% of the overall bundle size.

Screenshot 2024-06-04 at 4 36 23 PM

It's required as a development dependency by jwplayer-react-native, but it looks like it's included in index.js, where it's used for one comparison.

Describe the solution you'd like I propose changing this dependency to lodash.isequalwith, which should be way smaller and perform identically.

Additional context Installing lodash components separately is what every other library I've installed seems to do, probably for the same reason. This should probably be a non-dev dep.

Jmilham21 commented 5 months ago

This is a valid change and does shrink the bundle (never bad).

Jmilham21 commented 5 months ago

Approved your PR. Good catch.