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: stop using lodash #1728

Open
erezrokah opened this issue Jan 13, 2021 · 4 comments
Open

chore: stop using lodash #1728

erezrokah opened this issue Jan 13, 2021 · 4 comments
Labels
good first issue type: chore work needed to keep the product and development running smoothly

Comments

@erezrokah
Copy link
Contributor

We're using only a few methods from lodash:
isEmpty,get,debounce,isEqual,merge,isObject,pick,sample.

It would be great to replace lodash with more minimal dedicated packages.

@erezrokah erezrokah added good first issue type: chore work needed to keep the product and development running smoothly labels Jan 13, 2021
@ehmicky
Copy link
Contributor

ehmicky commented Jan 13, 2021

I am 100% in favor of this.

I feel like Lodash code is quite complex because it tries to do too much. Debugging Lodash can be hard.

When comparing individual lodash packages (like lodash.isObject or when using lodash/fp) to alternative single-purpose packages, the single-purpose packages tend to be much easier to debug, more stable and with more features.

@eduardoboucas
Copy link
Member

Yes! 🙏

@ehmicky
Copy link
Contributor

ehmicky commented Jan 13, 2021

Note: we also already use the following ESLint plugin:

https://github.com/netlify/eslint-config-node/blob/824b4932030a373e5bd25638f152d640806fab1b/.eslintrc.js#L21

https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore

Which brings up another point: Lodash can sometimes be used when vanilla JavaScript alternatives are available (without more lines of code).

@JGAntunes
Copy link
Contributor

Personally I'm all in favor of avoiding "kitchen sink" like utility functions when possible. So yes! 👍

JGAntunes added a commit that referenced this issue Jan 20, 2021
* feat: initial work done to rely on new global config dir

* feat: add final functionality to the new global config spec

* chore: add comment to tests

* fix: typo in comment

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>

* fix: don't fail tests if there's no config to backup

* fix: make tests resilient to missing config directories

* fix: trolled by nodejs fs functions 🤦

* chore: don't delete legacy config and memoise globalConfig result

* chore: dropping lodash.once as per #1728 and using memoize-one

* chore: dropping lodash.once as per #1728 and using memoize-one

* fix: require memoizeOne 🤦

Co-authored-by: Eduardo Bouças <mail@eduardoboucas.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

No branches or pull requests

4 participants