-descendingComparator(a, b, orderBy);
}
-// Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
-// stableSort() brings sort stability to non-modern browsers (notably IE11). If you
-// only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
-// with exampleArray.slice().sort(exampleComparator)
-function stableSort(array, comparator) {
- const stabilizedThis = array.map((el, index) => [el, index]);
- stabilizedThis.sort((a, b) => {
- const order = comparator(a[0], b[0]);
- if (order !== 0) {
- return order;
- }
- return a[1] - b[1];
- });
- return stabilizedThis.map((el) => el[0]);
-}
-
const headCells = [
{
id: 'name',
@@ -288,10 +272,9 @@ export default function EnhancedTable() {
const visibleRows = React.useMemo(
() =>
- stableSort(rows, getComparator(order, orderBy)).slice(
- page * rowsPerPage,
- page * rowsPerPage + rowsPerPage,
- ),
+ [...rows]
+ .sort(getComparator(order, orderBy))
+ .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage),
[order, orderBy, page, rowsPerPage],
);
diff --git a/docs/data/material/components/table/EnhancedTable.tsx b/docs/data/material/components/table/EnhancedTable.tsx
index d1fd663dc821cc..23d1f23a1c19d2 100644
--- a/docs/data/material/components/table/EnhancedTable.tsx
+++ b/docs/data/material/components/table/EnhancedTable.tsx
@@ -88,22 +88,6 @@ function getComparator(
: (a, b) => -descendingComparator(a, b, orderBy);
}
-// Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
-// stableSort() brings sort stability to non-modern browsers (notably IE11). If you
-// only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
-// with exampleArray.slice().sort(exampleComparator)
-function stableSort(array: readonly T[], comparator: (a: T, b: T) => number) {
- const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
- stabilizedThis.sort((a, b) => {
- const order = comparator(a[0], b[0]);
- if (order !== 0) {
- return order;
- }
- return a[1] - b[1];
- });
- return stabilizedThis.map((el) => el[0]);
-}
-
interface HeadCell {
disablePadding: boolean;
id: keyof Data;
@@ -320,10 +304,9 @@ export default function EnhancedTable() {
const visibleRows = React.useMemo(
() =>
- stableSort(rows, getComparator(order, orderBy)).slice(
- page * rowsPerPage,
- page * rowsPerPage + rowsPerPage,
- ),
+ [...rows]
+ .sort(getComparator(order, orderBy))
+ .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage),
[order, orderBy, page, rowsPerPage],
);
diff --git a/docs/package.json b/docs/package.json
index 315a51a02a861e..f8ea8e340c9db7 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -20,7 +20,6 @@
},
"dependencies": {
"@babel/core": "^7.24.4",
- "@babel/plugin-transform-object-assign": "^7.24.1",
"@babel/runtime": "^7.24.4",
"@babel/runtime-corejs2": "^7.24.4",
"@docsearch/react": "^3.6.0",
diff --git a/docs/src/components/showcase/FolderTable.tsx b/docs/src/components/showcase/FolderTable.tsx
index bd1694b4c40633..05de2315028999 100644
--- a/docs/src/components/showcase/FolderTable.tsx
+++ b/docs/src/components/showcase/FolderTable.tsx
@@ -45,22 +45,6 @@ function getComparator(
: (a, b) => -descendingComparator(a, b, orderBy);
}
-// Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
-// stableSort() brings sort stability to non-modern browsers (notably IE11). If you
-// only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
-// with exampleArray.slice().sort(exampleComparator)
-function stableSort(array: readonly T[], comparator: (a: T, b: T) => number) {
- const stabilizedThis = array.map((el, index) => [el, index] as [T, number]);
- stabilizedThis.sort((a, b) => {
- const order = comparator(a[0], b[0]);
- if (order !== 0) {
- return order;
- }
- return a[1] - b[1];
- });
- return stabilizedThis.map((el) => el[0]);
-}
-
function formatSize(size: number) {
const kb = size / 1000;
if (kb < 1000) {
@@ -138,7 +122,7 @@ export default function BasicTable() {
- {stableSort(data, getComparator(order, orderBy)).map((row) => (
+ {[...data].sort(getComparator(order, orderBy)).map((row) => (
diff --git a/docs/src/modules/components/MaterialShowcase.js b/docs/src/modules/components/MaterialShowcase.js
index fe4db5bf344f9b..df36890c140347 100644
--- a/docs/src/modules/components/MaterialShowcase.js
+++ b/docs/src/modules/components/MaterialShowcase.js
@@ -438,18 +438,6 @@ const appList = [
},
];
-function stableSort(array, cmp) {
- const stabilizedThis = array.map((el, index) => [el, index]);
- stabilizedThis.sort((a, b) => {
- const order = cmp(a[0], b[0]);
- if (order !== 0) {
- return order;
- }
- return a[1] - b[1];
- });
- return stabilizedThis.map((el) => el[0]);
-}
-
// Returns a function that sorts reverse numerically by value of `key`
function sortFactory(key) {
return function sortNumeric(a, b) {
@@ -498,96 +486,100 @@ export default function Showcase() {
- {stableSort(
- appList.filter((item) => item[sortFunctionName] !== undefined),
- sortFunction,
- ).map((app) => (
-
- {app.image ? (
- ({
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- p: 2,
- gap: 2,
- borderRadius: 1,
- backgroundColor: `${alpha(theme.palette.grey[50], 0.3)}`,
- borderColor: 'divider',
- ...theme.applyDarkStyles({
- backgroundColor: `${alpha(theme.palette.primaryDark[700], 0.2)}`,
+ {appList
+ .filter((item) => item[sortFunctionName] !== undefined)
+ .sort(sortFunction)
+ .map((app) => (
+
+ {app.image ? (
+ ({
+ height: '100%',
+ display: 'flex',
+ flexDirection: 'column',
+ p: 2,
+ gap: 2,
+ borderRadius: 1,
+ backgroundColor: `${alpha(theme.palette.grey[50], 0.3)}`,
borderColor: 'divider',
- }),
- })}
- >
-
- ({
- height: 'auto',
- borderRadius: '6px',
- bgcolor: 'currentColor',
- border: '1px solid',
+ ...theme.applyDarkStyles({
+ backgroundColor: `${alpha(theme.palette.primaryDark[700], 0.2)}`,
borderColor: 'divider',
- color: 'grey.100',
- ...theme.applyDarkStyles({
- color: 'primaryDark.900',
- }),
- })}
- />
-
-
-
- {app.title}
- {app.source ? (
-
-
-
- ) : null}
-
-
- {app.description}
-
-
-
- {app.dateAdded}
-
-
-
- ) : (
-
- {t('visit')}
-
- )}
-
- ))}
+ }),
+ })}
+ >
+
+ ({
+ height: 'auto',
+ borderRadius: '6px',
+ bgcolor: 'currentColor',
+ border: '1px solid',
+ borderColor: 'divider',
+ color: 'grey.100',
+ ...theme.applyDarkStyles({
+ color: 'primaryDark.900',
+ }),
+ })}
+ />
+
+
+
+ {app.title}
+ {app.source ? (
+
+
+
+ ) : null}
+
+
+ {app.description}
+
+
+
+ {app.dateAdded}
+
+
+
+ ) : (
+
+ {t('visit')}
+
+ )}
+
+ ))}
);
diff --git a/package.json b/package.json
index 64b729f294cc42..59cea49e5b3b83 100644
--- a/package.json
+++ b/package.json
@@ -98,7 +98,6 @@
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
- "@babel/plugin-transform-object-assign": "^7.24.1",
"@babel/plugin-transform-react-constant-elements": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.4",
diff --git a/packages/mui-base/package.json b/packages/mui-base/package.json
index 08c4b94bcca7f6..a103c186421a98 100644
--- a/packages/mui-base/package.json
+++ b/packages/mui-base/package.json
@@ -27,8 +27,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-base/src/useAutocomplete/useAutocomplete.js b/packages/mui-base/src/useAutocomplete/useAutocomplete.js
index 344b2cce0efe0f..45caa7dd2123dc 100644
--- a/packages/mui-base/src/useAutocomplete/useAutocomplete.js
+++ b/packages/mui-base/src/useAutocomplete/useAutocomplete.js
@@ -10,11 +10,8 @@ import {
} from '@mui/utils';
// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
-// Give up on IE11 support for this feature
function stripDiacritics(string) {
- return typeof string.normalize !== 'undefined'
- ? string.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
- : string;
+ return string.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
}
export function createFilterOptions(config = {}) {
@@ -56,17 +53,6 @@ export function createFilterOptions(config = {}) {
};
}
-// To replace with .findIndex() once we stop IE11 support.
-function findIndex(array, comp) {
- for (let i = 0; i < array.length; i += 1) {
- if (comp(array[i])) {
- return i;
- }
- }
-
- return -1;
-}
-
const defaultFilterOptions = createFilterOptions();
// Number of options to jump in list box when `Page Up` and `Page Down` keys are used.
@@ -498,7 +484,7 @@ export function useAutocomplete(props) {
const previousHighlightedOption = previousProps.filteredOptions[highlightedIndexRef.current];
if (previousHighlightedOption) {
- return findIndex(filteredOptions, (option) => {
+ return filteredOptions.findIndex((option) => {
return getOptionLabel(option) === getOptionLabel(previousHighlightedOption);
});
}
@@ -539,12 +525,12 @@ export function useAutocomplete(props) {
if (
multiple &&
currentOption &&
- findIndex(value, (val) => isOptionEqualToValue(currentOption, val)) !== -1
+ value.findIndex((val) => isOptionEqualToValue(currentOption, val)) !== -1
) {
return;
}
- const itemIndex = findIndex(filteredOptions, (optionItem) =>
+ const itemIndex = filteredOptions.findIndex((optionItem) =>
isOptionEqualToValue(optionItem, valueItem),
);
if (itemIndex === -1) {
@@ -685,7 +671,7 @@ export function useAutocomplete(props) {
}
}
- const itemIndex = findIndex(newValue, (valueItem) => isOptionEqualToValue(option, valueItem));
+ const itemIndex = newValue.findIndex((valueItem) => isOptionEqualToValue(option, valueItem));
if (itemIndex === -1) {
newValue.push(option);
diff --git a/packages/mui-base/src/useSnackbar/useSnackbar.ts b/packages/mui-base/src/useSnackbar/useSnackbar.ts
index d2d73cf641af1f..4b9de6ad0754bb 100644
--- a/packages/mui-base/src/useSnackbar/useSnackbar.ts
+++ b/packages/mui-base/src/useSnackbar/useSnackbar.ts
@@ -44,8 +44,7 @@ export function useSnackbar(parameters: UseSnackbarParameters = {}): UseSnackbar
*/
function handleKeyDown(nativeEvent: KeyboardEvent) {
if (!nativeEvent.defaultPrevented) {
- // IE11, Edge (prior to using Blink?) use 'Esc'
- if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
+ if (nativeEvent.key === 'Escape') {
// not calling `preventDefault` since we don't know if people may ignore this event e.g. a permanently open snackbar
onClose?.(nativeEvent, 'escapeKeyDown');
}
diff --git a/packages/mui-docs/package.json b/packages/mui-docs/package.json
index 54f3b4c83f9a47..e14f324d5f1f68 100644
--- a/packages/mui-docs/package.json
+++ b/packages/mui-docs/package.json
@@ -23,8 +23,7 @@
},
"homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-docs",
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "echo 'Skip modern build'",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-icons-material/package.json b/packages/mui-icons-material/package.json
index b5e4c824365edd..400fd38cd3eac0 100644
--- a/packages/mui-icons-material/package.json
+++ b/packages/mui-icons-material/package.json
@@ -31,7 +31,6 @@
"build": "shx cp -r lib/ build/ && pnpm build:typings && pnpm build:copy-files",
"build:lib": "pnpm build:node && pnpm build:stable",
"build:lib:clean": "rimraf lib/ && pnpm build:lib",
- "build:legacy": "echo 'Skip legacy build'",
"build:modern": "echo 'Skip modern build'",
"build:node": "node ../../scripts/build.mjs node --largeFiles --outDir lib",
"build:stable": "node ../../scripts/build.mjs stable --largeFiles --outDir lib",
diff --git a/packages/mui-joy/src/Avatar/Avatar.tsx b/packages/mui-joy/src/Avatar/Avatar.tsx
index 7a355e56a0499a..5f8379b0b0915e 100644
--- a/packages/mui-joy/src/Avatar/Avatar.tsx
+++ b/packages/mui-joy/src/Avatar/Avatar.tsx
@@ -76,7 +76,7 @@ const AvatarImg = styled('img', {
width: '100%',
height: '100%',
textAlign: 'center',
- // Handle non-square image. The property isn't supported by IE11.
+ // Handle non-square image.
objectFit: 'cover',
// Hide alt text.
color: 'transparent',
diff --git a/packages/mui-joy/src/Tooltip/Tooltip.tsx b/packages/mui-joy/src/Tooltip/Tooltip.tsx
index 531d3a8b288c1b..22c560f0ecf439 100644
--- a/packages/mui-joy/src/Tooltip/Tooltip.tsx
+++ b/packages/mui-joy/src/Tooltip/Tooltip.tsx
@@ -409,8 +409,7 @@ const Tooltip = React.forwardRef(function Tooltip(inProps, ref) {
}
function handleKeyDown(nativeEvent: KeyboardEvent) {
- // IE11, Edge (prior to using Bink?) use 'Esc'
- if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
+ if (nativeEvent.key === 'Escape') {
handleClose(nativeEvent);
}
}
diff --git a/packages/mui-lab/package.json b/packages/mui-lab/package.json
index 4ba2dab61dbfaf..7ece96ab00c402 100644
--- a/packages/mui-lab/package.json
+++ b/packages/mui-lab/package.json
@@ -28,8 +28,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-material-nextjs/package.json b/packages/mui-material-nextjs/package.json
index 6f916e47fe5983..431d6d7ebcd00f 100644
--- a/packages/mui-material-nextjs/package.json
+++ b/packages/mui-material-nextjs/package.json
@@ -24,8 +24,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-material/package.json b/packages/mui-material/package.json
index f886dbe530351e..1ecf951109b362 100644
--- a/packages/mui-material/package.json
+++ b/packages/mui-material/package.json
@@ -27,8 +27,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:umd && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:umd && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-material/src/AppBar/AppBar.js b/packages/mui-material/src/AppBar/AppBar.js
index ddc0befd8e9286..2d85cb28fb18e0 100644
--- a/packages/mui-material/src/AppBar/AppBar.js
+++ b/packages/mui-material/src/AppBar/AppBar.js
@@ -70,7 +70,6 @@ const AppBarRoot = styled(Paper, {
{
props: { position: 'sticky' },
style: {
- // ⚠️ sticky is not supported by IE11.
position: 'sticky',
zIndex: (theme.vars || theme).zIndex.appBar,
top: 0,
diff --git a/packages/mui-material/src/Avatar/Avatar.js b/packages/mui-material/src/Avatar/Avatar.js
index a4aea78bd739ca..051e9d0c7339fc 100644
--- a/packages/mui-material/src/Avatar/Avatar.js
+++ b/packages/mui-material/src/Avatar/Avatar.js
@@ -86,7 +86,7 @@ const AvatarImg = styled('img', {
width: '100%',
height: '100%',
textAlign: 'center',
- // Handle non-square image. The property isn't supported by IE11.
+ // Handle non-square image.
objectFit: 'cover',
// Hide alt text.
color: 'transparent',
diff --git a/packages/mui-material/src/CardMedia/CardMedia.js b/packages/mui-material/src/CardMedia/CardMedia.js
index a721e873db1b42..94d3746941c149 100644
--- a/packages/mui-material/src/CardMedia/CardMedia.js
+++ b/packages/mui-material/src/CardMedia/CardMedia.js
@@ -43,7 +43,6 @@ const CardMediaRoot = styled('div', {
{
props: { isImageComponent: true },
style: {
- // ⚠️ object-fit is not supported by IE11.
objectFit: 'cover',
},
},
diff --git a/packages/mui-material/src/Tooltip/Tooltip.js b/packages/mui-material/src/Tooltip/Tooltip.js
index 05cea653d79888..dc71ddee0481ff 100644
--- a/packages/mui-material/src/Tooltip/Tooltip.js
+++ b/packages/mui-material/src/Tooltip/Tooltip.js
@@ -473,8 +473,7 @@ const Tooltip = React.forwardRef(function Tooltip(inProps, ref) {
* @param {KeyboardEvent} nativeEvent
*/
function handleKeyDown(nativeEvent) {
- // IE11, Edge (prior to using Bink?) use 'Esc'
- if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {
+ if (nativeEvent.key === 'Escape') {
handleClose(nativeEvent);
}
}
diff --git a/packages/mui-material/src/styles/createTransitions.js b/packages/mui-material/src/styles/createTransitions.js
index a98b2c2357458e..9f92f9f2d8c4df 100644
--- a/packages/mui-material/src/styles/createTransitions.js
+++ b/packages/mui-material/src/styles/createTransitions.js
@@ -64,9 +64,7 @@ export default function createTransitions(inputTransitions) {
if (process.env.NODE_ENV !== 'production') {
const isString = (value) => typeof value === 'string';
- // IE11 support, replace with Number.isNaN
- // eslint-disable-next-line no-restricted-globals
- const isNumber = (value) => !isNaN(parseFloat(value));
+ const isNumber = (value) => !Number.isNaN(parseFloat(value));
if (!isString(props) && !Array.isArray(props)) {
console.error('MUI: Argument "props" must be a string or Array.');
}
diff --git a/packages/mui-material/src/styles/createTransitions.test.js b/packages/mui-material/src/styles/createTransitions.test.js
index 627186dd0b23e1..1c942fb5a01917 100644
--- a/packages/mui-material/src/styles/createTransitions.test.js
+++ b/packages/mui-material/src/styles/createTransitions.test.js
@@ -130,14 +130,11 @@ describe('createTransitions', () => {
it('should return NaN when passed a negative number', () => {
const zeroHeightDurationNegativeOne = getAutoHeightDuration(-1);
- // eslint-disable-next-line no-restricted-globals
- expect(isNaN(zeroHeightDurationNegativeOne)).to.equal(true);
+ expect(Number.isNaN(zeroHeightDurationNegativeOne)).to.equal(true);
const zeroHeightDurationSmallNegative = getAutoHeightDuration(-0.000001);
- // eslint-disable-next-line no-restricted-globals
- expect(isNaN(zeroHeightDurationSmallNegative)).to.equal(true);
+ expect(Number.isNaN(zeroHeightDurationSmallNegative)).to.equal(true);
const zeroHeightDurationBigNegative = getAutoHeightDuration(-100000);
- // eslint-disable-next-line no-restricted-globals
- expect(isNaN(zeroHeightDurationBigNegative)).to.equal(true);
+ expect(Number.isNaN(zeroHeightDurationBigNegative)).to.equal(true);
});
it('should return values for pre-calculated positive examples', () => {
diff --git a/packages/mui-private-theming/package.json b/packages/mui-private-theming/package.json
index 7bf488f86cb475..ca0d18f414dc61 100644
--- a/packages/mui-private-theming/package.json
+++ b/packages/mui-private-theming/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-styled-engine-sc/package.json b/packages/mui-styled-engine-sc/package.json
index 5e850007c2b664..1bb4803094fda9 100644
--- a/packages/mui-styled-engine-sc/package.json
+++ b/packages/mui-styled-engine-sc/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-styled-engine/package.json b/packages/mui-styled-engine/package.json
index 3f8e17d2c0f092..1a2011c08ee988 100644
--- a/packages/mui-styled-engine/package.json
+++ b/packages/mui-styled-engine/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-styles/package.json b/packages/mui-styles/package.json
index 25fb2d11243519..536f10b7f061b5 100644
--- a/packages/mui-styles/package.json
+++ b/packages/mui-styles/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-system/package.json b/packages/mui-system/package.json
index 7a6bb48a0104fe..27574e925f0c52 100644
--- a/packages/mui-system/package.json
+++ b/packages/mui-system/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-utils/package.json b/packages/mui-utils/package.json
index 2675ce2917f370..0d9ab28df85b84 100644
--- a/packages/mui-utils/package.json
+++ b/packages/mui-utils/package.json
@@ -26,8 +26,7 @@
"url": "https://opencollective.com/mui-org"
},
"scripts": {
- "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
- "build:legacy": "node ../../scripts/build.mjs legacy",
+ "build": "pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
"build:modern": "node ../../scripts/build.mjs modern",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
diff --git a/packages/mui-utils/src/getDisplayName/getDisplayName.test.tsx b/packages/mui-utils/src/getDisplayName/getDisplayName.test.tsx
index 4d30daac79c0fe..6d2aba0f362085 100644
--- a/packages/mui-utils/src/getDisplayName/getDisplayName.test.tsx
+++ b/packages/mui-utils/src/getDisplayName/getDisplayName.test.tsx
@@ -1,7 +1,7 @@
/* eslint-disable react/prefer-stateless-function */
import * as React from 'react';
import { expect } from 'chai';
-import getDisplayName, { getFunctionName } from './getDisplayName';
+import getDisplayName from './getDisplayName';
describe('utils/getDisplayName.js', () => {
describe('getDisplayName', () => {
@@ -75,14 +75,4 @@ describe('utils/getDisplayName.js', () => {
expect(getDisplayName(false)).to.equal(undefined);
});
});
-
- describe('getFunctionName', () => {
- it('gets the name of a function', () => {
- function SomeFunction() {
- return ;
- }
-
- expect(getFunctionName(SomeFunction)).to.equal('SomeFunction');
- });
- });
});
diff --git a/packages/mui-utils/src/getDisplayName/getDisplayName.ts b/packages/mui-utils/src/getDisplayName/getDisplayName.ts
index 02164eed56390f..5290cabeea2e29 100644
--- a/packages/mui-utils/src/getDisplayName/getDisplayName.ts
+++ b/packages/mui-utils/src/getDisplayName/getDisplayName.ts
@@ -1,20 +1,11 @@
import * as React from 'react';
import { ForwardRef, Memo } from 'react-is';
-// Simplified polyfill for IE11 support
-// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
-const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
-export function getFunctionName(fn: Function): string {
- const match = `${fn}`.match(fnNameMatchRegex);
- const name = match && match[1];
- return name || '';
-}
-
function getFunctionComponentName(
Component: React.FunctionComponent | React.ComponentClass,
fallback = '',
) {
- return Component.displayName || Component.name || getFunctionName(Component) || fallback;
+ return Component.displayName || Component.name || fallback;
}
function getWrappedName(outerType: any, innerType: any, wrapperName: string) {
diff --git a/packages/mui-utils/src/getDisplayName/index.ts b/packages/mui-utils/src/getDisplayName/index.ts
index 601cc5db1f7b67..64a7a4597931fb 100644
--- a/packages/mui-utils/src/getDisplayName/index.ts
+++ b/packages/mui-utils/src/getDisplayName/index.ts
@@ -1,2 +1 @@
export { default } from './getDisplayName';
-export * from './getDisplayName';
diff --git a/packages/mui-utils/src/integerPropType/integerPropType.js b/packages/mui-utils/src/integerPropType/integerPropType.js
index 99105c3d03cd79..ca3afc0fab0583 100644
--- a/packages/mui-utils/src/integerPropType/integerPropType.js
+++ b/packages/mui-utils/src/integerPropType/integerPropType.js
@@ -24,18 +24,10 @@ export function getTypeByValue(value) {
}
}
-// IE 11 support
-function ponyfillIsInteger(x) {
- // eslint-disable-next-line no-restricted-globals
- return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;
-}
-
-const isInteger = Number.isInteger || ponyfillIsInteger;
-
function requiredInteger(props, propName, componentName, location) {
const propValue = props[propName];
- if (propValue == null || !isInteger(propValue)) {
+ if (propValue == null || !Number.isInteger(propValue)) {
const propType = getTypeByValue(propValue);
return new RangeError(
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 08af18d8d31af1..0a7e11acc5e854 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -76,9 +76,6 @@ importers:
'@babel/plugin-proposal-private-property-in-object':
specifier: ^7.21.11
version: 7.21.11(@babel/core@7.24.4)
- '@babel/plugin-transform-object-assign':
- specifier: ^7.24.1
- version: 7.24.1(@babel/core@7.24.4)
'@babel/plugin-transform-react-constant-elements':
specifier: ^7.24.1
version: 7.24.1(@babel/core@7.24.4)
@@ -588,9 +585,6 @@ importers:
'@babel/core':
specifier: ^7.24.4
version: 7.24.4
- '@babel/plugin-transform-object-assign':
- specifier: ^7.24.1
- version: 7.24.1(@babel/core@7.24.4)
'@babel/runtime':
specifier: ^7.24.4
version: 7.24.4
@@ -3720,15 +3714,6 @@ packages:
'@babel/helper-plugin-utils': 7.24.0
'@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.4)
- /@babel/plugin-transform-object-assign@7.24.1(@babel/core@7.24.4):
- resolution: {integrity: sha512-I1kctor9iKtupb7jv7FyjApHCuKLBKCblVAeHVK9PB6FW7GI0ac6RtobC3MwwJy8CZ1JxuhQmnbrsqI5G8hAIg==}
- engines: {node: '>=6.9.0'}
- peerDependencies:
- '@babel/core': ^7.24.4
- dependencies:
- '@babel/core': 7.24.4
- '@babel/helper-plugin-utils': 7.24.0
-
/@babel/plugin-transform-object-rest-spread@7.24.1(@babel/core@7.24.4):
resolution: {integrity: sha512-XjD5f0YqOtebto4HGISLNfiNMTTs6tbkFf2TOqJlYKYmbo+mN9Dnpl4SRoofiziuOWMIyq3sZEUqLo3hLITFEA==}
engines: {node: '>=6.9.0'}
diff --git a/scripts/build.mjs b/scripts/build.mjs
index 711bcf389ae274..3a9f594a72844e 100644
--- a/scripts/build.mjs
+++ b/scripts/build.mjs
@@ -8,8 +8,6 @@ import { getWorkspaceRoot } from './utils.mjs';
const exec = promisify(childProcess.exec);
const validBundles = [
- // legacy build using ES6 modules
- 'legacy',
// modern build with a rolling target using ES6 modules
'modern',
// build for node using commonJS modules
@@ -65,7 +63,6 @@ async function run(argv) {
node: topLevelPathImportsCanBePackages ? './node' : './',
modern: './modern',
stable: topLevelPathImportsCanBePackages ? './' : './esm',
- legacy: './legacy',
}[bundle],
);
diff --git a/scripts/sizeSnapshot/webpack.config.js b/scripts/sizeSnapshot/webpack.config.js
index 6a63b053c7ae50..92c97758bc8792 100644
--- a/scripts/sizeSnapshot/webpack.config.js
+++ b/scripts/sizeSnapshot/webpack.config.js
@@ -136,10 +136,6 @@ async function getWebpackEntries() {
// webpack: true,
// path: path.join(path.relative(workspaceRoot, materialPackagePath), 'modern/index.js'),
// },
- {
- id: '@material-ui/core.legacy',
- path: path.join(path.relative(workspaceRoot, materialPackagePath), 'legacy/index.js'),
- },
{
id: '@mui/joy',
path: path.join(path.relative(workspaceRoot, joyPackagePath), 'index.js'),
|