Remove lodash dependency and replace its usage to built-in JavaScript methods #3653
Labels
dependencies
Pull requests that update a dependency file
good first issue
Good for newcomers
technical debt
If not paid, jeapardizes long-term success and maintainability of the repository.
Lodash is a popular JavaScript library that provides a collection of utility functions for working with arrays, objects, strings, and other data types. It is designed to simplify and enhance the process of writing JavaScript code by offering a rich set of utility functions that are performant and consistent across different environments.
OSD uses lodash, a library for the previous era of JS. For fewer dependencies, lesser memory usage, and faster execution, lodash should be abandoned in favor of native built-in methods. Native built-in JavaScript methods can be a better choice than using a utility library like Lodash. Modern JavaScript engines have improved performance for built-in methods, and browsers have implemented most of the ECMAScript features that make working with arrays, objects, and strings easier.
The first task to start this project is to do a research about where we use lodash
Goal for this task: Identify and list Lodash functions used in the project: Go through our codebase and create a list of all Lodash functions that are being used.
Based on the usage, we should make a proposal to replace lodash methods to native built-in JavaScript methods. For example,
Then based on the detailed locations and the proposal, continuously divide the implementation into smaller sub-tasks. For example, given a brief search, lodash is used in files like src/cli/cli.js, packages/opensearch-safer-lodash-set/fp/index.d.ts, packages/osd-ace/src/ace/modes/lexer_rules/x_json_highlight_rules.ts and etc. So a nature way to divide the big implementation is to make sub-tasks based on usage locations:
Of course, this is just one way to make sub-tasks. Feel free to propose different ways that you would like to divide the implementation work.
The text was updated successfully, but these errors were encountered: