Skip to content

Commit ac1f700

Browse files
committed
Migrate to lodash-es
The Jest configuration is courtesy of https://stackoverflow.com/a/54117206/155423
1 parent f2d74a4 commit ac1f700

File tree

6 files changed

+25
-28
lines changed

6 files changed

+25
-28
lines changed

ui/frontend/.babelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
}],
1111
],
1212
"plugins": [
13-
"lodash",
1413
"@babel/proposal-class-properties",
1514
"@babel/proposal-object-rest-spread",
1615
"@babel/syntax-dynamic-import"

ui/frontend/configureStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { merge } from 'lodash';
1+
import { merge } from 'lodash-es';
22
import { applyMiddleware, compose, createStore } from 'redux';
33
import { useDispatch } from 'react-redux';
44
import thunk, { ThunkDispatch } from 'redux-thunk';

ui/frontend/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"core-js": "^3.1.3",
1111
"history": "^5.3.0",
1212
"isomorphic-fetch": "^3.0.0",
13-
"lodash": "^4.17.0",
13+
"lodash-es": "^4.17.21",
1414
"monaco-editor": "^0.34.1",
1515
"prismjs": "^1.6.0",
1616
"qs": "^6.4.0",
@@ -41,7 +41,7 @@
4141
"@types/common-tags": "^1.8.1",
4242
"@types/isomorphic-fetch": "^0.0.36",
4343
"@types/jest": "^29.2.5",
44-
"@types/lodash": "^4.14.118",
44+
"@types/lodash-es": "^4.17.6",
4545
"@types/prismjs": "^1.26.0",
4646
"@types/qs": "^6.9.7",
4747
"@types/react": "^18.0.26",
@@ -53,7 +53,6 @@
5353
"@typescript-eslint/parser": "^5.9.0",
5454
"autoprefixer": "^10.2.4",
5555
"babel-loader": "^9.1.2",
56-
"babel-plugin-lodash": "^3.3.4",
5756
"basename": "^0.1.2",
5857
"compression-webpack-plugin": "^10.0.0",
5958
"copy-webpack-plugin": "^11.0.0",
@@ -107,6 +106,9 @@
107106
"transform": {
108107
"^.+\\.tsx?$": "ts-jest"
109108
},
109+
"moduleNameMapper": {
110+
"^lodash-es$": "lodash"
111+
},
110112
"testRegex": "(\\.|/)(test|spec)\\.tsx?$",
111113
"moduleFileExtensions": [
112114
"ts",

ui/frontend/reducers/crates.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sortBy } from 'lodash';
1+
import { sortBy } from 'lodash-es';
22

33
import { Action, ActionType } from '../actions';
44
import { Crate } from '../types';

ui/frontend/uss-router/index.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-es';
22
import { createStore, Reducer, Store, Action, PreloadedState } from 'redux';
33
import { BrowserHistory, Location, Path } from 'history';
44
import { ThunkAction } from 'redux-thunk';

ui/frontend/yarn.lock

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
dependencies:
153153
"@babel/types" "^7.21.0"
154154

155-
"@babel/helper-module-imports@^7.0.0-beta.49", "@babel/helper-module-imports@^7.18.6":
155+
"@babel/helper-module-imports@^7.18.6":
156156
version "7.18.6"
157157
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e"
158158
integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==
@@ -979,7 +979,7 @@
979979
debug "^4.1.0"
980980
globals "^11.1.0"
981981

982-
"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
982+
"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
983983
version "7.21.2"
984984
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1"
985985
integrity sha512-3wRZSs7jiFaB8AjxiiD+VqN5DTG2iRvJGQ+qYFrs/654lg6kGTQWIOFjlBo5RaXuAZjBmP3+OQH4dmhqiiyYxw==
@@ -1469,7 +1469,14 @@
14691469
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
14701470
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==
14711471

1472-
"@types/lodash@^4.14.118":
1472+
"@types/lodash-es@^4.17.6":
1473+
version "4.17.6"
1474+
resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.6.tgz#c2ed4c8320ffa6f11b43eb89e9eaeec65966a0a0"
1475+
integrity sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==
1476+
dependencies:
1477+
"@types/lodash" "*"
1478+
1479+
"@types/lodash@*":
14731480
version "4.14.191"
14741481
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa"
14751482
integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ==
@@ -2046,17 +2053,6 @@ babel-plugin-jest-hoist@^29.5.0:
20462053
"@types/babel__core" "^7.1.14"
20472054
"@types/babel__traverse" "^7.0.6"
20482055

2049-
babel-plugin-lodash@^3.3.4:
2050-
version "3.3.4"
2051-
resolved "https://registry.yarnpkg.com/babel-plugin-lodash/-/babel-plugin-lodash-3.3.4.tgz#4f6844358a1340baed182adbeffa8df9967bc196"
2052-
integrity sha512-yDZLjK7TCkWl1gpBeBGmuaDIFhZKmkoL+Cu2MUUjv5VxUZx/z7tBGBCBcQs5RI1Bkz5LLmNdjx7paOyQtMovyg==
2053-
dependencies:
2054-
"@babel/helper-module-imports" "^7.0.0-beta.49"
2055-
"@babel/types" "^7.0.0-beta.49"
2056-
glob "^7.1.1"
2057-
lodash "^4.17.10"
2058-
require-package-name "^2.0.1"
2059-
20602056
babel-plugin-polyfill-corejs2@^0.3.3:
20612057
version "0.3.3"
20622058
resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122"
@@ -3193,7 +3189,7 @@ glob-to-regexp@^0.4.1:
31933189
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
31943190
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
31953191

3196-
glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
3192+
glob@^7.1.3, glob@^7.1.4, glob@^7.1.6:
31973193
version "7.2.3"
31983194
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
31993195
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
@@ -4304,6 +4300,11 @@ locate-path@^6.0.0:
43044300
dependencies:
43054301
p-locate "^5.0.0"
43064302

4303+
lodash-es@^4.17.21:
4304+
version "4.17.21"
4305+
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
4306+
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
4307+
43074308
lodash.camelcase@^4.3.0:
43084309
version "4.3.0"
43094310
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
@@ -4329,7 +4330,7 @@ lodash.truncate@^4.4.2:
43294330
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
43304331
integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==
43314332

4332-
lodash@^4.17.0, lodash@^4.17.10, lodash@^4.17.20, lodash@^4.17.21:
4333+
lodash@^4.17.20, lodash@^4.17.21:
43334334
version "4.17.21"
43344335
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
43354336
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -5289,11 +5290,6 @@ require-from-string@^2.0.2:
52895290
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
52905291
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
52915292

5292-
require-package-name@^2.0.1:
5293-
version "2.0.1"
5294-
resolved "https://registry.yarnpkg.com/require-package-name/-/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9"
5295-
integrity sha512-uuoJ1hU/k6M0779t3VMVIYpb2VMJk05cehCaABFhXaibcbvfgR8wKiozLjVFSzJPmQMRqIcO0HMyTFqfV09V6Q==
5296-
52975293
reselect@^4.0.0:
52985294
version "4.1.7"
52995295
resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.7.tgz#56480d9ff3d3188970ee2b76527bd94a95567a42"

0 commit comments

Comments
 (0)