Skip to content

Commit

Permalink
Removed lodash as an explicit dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlac committed Jul 20, 2023
1 parent f7f4e30 commit 289696d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 18 deletions.
1 change: 0 additions & 1 deletion example/package.json
Expand Up @@ -10,7 +10,6 @@
"reverse": "adb reverse tcp:8081 tcp:8081"
},
"dependencies": {
"lodash": "^4.17.20",
"react": "^18.2.0",
"react-native": "^0.71.0"
},
Expand Down
5 changes: 0 additions & 5 deletions example/yarn.lock
Expand Up @@ -2671,11 +2671,6 @@ lodash.throttle@^4.1.1:
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==

lodash@^4.17.20:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

log-symbols@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503"
Expand Down
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -24,14 +24,11 @@
"main": "dist/index.js",
"module": "dist/index.js",
"source": "./src/",
"dependencies": {
"lodash": "^4.14.2"
},
"dependencies": {},
"license": "MIT",
"devDependencies": {
"@react-native-community/eslint-config": "^2.0.0",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.165",
"@types/react": "^16.9.19",
"@types/react-native": "0.62.13",
"babel-jest": "22.4.1",
Expand Down
3 changes: 1 addition & 2 deletions src/Camera.android.tsx
@@ -1,5 +1,4 @@
import React from 'react';
import _cloneDeep from 'lodash/cloneDeep';
import { requireNativeComponent, findNodeHandle, NativeModules, processColor } from 'react-native';
import { CameraApi } from './types';
import { CameraProps } from './Camera';
Expand All @@ -24,7 +23,7 @@ const Camera = React.forwardRef((props: CameraProps, ref) => {
},
}));

const transformedProps: CameraProps = _cloneDeep(props);
const transformedProps: CameraProps = { ...props };
transformedProps.ratioOverlayColor = processColor(props.ratioOverlayColor);
transformedProps.frameColor = processColor(props.frameColor);
transformedProps.laserColor = processColor(props.laserColor);
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Expand Up @@ -1250,11 +1250,6 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/lodash@^4.14.165":
version "4.14.165"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.165.tgz#74d55d947452e2de0742bad65270433b63a8c30f"
integrity sha512-tjSSOTHhI5mCHTy/OOXYIhi2Wt1qcbHmuXD1Ha7q70CgI/I71afO4XtLb/cVexki1oVYchpul/TOuu3Arcdxrg==

"@types/node@*":
version "14.14.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.2.tgz#d25295f9e4ca5989a2c610754dc02a9721235eeb"
Expand Down Expand Up @@ -4911,7 +4906,7 @@ lodash.throttle@^4.1.1:
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=

lodash@^4.14.2, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.6.1:
lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.6.1:

This comment has been minimized.

Copy link
@Overtorment

Overtorment Jul 26, 2023

shouldnt lodash be completely deleted from the lock file..?

This comment has been minimized.

Copy link
@scarlac

scarlac Aug 3, 2023

Author Collaborator

No, unfortunately not:

$ yarn why lodash
yarn why v1.22.19
[1/4] 🤔  Why do we have the module "lodash"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "lodash@4.17.21"
info Reasons this module exists
   - "eslint" depends on it
   - Hoisted from "eslint#lodash"
   - Hoisted from "@react-native-community#eslint-config#eslint-plugin-flowtype#lodash"
   - Hoisted from "eslint#table#lodash"
   - Hoisted from "react-native#@react-native-community#cli-platform-android#lodash"
   - Hoisted from "react-native#@react-native-community#cli-platform-ios#lodash"
   - Hoisted from "react-native#@react-native-community#cli#lodash"
   - Hoisted from "istanbul-lib-instrument#@babel#core#lodash"
   - Hoisted from "eslint#@eslint#eslintrc#lodash"
   - Hoisted from "react-native#@react-native-community#cli-platform-android#@react-native-community#cli-tools#lodash"
   - Hoisted from "@react-native-community#eslint-config#@typescript-eslint#parser#@typescript-eslint#typescript-estree#lodash"
   - Hoisted from "metro-react-native-babel-preset#@babel#plugin-transform-classes#@babel#helper-define-map#lodash"
   - Hoisted from "istanbul-lib-instrument#@babel#core#@babel#helper-module-transforms#lodash"
   - Hoisted from "metro-react-native-babel-preset#@babel#plugin-transform-sticky-regex#@babel#helper-regex#lodash"
   - Hoisted from "react-native#metro-babel-register#@babel#register#lodash"
   - Hoisted from "react-native#metro-source-map#@babel#traverse#lodash"
   - Hoisted from "react-native#metro-source-map#@babel#types#lodash"
   - Hoisted from "react-native#@react-native-community#cli#inquirer#lodash"
   - Hoisted from "metro-react-native-babel-preset#react-transform-hmr#react-proxy#lodash"
   - Hoisted from "react-native#@react-native-community#cli#metro#async#lodash"
   - Hoisted from "babel-jest#babel-plugin-istanbul#istanbul-lib-instrument#babel-generator#lodash"
   - Hoisted from "babel-jest#babel-plugin-istanbul#istanbul-lib-instrument#babel-template#lodash"
   - Hoisted from "babel-jest#babel-plugin-istanbul#istanbul-lib-instrument#babel-traverse#lodash"
   - Hoisted from "babel-jest#babel-plugin-istanbul#istanbul-lib-instrument#babel-types#lodash"
   - Hoisted from "jest#@jest#core#jest-config#jest-environment-jsdom#jsdom#request-promise-native#request-promise-core#lodash"
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit 289696d

Please sign in to comment.