diff --git a/docs/data/migration/migration-charts-v6/migration-charts-v6.md b/docs/data/migration/migration-charts-v6/migration-charts-v6.md index aab269714266d..885e85bfe97fc 100644 --- a/docs/data/migration/migration-charts-v6/migration-charts-v6.md +++ b/docs/data/migration/migration-charts-v6/migration-charts-v6.md @@ -41,6 +41,36 @@ The `legacy` bundle that used to support old browsers like IE 11 is no longer i If you need support for IE 11, you will need to keep using the latest version of the `v6` release. ::: +### Drop Webpack 4 support + +Dropping old browsers support also means that we no longer transpile some features that are natively supported by modern browsers – like [Nullish Coalescing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). + +These features are not supported by Webpack 4, so if you are using Webpack 4, you will need to transpile these features yourself or upgrade to Webpack 5. + +Here is an example of how you can transpile these features on Webpack 4 using the `@babel/preset-env` preset: + +```diff + // webpack.config.js + + module.exports = (env) => ({ + // ... + module: { + rules: [ + { + test: /\.[jt]sx?$/, +- exclude: /node_modules/, ++ exclude: [ ++ { ++ test: path.resolve(__dirname, 'node_modules'), ++ exclude: [path.resolve(__dirname, 'node_modules/@mui/x-charts')], ++ }, ++ ], + }, + ], + }, + }); +``` + ### Renaming #### Types diff --git a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md index cdfd95277d1f5..c3e53e6e9b38b 100644 --- a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md +++ b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md @@ -108,6 +108,40 @@ The `legacy` bundle that used to support old browsers like IE 11 is no longer i If you need support for IE 11, you will need to keep using the latest version of the `v6` release. ::: +### Drop Webpack 4 support + +Dropping old browsers support also means that we no longer transpile some features that are natively supported by modern browsers – like [Nullish Coalescing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). + +These features are not supported by Webpack 4, so if you are using Webpack 4, you will need to transpile these features yourself or upgrade to Webpack 5. + +Here is an example of how you can transpile these features on Webpack 4 using the `@babel/preset-env` preset: + +```diff + // webpack.config.js + + module.exports = (env) => ({ + // ... + module: { + rules: [ + { + test: /\.[jt]sx?$/, +- exclude: /node_modules/, ++ exclude: [ ++ { ++ test: path.resolve(__dirname, 'node_modules'), ++ exclude: [ ++ // Covers @mui/x-data-grid, @mui/x-data-grid-pro, and @mui/x-data-grid-premium ++ path.resolve(__dirname, 'node_modules/@mui/x-data-grid'), ++ path.resolve(__dirname, 'node_modules/@mui/x-license'), ++ ], ++ }, ++ ], + }, + ], + }, + }); +``` + ### DOM changes The Data Grid's layout has been substantially altered to use CSS sticky positioned elements. diff --git a/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md b/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md index 23e509dc29a7e..4d3c156476f65 100644 --- a/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md +++ b/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md @@ -86,7 +86,12 @@ After running the codemods, make sure to test your application and that you don' Feel free to [open an issue](https://github.com/mui/mui-x/issues/new/choose) for support if you need help to proceed with your migration. ::: -## Drop the legacy bundle +## Breaking changes + +Since v7 is a major release, it contains some changes that affect the public API. +These changes were done for consistency, improve stability and make room for new features. + +### Drop the legacy bundle The support for IE 11 has been removed from all MUI X packages. The `legacy` bundle that used to support old browsers like IE 11 is no longer included. @@ -95,6 +100,40 @@ The `legacy` bundle that used to support old browsers like IE 11 is no longer i If you need support for IE 11, you will need to keep using the latest version of the `v6` release. ::: +### Drop Webpack 4 support + +Dropping old browsers support also means that we no longer transpile some features that are natively supported by modern browsers – like [Nullish Coalescing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). + +These features are not supported by Webpack 4, so if you are using Webpack 4, you will need to transpile these features yourself or upgrade to Webpack 5. + +Here is an example of how you can transpile these features on Webpack 4 using the `@babel/preset-env` preset: + +```diff + // webpack.config.js + + module.exports = (env) => ({ + // ... + module: { + rules: [ + { + test: /\.[jt]sx?$/, +- exclude: /node_modules/, ++ exclude: [ ++ { ++ test: path.resolve(__dirname, 'node_modules'), ++ exclude: [ ++ // Covers @mui/x-date-pickers and @mui/x-date-pickers-pro ++ path.resolve(__dirname, 'node_modules/@mui/x-date-pickers'), ++ path.resolve(__dirname, 'node_modules/@mui/x-license'), ++ ], ++ }, ++ ], + }, + ], + }, + }); +``` + ## Component slots ### Rename `components` to `slots` diff --git a/docs/data/migration/migration-tree-view-v6/migration-tree-view-v6.md b/docs/data/migration/migration-tree-view-v6/migration-tree-view-v6.md index 965b06fc43df0..0fbe2c9003bd0 100644 --- a/docs/data/migration/migration-tree-view-v6/migration-tree-view-v6.md +++ b/docs/data/migration/migration-tree-view-v6/migration-tree-view-v6.md @@ -40,6 +40,36 @@ The `legacy` bundle that used to support old browsers like IE 11 is no longer i If you need support for IE 11, you will need to keep using the latest version of the `v6` release. ::: +### Drop Webpack 4 support + +Dropping old browsers support also means that we no longer transpile some features that are natively supported by modern browsers – like [Nullish Coalescing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [Optional Chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). + +These features are not supported by Webpack 4, so if you are using Webpack 4, you will need to transpile these features yourself or upgrade to Webpack 5. + +Here is an example of how you can transpile these features on Webpack 4 using the `@babel/preset-env` preset: + +```diff + // webpack.config.js + + module.exports = (env) => ({ + // ... + module: { + rules: [ + { + test: /\.[jt]sx?$/, +- exclude: /node_modules/, ++ exclude: [ ++ { ++ test: path.resolve(__dirname, 'node_modules'), ++ exclude: [path.resolve(__dirname, 'node_modules/@mui/x-tree-view')], ++ }, ++ ], + }, + ], + }, + }); +``` + ### ✅ Rename `nodeId` to `itemId` The required `nodeId` prop used by the `TreeItem` has been renamed to `itemId` for consistency: