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 b510153b79d8..514684a40081 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 @@ -55,7 +55,7 @@ If you have `@mui/x-license-pro` in the `dependencies` section of your `package. ## Run codemods The `preset-safe` codemod will automatically adjust the bulk of your code to account for breaking changes in v7. -You can run `v7.0.0/data-grid/preset-safe` targeting only Data Grid or `v7.0.0/preset-safe` to target other MUI X components like Date and Time pickers as well. +You can run `v7.0.0/data-grid/preset-safe` targeting only Data Grid or `v7.0.0/preset-safe` to target other MUI X components like the Date and Time pickers as well. You can either run it on a specific file, folder, or your entire codebase when choosing the `` argument. 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 f3c953b71a37..787bbefb3182 100644 --- a/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md +++ b/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md @@ -48,7 +48,8 @@ If you have `@mui/x-license-pro` in the `dependencies` section of your `package. ## Run codemods -The `preset-safe` codemod will automatically adjust the bulk of your code to account for breaking changes in v7. You can run `v7.0.0/pickers/preset-safe` targeting only Date and Time Pickers or `v7.0.0/preset-safe` to target Data Grid as well. +The `preset-safe` codemod will automatically adjust the bulk of your code to account for breaking changes in v7. +You can run `v7.0.0/pickers/preset-safe` targeting only Date and Time Pickers or `v7.0.0/preset-safe` to target other MUI X components like the Data Grid as well. You can either run it on a specific file, folder, or your entire codebase when choosing the `` argument. @@ -58,7 +59,7 @@ You can either run it on a specific file, folder, or your entire codebase when c // Date and Time Pickers specific npx @mui/x-codemod@latest v7.0.0/pickers/preset-safe -// Target Data Grid as well +// Target other MUI X components as well npx @mui/x-codemod@latest v7.0.0/preset-safe ``` @@ -78,7 +79,7 @@ Not all use cases are covered by codemods. In some scenarios, like props spreadi For example, if a codemod tries to rename a prop, but this prop is hidden with the spread operator, it won't be transformed as expected. ```tsx - + ``` After running the codemods, make sure to test your application and that you don't have any console errors. 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 38cc9b37b0ba..d1896e63a1e1 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 @@ -26,6 +26,47 @@ To have the option of using the latest API from `@mui/material`, the package pee It is a change in minor version only, so it should not cause any breaking changes. Please update your `@mui/material` package to this or a newer version. +## Run codemods + +The `preset-safe` codemod will automatically adjust the bulk of your code to account for breaking changes in v7. +You can run `v7.0.0/tree-view/preset-safe` targeting only Tree View or `v7.0.0/preset-safe` to target other MUI X components like the Data Grid as well. + +You can either run it on a specific file, folder, or your entire codebase when choosing the `` argument. + + + +```bash +// Data Grid specific +npx @mui/x-codemod@latest v7.0.0/tree-view/preset-safe + +// Target other MUI X components as well +npx @mui/x-codemod@latest v7.0.0/preset-safe +``` + +:::info +If you want to run the codemods one by one, check out the codemods included in the [preset-safe codemod for the Tree View](https://github.com/mui/mui-x/blob/HEAD/packages/x-codemod/README.md#preset-safe-for-tree-view-v700) for more details. +::: + +Breaking changes that are handled by `preset-safe` codemod are denoted by a ✅ emoji in the table of contents on the right side of the screen or next to the specific point that is handled by it. + +If you have already applied the `v7.0.0/tree-view/preset-safe` (or `v7.0.0/preset-safe`) codemod, then you should not need to take any further action on these items. If there's a specific part of the breaking change that is not part of the codemod or needs some manual work, it will be listed in the end of each section. + +All other changes must be handled manually. + +:::warning +Not all use cases are covered by codemods. In some scenarios, like props spreading, cross-file dependencies, etc., the changes are not properly identified and therefore must be handled manually. + +For example, if a codemod tries to rename a prop, but this prop is hidden with the spread operator, it won't be transformed as expected. + +```tsx + +``` + +After running the codemods, make sure to test your application and that you don't have any console errors. + +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. +::: + ## Breaking changes Since `v7` is a major release, it contains changes that affect the public API.