-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Tracking]: Replace Lodash Usage with Native Functionality or Alternatives #28611
Comments
** Disclaimer** This information might be inaccurate, due to it being generated automatically Implementation Steps
Code References
Testing
References/code/lib/cli/src/automigrate/fixes/remove-jest-testing-library.test.ts
|
Hello, Which bundle exactly is it preferable to analyze? manager-bundle, common-manager-bundle or globals-runtime? Thank you. |
Can It possibly can replace |
es-toolkit could be considered as an alternative to lodash - https://github.com/toss/es-toolkit |
The biggest impact would be to get rid of lodash in Also feel free to contribute one PR at a time to remove/replace single occurrences of lodash calls. As soon as you open a PR, you will see some benchmark stats about bundle size. |
Would replacing |
Seems to be pretty interesting! @xeho91, @tanel-terras, @stolbikova do you have any experience or opinion about es-toolkit? |
I analyzed es-toolkit, and it seems it doesn't cover the following lodash functions (yet):
I think to split the work so that multiple contributors could contribute, we could do the following: Workstream: Introduce
|
Are there any set boundaries for maximum positive impact on the bundle size? Is very minimal package, And also, not 'polluted', 0 dependencies: https://npmgraph.js.org/?q=deepmerge-ts PR for preview: #28663 |
Honestly, no strong opinion. I definitely would favour this more over You already observed that it cannot replace all of the existing |
Hello! I'm the maintainer of Just a quick update to let you know that we've added several new functions to Please note that there are some differences between
In the meantime, if you need full compatibility with |
Hi @raon0211! |
Overview
In our efforts to optimize our monorepo's dependencies and improve bundle sizes, we are looking to replace our usage of Lodash with native JavaScript functionality or alternative libraries where applicable. This initiative is inspired by the recommendations found in You Don't Need Lodash/Underscore, which outlines many cases where modern JavaScript provides solutions that previously required utility libraries like Lodash.
Specific Lodash Functions in Use
From an initial audit, the following Lodash functions are currently in use across various packages in our monorepo:
lodash/camelCase
lodash/cloneDeep
lodash/countBy
lodash/debounce
lodash/isEqual
lodash/isPlainObject
lodash/kebabCase
lodash/mapKeys
lodash/mapValues
lodash/merge
lodash/mergeWith
lodash/pick
lodash/pickBy
lodash/startCase
lodash/throttle
lodash/uniq
lodash/upperFirst
Acceptance Criteria
To consider this work complete, the following criteria must be met:
import merge from 'lodash/merge'
) should be replaced across the monorepo.Potential Challenges
merge
andmergeWith
: These functions are used extensively for deep object merging. Identifying a suitable replacement that handles all edge cases might be challenging.lodash/throttle
function is used in performance-sensitive areas. Ensuring that the replacement maintains the same throttling behavior and performance characteristics is crucial.Request for Contributions
We are seeking contributions from the open source community to tackle this initiative. Contributions can range from identifying and documenting potential replacements, to implementing changes in specific packages. Please comment on this issue if you're able to take on a part of this work, specifying which packages or Lodash functions you're focusing on.
Thank you for your contributions to improving our monorepo's efficiency and maintainability!
The text was updated successfully, but these errors were encountered: