Skip to content

Commit

Permalink
[core] Support @mui/material@6 peer dependency (#14142)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas <[email protected]>
  • Loading branch information
cherniavskii and LukasTy authored Aug 29, 2024
1 parent d9416d7 commit 70b6cb7
Show file tree
Hide file tree
Showing 69 changed files with 761 additions and 555 deletions.
30 changes: 29 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ commands:
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
- when:
condition:
equal: [material-ui-v6, << pipeline.parameters.workflow >>]
steps:
- run:
name: Install @mui/material@next
command: pnpm use-material-ui-v6

- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -248,7 +256,7 @@ jobs:
command: pnpm docs:typescript:formatted --disable-cache
- run:
name: '`pnpm docs:typescript:formatted` changes committed?'
command: git add -A && git diff --exit-code --staged
command: git add -A && git diff --exit-code --staged docs/src docs/data
- run:
name: Tests TypeScript definitions
command: pnpm typescript:ci
Expand Down Expand Up @@ -383,3 +391,23 @@ workflows:
<<: *default-context
react-version: next
name: test_e2e-react@next

material-ui-v6:
when:
equal: [material-ui-v6, << pipeline.parameters.workflow >>]
jobs:
- test_unit:
<<: *default-context
name: test_unit-material@next
- test_browser:
<<: *default-context
name: test_browser-material@next
- test_regressions:
<<: *default-context
name: test_regressions-material@next
- test_e2e:
<<: *default-context
name: test_e2e-material@next
- test_types:
<<: *default-context
name: test_types-material@next
10 changes: 5 additions & 5 deletions docs/data/data-grid/joy-ui/GridJoyUISlots.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Box from '@mui/material/Box';
import { DataGrid, GridToolbar, GridActionsCellItem } from '@mui/x-data-grid';
import { unstable_joySlots } from '@mui/x-data-grid/joy';
import {
experimental_extendTheme as materialExtendTheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
createTheme,
ThemeProvider as MaterialThemeProvider,
THEME_ID as MATERIAL_THEME_ID,
} from '@mui/material/styles';
import { CssVarsProvider as JoyCssVarsProvider } from '@mui/joy/styles';
Expand All @@ -18,7 +18,7 @@ import {
randomArrayItem,
} from '@mui/x-data-grid-generator';

const materialTheme = materialExtendTheme({
const materialTheme = createTheme({
components: {
MuiSvgIcon: {
styleOverrides: {
Expand Down Expand Up @@ -97,7 +97,7 @@ export default function GridJoyUISlots() {
}, []);

return (
<MaterialCssVarsProvider theme={{ [MATERIAL_THEME_ID]: materialTheme }}>
<MaterialThemeProvider theme={{ [MATERIAL_THEME_ID]: materialTheme }}>
<JoyCssVarsProvider>
<Box sx={{ height: 400, width: '100%' }}>
<DataGrid
Expand Down Expand Up @@ -133,6 +133,6 @@ export default function GridJoyUISlots() {
/>
</Box>
</JoyCssVarsProvider>
</MaterialCssVarsProvider>
</MaterialThemeProvider>
);
}
10 changes: 5 additions & 5 deletions docs/data/data-grid/joy-ui/GridJoyUISlots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Box from '@mui/material/Box';
import { DataGrid, GridToolbar, GridActionsCellItem } from '@mui/x-data-grid';
import { unstable_joySlots } from '@mui/x-data-grid/joy';
import {
experimental_extendTheme as materialExtendTheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
createTheme,
ThemeProvider as MaterialThemeProvider,
THEME_ID as MATERIAL_THEME_ID,
} from '@mui/material/styles';
import { CssVarsProvider as JoyCssVarsProvider } from '@mui/joy/styles';
Expand All @@ -19,7 +19,7 @@ import {
} from '@mui/x-data-grid-generator';
import type {} from '@mui/material/themeCssVarsAugmentation';

const materialTheme = materialExtendTheme({
const materialTheme = createTheme({
components: {
MuiSvgIcon: {
styleOverrides: {
Expand Down Expand Up @@ -106,7 +106,7 @@ export default function GridJoyUISlots() {
}, []);

return (
<MaterialCssVarsProvider theme={{ [MATERIAL_THEME_ID]: materialTheme }}>
<MaterialThemeProvider theme={{ [MATERIAL_THEME_ID]: materialTheme }}>
<JoyCssVarsProvider>
<Box sx={{ height: 400, width: '100%' }}>
<DataGrid
Expand Down Expand Up @@ -142,6 +142,6 @@ export default function GridJoyUISlots() {
/>
</Box>
</JoyCssVarsProvider>
</MaterialCssVarsProvider>
</MaterialThemeProvider>
);
}
4 changes: 2 additions & 2 deletions docs/src/modules/components/ChartFeaturesGrid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Grid from '@mui/material/Unstable_Grid2';
import Grid from '@mui/material/Grid';
import { InfoCard } from '@mui/docs/InfoCard';
import LineAxisRoundedIcon from '@mui/icons-material/LineAxisRounded';
import DashboardCustomizeRoundedIcon from '@mui/icons-material/DashboardCustomizeRounded';
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function ChartFeaturesGrid() {
return (
<Grid container spacing={2}>
{content.map(({ icon, title, link }) => (
<Grid key={title} xs={12} sm={4}>
<Grid item key={title} xs={12} sm={4}>
<InfoCard dense classNameTitle="algolia-lvl3" link={link} title={title} icon={icon} />
</Grid>
))}
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/InstallationGrid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import Grid from '@mui/material/Unstable_Grid2';
import Grid from '@mui/material/Grid';
import { InfoCard } from '@mui/docs/InfoCard';
import AccountTreeRounded from '@mui/icons-material/AccountTreeRounded';
import PivotTableChartRoundedIcon from '@mui/icons-material/PivotTableChartRounded';
Expand Down Expand Up @@ -38,7 +38,7 @@ export default function InstallationGrid() {
return (
<Grid container spacing={2}>
{content.map(({ icon, title, description, link }) => (
<Grid key={title} xs={12} sm={6}>
<Grid item key={title} xs={12} sm={6}>
<InfoCard
classNameTitle="algolia-lvl3"
link={link}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"typescript": "lerna run --no-bail --parallel typescript",
"typescript:ci": "lerna run --concurrency 1 --no-bail --no-sort typescript",
"use-react-version": "node scripts/useReactVersion.mjs",
"use-material-ui-v6": "node scripts/useMaterialUIv6.mjs",
"build:codesandbox": "lerna run --concurrency 3 --no-private --scope \"@mui/*\" build",
"install:codesandbox": "pnpm install --no-frozen-lockfile",
"release:changelog": "node scripts/releaseChangelog.mjs",
Expand Down
6 changes: 4 additions & 2 deletions packages/x-charts-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"dependencies": {
"@babel/runtime": "^7.25.4",
"@mui/system": "^5.16.7",
"@mui/utils": "^5.16.6",
"@mui/x-charts": "workspace:*",
"@mui/x-charts-vendor": "workspace:*",
Expand All @@ -53,7 +52,8 @@
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"@mui/material": "^5.15.14 || ^6.0.0",
"@mui/system": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand All @@ -66,6 +66,8 @@
}
},
"devDependencies": {
"@mui/material": "^5.16.5",
"@mui/system": "^5.16.7",
"@react-spring/core": "^9.7.4",
"@react-spring/shared": "^9.7.4",
"@types/prop-types": "^15.7.12",
Expand Down
5 changes: 5 additions & 0 deletions packages/x-charts-pro/src/tests/materialVersion.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import materialPackageJson from '@mui/material/package.json';
import { checkMaterialVersion } from 'test/utils/checkMaterialVersion';
import packageJson from '../../package.json';

checkMaterialVersion({ packageJson, materialPackageJson });
6 changes: 4 additions & 2 deletions packages/x-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"dependencies": {
"@babel/runtime": "^7.25.4",
"@mui/system": "^5.16.7",
"@mui/utils": "^5.16.6",
"@mui/x-charts-vendor": "workspace:*",
"@react-spring/rafz": "^9.7.4",
Expand All @@ -51,7 +50,8 @@
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"@mui/material": "^5.15.14 || ^6.0.0",
"@mui/system": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand All @@ -65,6 +65,8 @@
},
"devDependencies": {
"@mui/internal-test-utils": "^1.0.10",
"@mui/material": "^5.16.5",
"@mui/system": "^5.16.7",
"@react-spring/core": "^9.7.4",
"@react-spring/shared": "^9.7.4",
"@types/prop-types": "^15.7.12",
Expand Down
5 changes: 5 additions & 0 deletions packages/x-charts/src/tests/materialVersion.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import materialPackageJson from '@mui/material/package.json';
import { checkMaterialVersion } from 'test/utils/checkMaterialVersion';
import packageJson from '../../package.json';

checkMaterialVersion({ packageJson, materialPackageJson });
6 changes: 4 additions & 2 deletions packages/x-data-grid-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@
"lru-cache": "^10.4.3"
},
"devDependencies": {
"@mui/icons-material": "^5.16.5",
"@mui/material": "^5.16.5",
"@types/chance": "^1.1.6",
"rimraf": "^5.0.10"
},
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/icons-material": "^5.4.1",
"@mui/material": "^5.15.14",
"@mui/icons-material": "^5.4.1 || ^6.0.0",
"@mui/material": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
Expand Down
6 changes: 4 additions & 2 deletions packages/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
},
"dependencies": {
"@babel/runtime": "^7.25.4",
"@mui/system": "^5.16.7",
"@mui/utils": "^5.16.6",
"@mui/x-data-grid": "workspace:*",
"@mui/x-data-grid-pro": "workspace:*",
Expand All @@ -59,7 +58,8 @@
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"@mui/material": "^5.15.14 || ^6.0.0",
"@mui/system": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand All @@ -73,6 +73,8 @@
},
"devDependencies": {
"@mui/internal-test-utils": "^1.0.10",
"@mui/material": "^5.16.5",
"@mui/system": "^5.16.7",
"@types/prop-types": "^15.7.12",
"date-fns": "^2.30.0",
"rimraf": "^5.0.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ describe('<DataGridPremium /> - Aggregation', () => {
}),
).getByText('max'),
);
clock.runToLast();

expect(getColumnValues(0)).to.deep.equal(['0', '1', '2', '3', '4', '5', '5' /* Agg */]);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import materialPackageJson from '@mui/material/package.json';
import { checkMaterialVersion } from 'test/utils/checkMaterialVersion';
import packageJson from '../../package.json';

checkMaterialVersion({ packageJson, materialPackageJson });
6 changes: 4 additions & 2 deletions packages/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
},
"dependencies": {
"@babel/runtime": "^7.25.4",
"@mui/system": "^5.16.7",
"@mui/utils": "^5.16.6",
"@mui/x-data-grid": "workspace:*",
"@mui/x-internals": "workspace:*",
Expand All @@ -57,7 +56,8 @@
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"@mui/material": "^5.15.14 || ^6.0.0",
"@mui/system": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand All @@ -71,6 +71,8 @@
},
"devDependencies": {
"@mui/internal-test-utils": "^1.0.10",
"@mui/material": "^5.16.5",
"@mui/system": "^5.16.7",
"@types/prop-types": "^15.7.12",
"rimraf": "^5.0.10"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/x-data-grid-pro/src/tests/materialVersion.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import materialPackageJson from '@mui/material/package.json';
import { checkMaterialVersion } from 'test/utils/checkMaterialVersion';
import packageJson from '../../package.json';

checkMaterialVersion({ packageJson, materialPackageJson });
6 changes: 4 additions & 2 deletions packages/x-data-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"dependencies": {
"@babel/runtime": "^7.25.4",
"@mui/system": "^5.16.7",
"@mui/utils": "^5.16.6",
"@mui/x-internals": "workspace:*",
"clsx": "^2.1.1",
Expand All @@ -58,7 +57,8 @@
"peerDependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mui/material": "^5.15.14",
"@mui/material": "^5.15.14 || ^6.0.0",
"@mui/system": "^5.15.14 || ^6.0.0",
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
Expand All @@ -73,6 +73,8 @@
"devDependencies": {
"@mui/internal-test-utils": "^1.0.10",
"@mui/joy": "^5.0.0-beta.48",
"@mui/material": "^5.16.5",
"@mui/system": "^5.16.7",
"@mui/types": "^7.2.15",
"@types/prop-types": "^15.7.12",
"rimraf": "^5.0.10"
Expand Down
Loading

0 comments on commit 70b6cb7

Please sign in to comment.