Skip to content

Commit b26d474

Browse files
sukvvonJanpot
andauthored
[code-infra] Migrate lodash to es-toolkit (#46974)
Signed-off-by: Wonsuk Choi <[email protected]> Co-authored-by: Jan Potoms <[email protected]>
1 parent 28eadba commit b26d474

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+96
-132
lines changed

docs/data/joy/getting-started/templates/TemplateCollection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import startCase from 'lodash/startCase';
2+
import { startCase } from 'es-toolkit/string';
33
import NextLink from 'next/link';
44
import AspectRatio from '@mui/joy/AspectRatio';
55
import Box from '@mui/joy/Box';

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"cross-env": "^10.0.0",
6666
"css-mediaquery": "^0.1.2",
6767
"dayjs": "^1.11.18",
68+
"es-toolkit": "^1.39.10",
6869
"feed": "^5.1.0",
6970
"fg-loadcss": "^3.1.0",
7071
"final-form": "^5.0.0",
@@ -73,7 +74,6 @@
7374
"jss": "^10.10.0",
7475
"jss-plugin-template": "^10.10.0",
7576
"jss-rtl": "^0.3.0",
76-
"lodash": "^4.17.21",
7777
"lz-string": "^1.5.0",
7878
"markdown-to-jsx": "^7.7.13",
7979
"material-ui-popup-state": "^5.3.6",

docs/pages/versions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import sortedUniqBy from 'lodash/sortedUniqBy';
2+
import { uniqBy } from 'es-toolkit/array';
33
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
44
import VersionsContext from 'docs/src/pages/versions/VersionsContext';
55
import * as pageProps from 'docs/src/pages/versions/versions.md?muiMarkdown';
@@ -76,5 +76,5 @@ Page.getInitialProps = async () => {
7676
});
7777
}
7878

79-
return { versions: sortedUniqBy(versions, 'version') };
79+
return { versions: uniqBy(versions, (item) => item.version) };
8080
};

docs/src/modules/components/ApiPage/definitions/classes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PropsTranslations, ComponentApiContent } from '@mui-internal/api-docs-builder';
22
import { Translate } from '@mui/docs/i18n';
3-
import kebabCase from 'lodash/kebabCase';
3+
import { kebabCase } from 'es-toolkit/string';
44
import type { TableOfContentsParams } from 'docs/src/modules/components/ApiPage';
55

66
export interface ClassDefinition {

docs/src/modules/components/ApiPage/definitions/properties.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
HooksTranslations,
66
} from '@mui-internal/api-docs-builder';
77
import { Translate } from '@mui/docs/i18n';
8-
import kebabCase from 'lodash/kebabCase';
8+
import { kebabCase } from 'es-toolkit/string';
99
import type { TableOfContentsParams } from 'docs/src/modules/components/ApiPage';
1010

1111
export interface PropertyDefinition {

docs/src/modules/components/ApiPage/sections/ClassesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
getClassApiDefinitions,
1515
} from 'docs/src/modules/components/ApiPage/definitions/classes';
1616
import { PropsTranslations, ComponentClassDefinition } from '@mui-internal/api-docs-builder';
17-
import kebabCase from 'lodash/kebabCase';
17+
import { kebabCase } from 'es-toolkit/string';
1818

1919
export type GetCssToCParams = {
2020
componentName: string;

docs/src/modules/components/ApiPage/sections/PropertiesSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
PropsTableItem,
2020
PropsTranslations,
2121
} from '@mui-internal/api-docs-builder';
22-
import kebabCase from 'lodash/kebabCase';
22+
import { kebabCase } from 'es-toolkit/string';
2323

2424
interface GetPropsToCParams extends Pick<ComponentApiContent, 'inheritance' | 'themeDefaultProps'> {
2525
componentProps: ComponentApiContent['props'];

docs/src/modules/components/AppTableOfContents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable react/no-danger */
22
import * as React from 'react';
33
import PropTypes from 'prop-types';
4-
import throttle from 'lodash/throttle';
4+
import { throttle } from 'es-toolkit/function';
55
import { styled, alpha } from '@mui/material/styles';
66
import Typography from '@mui/material/Typography';
77
import NoSsr from '@mui/material/NoSsr';

docs/src/modules/components/ComponentsApiContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable react/no-danger */
22
import * as React from 'react';
33
import PropTypes from 'prop-types';
4-
import kebabCase from 'lodash/kebabCase';
4+
import { kebabCase } from 'es-toolkit/string';
55
import { useRouter } from 'next/router';
66
import exactProp from '@mui/utils/exactProp';
77
import { Translate, useTranslate, useUserLanguage } from '@mui/docs/i18n';

docs/src/modules/components/HooksApiContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable react/no-danger */
22
import * as React from 'react';
33
import PropTypes from 'prop-types';
4-
import kebabCase from 'lodash/kebabCase';
4+
import { kebabCase } from 'es-toolkit/string';
55
import exactProp from '@mui/utils/exactProp';
66
import { Translate, useTranslate, useUserLanguage } from '@mui/docs/i18n';
77
import { SectionTitle, SectionTitleProps } from '@mui/docs/SectionTitle';

0 commit comments

Comments
 (0)