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

chore: replace lodash to decrease bundle size #2210

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lcdss
Copy link

@lcdss lcdss commented Jan 24, 2025

This PR replaces lodash.isequal by @gilbarbara/deep-equal and lodash.clonedeep by klona to decrease the bundle size in ~6kB (gzip).

@kikyous
Copy link

kikyous commented Jan 31, 2025

I think replace lodash with es-tookit is a better solution https://github.com/toss/es-toolkit

@lcdss
Copy link
Author

lcdss commented Feb 24, 2025

I think replace lodash with es-tookit is a better solution https://github.com/toss/es-toolkit

I didn't know about it. I'll check how the bundle size compares to the current choices and if it's close, I think it'll be a better alternative.

@eznix86
Copy link

eznix86 commented Mar 7, 2025

Thanks @lcdss, pls merge it if possible :)

@lcdss
Copy link
Author

lcdss commented Mar 12, 2025

Summarizing, lodash costs 8.77 kB (gzip), es-toolkit costs 1.84 kB (gzip) and @gilbarbara/deep-equal + klona costs 1kB (gzip). As these are generic functions that doesn't require almost any maintenance I would go with the current option, but taking popularity and security into consideration, es-toolkit is definitely the best option, unless we add the implementation for both functions directly to this repository.

Replace `lodash.isequal` by `@gilbarbara/deep-equal` and
`lodash.clonedeep` by `klona` to decrease the bundle size.
@lcdss lcdss force-pushed the chore-replace-lodash branch from 0380fdd to 81954fb Compare March 12, 2025 04:53
@lcdss lcdss force-pushed the chore-replace-lodash branch from 81954fb to 6d01353 Compare March 12, 2025 05:07
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

Successfully merging this pull request may close these issues.

3 participants