-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[codemod] mui-x 7.0 migration script #12874
Comments
Hello @mauro-ni.
|
Hello @LukasTy , many thanks for you reply.
Many thanks, |
@cherniavskii I did just try it with a fresh next project and it did modify my files as expected. This is the code I added in 'use client';
import * as React from 'react';
import { DataGridPremium } from "@mui/x-data-grid-premium";
import { useDemoData } from '@mui/x-data-grid-generator';
const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin'];
export default function Home() {
const { data } = useDemoData({
dataSet: 'Employee',
visibleFields: VISIBLE_FIELDS,
rowLength: 100,
});
return (
<main>
<DataGridPremium
{...data}
unstable_cellSelection
experimentalFeatures={{ columnGrouping: true }}
/>
</main>
);
} running Executing command: jscodeshift /Users/michel/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /Users/michel/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/v7.0.0/data-grid/preset-safe --extensions js,ts,jsx,tsx --parser tsx --ignore-pattern **/node_modules/** /Users/michel/_work/tests/next/src/app/page.tsx
====================================
IMPORTANT NOTICE ABOUT CODEMOD USAGE
====================================
Not all use cases are covered by codemods. In some scenarios, like props spreading, cross-file dependencies and 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.
<DatePicker {...pickerProps} />
After running the codemods, make sure to test your application and that you don't have any console errors.
Processing 1 files...
Spawning 1 workers...
Sending 1 files to free worker...
All done.
Results:
0 errors
0 unmodified
0 skipped
1 ok
Time elapsed: 0.329seconds The file was modified, but the Running |
Also facing the same issue. We have a large project.
|
Good morning, Many thanks. Mauro |
same problem here |
any ideas if this will be prioritised? or is it possible to backfill some bugs to the previous major? |
Update: We did fix some compatibility issues related to codemods. Can you check if it's still causing issues? I would be interested to see some code snippets that should be, but are not being modified by the codemod script. It'd be great if you could attach a few of them. |
and it appears to hang and not complete...
|
@sterlingdcs-damian The wrapping part comes from the bump of the This extra parenthesis should be handled by your prettier setup, isn't it? 🤔
In regards to this, maybe @MBilalShafi would have more context? 🤔 |
@LukasTy yes, prettier auto fixes that, so that part is not so much of an issue.. the other parts are though |
@sterlingdcs-damian I am investigating the issues related to this one. I'm curious if you could spot some other aspects that are not being transformed apart from the one mentioned above. i.e. I appreciate your patience while we resolve this issue. |
@mauro-ni: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
just reran, my results: After running the codemods, make sure to test your application and that you don't have any formatting or console errors. Processing 3052 files... We are finding we are having to manually change every place where we have |
The problem in depth
Hi,
I'm trying to upgrade an application using mui-x 6 to mui-x version 7.
I followed the guide at https://mui.com/x/migration/migration-data-grid-v6/ but when I run the script to migrate the @mui/x-data-grid-premium no changes are applied to my code.
I installed new versions of packages @mui/x-data-grid-premium, @mui/x-date-pickers-pro, @mui/x-tree-view,
I installed and imported the license from @mui/x-license
I ran the codemods for data grid
Here is the output of the command:
I also tried to run codemods for all mui-x packages and only stuff related to @mui/x-tree-view have been updated.
Many thanks in advance for your help.
Mauro
Your environment
`npx @mui/envinfo`
Search keywords: upgrade migrate 7 7.0
Order ID: 47709
The text was updated successfully, but these errors were encountered: