question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace lodash with native where appropriate

See original GitHub issue

I noticed there are a lot of uses of lodash. I think where lodash shines is in avoiding reimplementation of functions like mapValues within the codebase. However there are a lot of places in the codebase where native functions like Array#map, Object.assign, and Array.from(new Set(...)) would be equally understandable, and without the added layer of a library function.

A borderline case is _.flat which can be replaced by Array#reduce.

How are we feeling about code coverage? Is it important to nudge up the coverage before making changes like this in library code?

Related: This is still marked as supporting Node 4 in package.json. The tests run on 6+, and @gr2m I’ve heard you say you’re just about ready to drop support for Node 6. Is there a roadmap or timeline in mind? I’m wondering if we can go right to object spread instead of using Object.assign.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
gr2mcommented, Dec 17, 2018

I’ll get this going 👍

1reaction
gr2mcommented, Jan 7, 2019

I have no strong feelings either way. I don’t mind replacing usage of lodash as long as it doesn’t make the code harder to read. The coverage is decent now thanks to the relentless effort by Paul 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

You Might Not Need Lodash
This method is like _.reduce except that it iterates over elements of collection from right to left. lodash. // https ...
Read more >
Pure JavaScript Functions as a Replacement for Lodash | by RC
A brief overview of pure replacement functions over Lodash/Underscore.js · What is functional programming anyway?
Read more >
Lodash in 2022: necessary or obsolete? - Nico Zerpa
This is a partial list of Lodash tasks that can now be replaced with vanilla JavaScript. If you use Lodash just for these...
Read more >
It's time to let go of lodash - JS.dev Community ‍
Lodash is one of those handful of libraries, that were created to solve a ... Replace lodash Array/Object helpers with native functions:.
Read more >
10 Lodash Features You Can Replace with ES6 - SitePoint
Dan Prince demonstrates ten ways you can use native ES6 features (such as arrow functions & collection methods) to replace Lodash in your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found