-
- Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: replace lodash with es-toolkit #6502
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
Conversation
48d65da to ae055a0 Compare | Some of our dependencies are using |
1d28dc6 to 461da26 Compare f012bde to d6e415c Compare | Valid point, but it seems like not too many dependencies are in fact using lodash. It should be relatively easy to clean this whole tree up. In the meantime, this draft PR is in itself ready to go I believe. :) |
| Well, this PR DOES make Yarn smaller by a bit: Before: 2.63 MiB I believe that's because while other dependencies 1% improvement is not much but it certainly adds up 🤷 I also see a potential of shaving off further 2 KB, but I'd rather do it in small stages. |
5e7959c to 4809f3a Compare
Because I patched it to do that, in the future we could change that patch to use |
merceyz left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry for lodash and @types/lodash here:
Line 211 in d5431bd
| forbidDependency(ctx, `inquirer`, `Don't depend on inquirer - we use enquirer instead`); |
023df68 to 113c226 Compare | I couldn't forbid @types/lodash because it appears to be deeply rooted inside pkg-tests-specs, but lodash alone was fine :) |
| Update: the latest version of ink, our dependency, also switched from lodash to es-toolkit, making this PR more welcome than before, IMO. I'll work in getting my work rebased. |
| I think @wojtekmaj had addressed all the review comments—any reason the review isn’t proceeding? Also, since some time has passed, I think it would be good to update the |
| I can re-review if you can fix the conflicts first! |
| @RDIL Done! :) BTW, this PR still does its job, still decreases binary size. Before: 2.86 MiB After: 2.84 MiB
|
es-toolkit is a modern lodash alternative that claims to be much faster and lighter, potentially improving Yarn overall performance: https://es-toolkit.slash.page/intro.html
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
RDIL left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| @RDIL thank you!! Are we waiting on one more review to merge this? Not sure if it's a stale request or not ❤️ |
## What's the problem this PR addresses? es-toolkit is a modern lodash alternative that claims to be much faster and lighter, potentially improving Yarn overall performance: https://es-toolkit.slash.page/intro.html ## How did you fix it? The lazy way, frankly: using es-toolkit/compat to provide practically drop-in lodash replacement with minimal effort. ## Checklist <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed. --------- Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

What's the problem this PR addresses?
es-toolkit is a modern lodash alternative that claims to be much faster and lighter, potentially improving Yarn overall performance: https://es-toolkit.slash.page/intro.html
How did you fix it?
The lazy way, frankly: using es-toolkit/compat to provide practically drop-in lodash replacement with minimal effort.
Checklist