Skip to content

Migrate from lodash to remeda(or std library functions)Β #1138

@dsauerbrun

Description

@dsauerbrun

This is a fantastic tool; however, my team is attempting to move off of lodash in the medium term which is causing some hesitation in using this given the peer dependency.

Reasoning:

Lodash was written in Javascript and types were added later. It does not always produce truthful types.

For example, get in lodash often types the return value as non-nullable even when a fallback value is not provided (and thus, the fallback value is undefined).

Another example is groupBy, the lodash version maps null and undefined keys to its own group. In contrast, remeda drops null/undefined keys which makes more sense considering the returned object says it has string keys.

Perusing the repo the lodash functions being used are throttle, debounce, clamp, flatten, uniq, range, isArray, noop, makeRange, groupBy, chunk. All of which could be easily replaced by the standard library EXCEPT for throttle and debounce.

If I have time soon I may take a crack at replacing lodash with std library functions or dropping in remeda as a replacement if I get the glide team's blessing!

Let me know your thoughts @lukasmasuch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions