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
Remove remaining lodash
dependencies
#13139
Changes from 2 commits
8533aa3
39dcd74
62560f4
f46e3e7
2c73185
dc0b4bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import last from "lodash/last" | ||
import last from "lo-dash/last" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just an input/output fixture, but it was annoying when grepping for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol we want to ctrl+f and find no results |
||
|
||
export default class Container { | ||
last(key) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import deepClone from "lodash/cloneDeep"; | ||
import cloneDeep from "clone-deep"; | ||
import sourceMapSupport from "source-map-support"; | ||
import * as registerCache from "./cache"; | ||
import * as babel from "@babel/core"; | ||
|
@@ -42,7 +42,7 @@ function compile(code, filename) { | |
// sourceRoot can be overwritten | ||
{ | ||
sourceRoot: path.dirname(filename) + path.sep, | ||
...deepClone(transformOpts), | ||
...cloneDeep(transformOpts), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And the reason we probably want to keep this is because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, also people can pass any JS value as plugin options. |
||
filename, | ||
}, | ||
); | ||
|
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.
clone-deep is quite bloated package. Maybe try klona?
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.
My strategy for choosing the
clone-deep
package was "Ctrl+F forclone
in ouryarn.lock
file", so thanks for suggesting an alternative 😂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.
Oh it looks like
klona
requires Node.js >= 8, so until the Babel 8 release we cannot use it.