Skip to content

Commit 635faab

Browse files
chore: reduce bundle size by adapting material-icon imports
Reduce size of bundles by preferring path imports over named imports of React Material icons. Fixes #2350
1 parent c3cead7 commit 635faab

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

packages/material-renderers/src/additional/ListWithDetailMasterItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
ListItemText,
3434
Tooltip,
3535
} from '@mui/material';
36-
import { Delete as DeleteIcon } from '@mui/icons-material';
36+
import DeleteIcon from '@mui/icons-material/Delete';
3737
import React from 'react';
3838

3939
export const ListWithDetailMasterItem = ({

packages/material-renderers/src/complex/MaterialTableControl.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ import {
5757
encode,
5858
ArrayTranslations,
5959
} from '@jsonforms/core';
60-
import {
61-
Delete as DeleteIcon,
62-
ArrowDownward,
63-
ArrowUpward,
64-
} from '@mui/icons-material';
60+
import DeleteIcon from '@mui/icons-material/Delete';
61+
import ArrowDownward from '@mui/icons-material/ArrowDownward';
62+
import ArrowUpward from '@mui/icons-material/ArrowUpward';
6563

6664
import { WithDeleteDialogSupport } from './DeleteDialog';
6765
import NoBorderTableCell from './NoBorderTableCell';

packages/material-renderers/src/complex/TableToolbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
FormHelperText,
3939
Stack,
4040
} from '@mui/material';
41-
import { Add as AddIcon } from '@mui/icons-material';
41+
import AddIcon from '@mui/icons-material/Add';
4242
import ValidationIcon from './ValidationIcon';
4343
import NoBorderTableCell from './NoBorderTableCell';
4444

packages/material-renderers/src/complex/ValidationIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
import React from 'react';
2626

27-
import { ErrorOutline as ErrorOutlineIcon } from '@mui/icons-material';
27+
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
2828
import { Badge, Tooltip, styled } from '@mui/material';
2929

3030
const StyledBadge = styled(Badge)(({ theme }: any) => ({

packages/material-renderers/src/layouts/ExpandPanelRenderer.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ import {
4040
IconButton,
4141
Tooltip,
4242
} from '@mui/material';
43-
import {
44-
ExpandMore as ExpandMoreIcon,
45-
Delete as DeleteIcon,
46-
ArrowUpward,
47-
ArrowDownward,
48-
} from '@mui/icons-material';
43+
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
44+
import ArrowUpward from '@mui/icons-material/ArrowUpward';
45+
import ArrowDownward from '@mui/icons-material/ArrowDownward';
46+
import DeleteIcon from '@mui/icons-material/Delete';
4947

5048
const iconStyle: any = { float: 'right' };
5149

packages/material-renderers/src/mui-controls/MuiInputText.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
useTheme,
3333
} from '@mui/material';
3434
import merge from 'lodash/merge';
35-
import { Close } from '@mui/icons-material';
35+
import Close from '@mui/icons-material/Close';
3636
import {
3737
JsonFormsTheme,
3838
WithInputProps,

0 commit comments

Comments
 (0)