Skip to content

Commit 75985f1

Browse files
authored
Merge pull request #687 from glints-dev/feature/lodash-es
Migrate from lodash to lodash-es
2 parents 9278c28 + bffedd9 commit 75985f1

28 files changed

+63
-1061
lines changed
File renamed without changes.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"@types/async": "^3.2.0",
6767
"@types/body-scroll-lock": "^3.1.0",
6868
"@types/jest": "^27.4.1",
69-
"@types/lodash": "^4.14.149",
69+
"@types/lodash": "^4.14.188",
70+
"@types/lodash-es": "^4.17.6",
7071
"@types/node": "^12.12.7",
7172
"@types/react": "^17.0.37",
7273
"@types/react-dom": "^17.0.11",
@@ -100,7 +101,8 @@
100101
"identity-obj-proxy": "^3.0.0",
101102
"jest": "^27.5.1",
102103
"jest-styled-components": "^7.0.2",
103-
"lodash": "^4.17.15",
104+
"lodash": "^4.17.21",
105+
"lodash-es": "^4.17.21",
104106
"prettier": "1.18.2",
105107
"react": "^17.0.2",
106108
"react-dom": "^17.0.2",
@@ -126,6 +128,7 @@
126128
"styled-system": "^5.1.5"
127129
},
128130
"peerDependencies": {
131+
"lodash-es": "^4.0.0",
129132
"react": "^16.3.0 || ^17",
130133
"react-dom": "^16.3.0 || ^17",
131134
"styled-components": "^4.0.0 || ^5.0.0"
@@ -134,7 +137,10 @@
134137
"moduleNameMapper": {
135138
".+\\.(css|styl|less|sass|scss)$": "identity-obj-proxy",
136139
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/test/__mocks__/fileMock.js"
137-
}
140+
},
141+
"transformIgnorePatterns": [
142+
"node_modules/(?!lodash-es)"
143+
]
138144
},
139145
"optionalDependencies": {
140146
"@glints/poppins": "^1.0.2"

src/Display/Collapsible/Collapsible.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { HTMLAttributes, FC, useState, ReactNode } from 'react';
22
import classNames from 'classnames';
3-
import isUndefined from 'lodash/isUndefined';
3+
import { isUndefined } from 'lodash-es';
4+
45
import { ArrowDownIcon } from '../../General/Icon/components';
56

67
import {

src/Display/Modal/Modal.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
22
import { Story, Meta } from '@storybook/react';
3-
import { times, constant } from 'lodash';
3+
import { constant, times } from 'lodash-es';
44

55
import { Modal, Props } from './Modal';
66
import { Button } from '../../General/Button/Button';

src/Display/Modal/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import React, {
1010
ReactElement,
1111
} from 'react';
1212
import classNames from 'classnames';
13-
import debounce from 'lodash/debounce';
13+
import { debounce } from 'lodash-es';
1414
import {
1515
disableBodyScroll,
1616
enableBodyScroll,

src/Display/Slider/Slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom';
3-
import isNil from 'lodash/isNil';
3+
import { isNil } from 'lodash-es';
44

55
import classNames from 'classnames';
66

src/General/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22

33
import classNames from 'classnames';
4+
import isUndefined from 'lodash/isUndefined';
45

56
import {
67
CheckmarkSolidIcon,
@@ -16,7 +17,6 @@ import {
1617
} from './AlertStyle';
1718

1819
import { Greyscale, PrimaryColor, SecondaryColor } from '../../Utils/Colors';
19-
import { isUndefined } from 'lodash';
2020
import { DelayedUnmount } from '../../Utils/DelayedUnmount';
2121

2222
export const Alert = ({

src/General/Badge/Badge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import classNames from 'classnames';
3-
import isNil from 'lodash/isNil';
3+
import { isNil } from 'lodash-es';
44
import { BadgeContainer } from './BadgeStyle';
55
import { BadgeVariant } from './BadgeVariant';
66

src/General/Icon/IconStoriesHelpers.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { sampleSize } from 'lodash';
1+
import { sampleSize } from 'lodash-es';
22
import React, { useState, FC } from 'react';
33
import styled from 'styled-components';
4+
45
import TextField from '../../Input/TextField';
56
import { BaseContainer } from '../../Layout/GlintsContainer/GlintsContainer';
67
import { Greyscale } from '../../Utils/Colors';

src/General/Icon/LegacyIcon.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as React from 'react';
2-
import camelCase from 'lodash/camelCase';
3-
import upperFirst from 'lodash/upperFirst';
2+
import { camelCase, upperFirst } from 'lodash-es';
43

54
import { ICONS } from '../../Utils/Icon/IconLibrary';
65

0 commit comments

Comments
 (0)