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

refactor: remove lodash as dependency #2993

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

Conversation

danielsogl
Copy link

Closes carbon-design-system/carbon-components-angular#

Removes lodash as a dependency

Changelog

  • remove lodash dependency

@danielsogl danielsogl requested a review from a team as a code owner September 8, 2024 12:18
Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for carbon-components-angular ready!

Name Link
🔨 Latest commit d704b67
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-angular/deploys/66ddddbda43eb3000888d1a8
😎 Deploy Preview https://deploy-preview-2993--carbon-components-angular.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Sep 8, 2024

DCO Assistant Lite bot All contributors have signed the DCO.

@danielsogl
Copy link
Author

I have read the DCO document and I hereby sign the DCO.

@danielsogl
Copy link
Author

recheck

Copy link
Contributor

@Akshat55 Akshat55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @danielsogl, any specific reason for removing lodash? I feel like it can bring value to a lot of the components where we need to do array manipulation or deep copies. I agree we can implement our own utilities, but using lodash would be more safer and stable.

The tests seem to pass so it's definitely safe to remove, just want to know your reasoning and any complications you have run into.

@danielsogl
Copy link
Author

danielsogl commented Sep 19, 2024

@Akshat55 lodash adds a huge footprint to the library bundle. Another issue is that lodash-es is also added as a dependency to the project. You don’t need to use two implementations of the same library, or you could opt for no implementation at all. lodash-es would keep the bundle small.

@Akshat55
Copy link
Contributor

@Akshat55 lodash adds a huge footprint to the library bundle. Another issue is that lodash-es is also added as a dependency to the project. You don’t need to use two implementations of the same library, or you could opt for no implementation at all. lodash-es would keep the bundle small.

You're right, my initial plan was to replace lodash-es with just lodash but did not take the overall size into account. lodash-es is not exported with the code, only lodash is, but we can replace this. For now, I think it would be better to replace lodash with lodash-es instead of completely removing it. What are your thoughts?

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.

2 participants