Skip to content

Commit 9b56f93

Browse files
committed
fix: remove implicit dependency on lodash
Despite not being specified as a dependency in the `package.json` file, we were still using `lodash` in `useVersion.ts`. To address this, we add an explicit dependency on `lodash.isequal`, which is the only function from `lodash` we need.
1 parent 4bd908b commit 9b56f93

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"type": "git",
2020
"url": "https://github.com/getditto/react-ditto.git"
2121
},
22+
"dependencies": {
23+
"lodash.isequal": "^4.5.0"
24+
},
2225
"peerDependencies": {
2326
"@dittolive/ditto": "^4.0.0",
2427
"react": ">=16.0.0",
@@ -29,6 +32,7 @@
2932
"@testing-library/react": "^13.0.1",
3033
"@types/chai": "^4.2.21",
3134
"@types/lodash": "^4.14.172",
35+
"@types/lodash.isequal": "^4.5.6",
3236
"@types/mocha": "^10.0.0",
3337
"@types/react": "^18.0.5",
3438
"@types/react-dom": "^18.0.0",

src/queries/useVersion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isEqual } from 'lodash'
1+
import isEqual from 'lodash.isequal'
22
import { useEffect, useRef, useState } from 'react'
33

44
/**

yarn.lock

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,17 @@
11201120
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
11211121
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
11221122

1123-
"@types/lodash@^4.14.172":
1124-
version "4.14.173"
1125-
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.173.tgz#9d3b674c67a26cf673756f6aca7b429f237f91ed"
1126-
integrity sha512-vv0CAYoaEjCw/mLy96GBTnRoZrSxkGE0BKzKimdR8P3OzrNYNvBgtW7p055A+E8C31vXNUhWKoFCbhq7gbyhFg==
1123+
"@types/lodash.isequal@^4.5.6":
1124+
version "4.5.6"
1125+
resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.6.tgz#ff42a1b8e20caa59a97e446a77dc57db923bc02b"
1126+
integrity sha512-Ww4UGSe3DmtvLLJm2F16hDwEQSv7U0Rr8SujLUA2wHI2D2dm8kPu6Et+/y303LfjTIwSBKXB/YTUcAKpem/XEg==
1127+
dependencies:
1128+
"@types/lodash" "*"
1129+
1130+
"@types/lodash@*", "@types/lodash@^4.14.172":
1131+
version "4.14.195"
1132+
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632"
1133+
integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==
11271134

11281135
"@types/mocha@^10.0.0":
11291136
version "10.0.0"
@@ -4040,6 +4047,11 @@ lodash.get@^4.4.2:
40404047
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
40414048
integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==
40424049

4050+
lodash.isequal@^4.5.0:
4051+
version "4.5.0"
4052+
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
4053+
integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==
4054+
40434055
lodash.memoize@~3.0.3:
40444056
version "3.0.4"
40454057
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f"

0 commit comments

Comments
 (0)