mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.12k stars 1.28k forks source link

[codemod] mui-x 7.0 migration script #12874

Closed mauro-ni closed 1 month ago

mauro-ni commented 5 months ago

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:


❯ npx @mui/x-codemod@latest v7.0.0/data-grid/preset-safe src/ 
Executing command: jscodeshift /PATH/TO/HOME/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /PATH/TO/HOME/.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/** /PATH/TO/PROJECT/src

====================================
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 606 files... 
Spawning 9 workers...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 6 files to free worker...
All done. 
Results: 
0 errors
606 unmodified
0 skipped
0 ok
Time elapsed: 2.187seconds

I also tried to run codemods for all mui-x packages and only stuff related to @mui/x-tree-view have been updated.

❯ npx @mui/x-codemod@latest v7.0.0/preset-safe src/           
Executing command: jscodeshift /PATH/TO/HOME/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /PATH/TO/HOME/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/v7.0.0/preset-safe --extensions js,ts,jsx,tsx --parser tsx --ignore-pattern **/node_modules/** /PATH/TO/PROJECT/src

====================================
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 606 files... 
Spawning 9 workers...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 6 files to free worker...
All done. 
Results: 
0 errors
605 unmodified
0 skipped
1 ok
Time elapsed: 5.426seconds

Many thanks in advance for your help. Mauro

Your environment

`npx @mui/envinfo` ``` System: OS: macOS 14.4.1 Binaries: Node: 21.7.3 - /usr/local/bin/node npm: 10.5.0 - /usr/local/bin/npm pnpm: Not Found Browsers: Chrome: 123.0.6312.124 Edge: Not Found Safari: 17.4.1 npmPackages: @emotion/react: ^11.11.4 => 11.11.4 @emotion/styled: ^11.11.5 => 11.11.5 @mui/base: 5.0.0-beta.42 => 5.0.0-beta.42 @mui/core-downloads-tracker: 5.15.15 @mui/icons-material: 5.15.15 => 5.15.15 @mui/lab: ^5.0.0-alpha.170 => 5.0.0-alpha.170 @mui/material: ^5.15.15 => 5.15.15 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/system: ^5.15.15 => 5.15.15 @mui/types: 7.2.14 @mui/utils: 5.15.14 @mui/x-data-grid: 7.3.0 @mui/x-data-grid-premium: ^7.3.0 => 7.3.0 @mui/x-data-grid-pro: 7.3.0 @mui/x-date-pickers: 7.2.0 @mui/x-date-pickers-pro: ^7.2.0 => 7.2.0 @mui/x-license: ^7.2.0 => 7.2.0 @mui/x-tree-view: ^7.3.0 => 7.3.0 @types/react: 18.0.14 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 typescript: 5.1.6 ```

Search keywords: upgrade migrate 7 7.0 Order ID: 47709

LukasTy commented 5 months ago

Hello @mauro-ni. Could you clarify a couple of things:

  1. Is your app big and are you using any deprecated APIs? Or in other words - does tsc produce problems after upgrading/running codemod?
  2. Have you read the limitations of the codemod that are printed when you run it? Maybe you wrap all the @mui/x components with your intermediate components and use them throughout the app and pass props only through them? Such cases are not covered by codemods, because we can not write reliable AST detection that wouldn't produce false positives if we do not detect an import from @mui/x.
mauro-ni commented 5 months ago

Hello @LukasTy , many thanks for you reply.

  1. Yes the app is quite big and I am using deprecated API (eg. experimentalFeatures={{ columnGrouping: true }} )
  2. I use JS (no TS)
  3. I know that codemods cannot migrate everything and that lots of things have to be migrated manually.
  4. I wrap DataGridPremium, but yesterday I already tried unwrapping it (importing DataGridPremium from @mui/x-data-grid-premium), but the result was the same
  5. I also tried to run codemod against a folder with only 4 components, with DataGridPremium imported from @mui/x-data-grid-premium and prop experimentalFeatures={{ columnGrouping: true }}, but nothing is modified

Many thanks, Mauro

michelengelen commented 5 months ago

@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 src/app/page.tsx:

'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 npx @mui/x-codemod@latest v7.0.0/data-grid/preset-safe src/app/page.tsx resulted in this log:

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 experimentalFeatures object did not get changed, but it should have been according to this section of the codemods README file.

Running npx @mui/x-codemod@latest v7.0.0/data-grid/remove-stabilized-experimentalFeatures src/app/page.tsx did not help either. We might have a bug in that part.

sterlingdcs-damian commented 4 months ago

Also facing the same issue.

We have a large project. It does have some existing tsc compilation errors, if thats a factor.. but the codemod not giving any useful info we're also using experimentalFeatures={{ columnGrouping: true }}

d@d-XPS-9320:~/code/frontend/src$ npx @mui/x-codemod@latest v7.0.0/preset-safe .
Executing command: jscodeshift /home/d/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /home/d/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/v7.0.0/preset-safe --extensions js,ts,jsx,tsx --parser tsx --ignore-pattern **/node_modules/** /home/d/code/frontend/src

====================================
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 2892 files... 
Spawning 15 workers...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 42 files to free worker...
All done. 
Results: 
0 errors
2892 unmodified
0 skipped
0 ok
Time elapsed: 34.323seconds 
mauro-ni commented 4 months ago

Good morning, is there any update on this? I would like to migrate to mui-x 7.

Many thanks.

Mauro

UmutKDev commented 4 months ago

same problem here

sterlingdcs-damian commented 3 months ago

any ideas if this will be prioritised? or is it possible to backfill some bugs to the previous major?

MBilalShafi commented 3 months ago

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.

sterlingdcs-damian commented 3 months ago
Need to install the following packages:
@mui/x-codemod@7.8.0
Ok to proceed? (y) y
Executing command: jscodeshift /home/d/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/node_modules/jscodeshift/bin/jscodeshift.js --transform /home/d/.npm/_npx/51d343d56bb93e62/node_modules/@mui/x-codemod/v7.0.0/preset-safe --extensions js,ts,jsx,tsx --parser tsx --ignore-pattern **/node_modules/** /home/d/code/frontend

====================================
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 formatting or console errors.

Processing 3709 files... 
Spawning 15 workers...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
 ERR /home/d/code/frontend/src/app-premigration/redux/cost-plan/items/CostPlanItems.slice.ts Transformation error (Unexpected token (78:29))
SyntaxError: Unexpected token (78:29)
    at toParseError (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parse-error.ts:74:19)
    at TypeScriptParserMixin.raise (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/tokenizer/index.ts:1497:19)
    at TypeScriptParserMixin.unexpected (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/tokenizer/index.ts:1537:16)
    at TypeScriptParserMixin.jsxParseIdentifier (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:271:14)
    at TypeScriptParserMixin.jsxParseNamespacedName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:281:25)
    at TypeScriptParserMixin.jsxParseAttribute (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:406:24)
    at TypeScriptParserMixin.jsxParseOpeningElementAfterName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:433:30)
    at TypeScriptParserMixin.jsxParseOpeningElementAfterName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3881:20)
    at TypeScriptParserMixin.jsxParseOpeningElementAt (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:423:19)
    at TypeScriptParserMixin.jsxParseElementAt (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:463:35)
    at TypeScriptParserMixin.jsxParseElement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:552:19)
    at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:566:21)
    at TypeScriptParserMixin.parseExprSubscripts (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:709:23)
    at TypeScriptParserMixin.parseUpdate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:686:21)
    at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:649:23)
    at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3573:20)
    at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:390:14)
    at TypeScriptParserMixin.parseExprOps (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:402:23)
    at TypeScriptParserMixin.parseMaybeConditional (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:357:23)
    at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:297:21)
    at fn (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3426:23)
    at TypeScriptParserMixin.tryParse (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/util.ts:166:20)
    at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3425:20)
    at TypeScriptParserMixin.parseFunctionBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:2579:14)
    at TypeScriptParserMixin.parseArrowExpression (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:2534:10)
    at TypeScriptParserMixin.parseParenAndDistinguishExpression (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:1829:12)
    at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:1165:21)
    at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:576:22)
    at TypeScriptParserMixin.parseExprSubscripts (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:709:23)
    at TypeScriptParserMixin.parseUpdate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:686:21)
    at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:649:23)
    at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3573:20)
    at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:390:14)
    at TypeScriptParserMixin.parseExprOps (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:402:23)
    at TypeScriptParserMixin.parseMaybeConditional (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:357:23)
    at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:297:21)
    at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3445:22)
    at callback (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:251:12)
    at TypeScriptParserMixin.allowInAnd (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:3127:16)
    at TypeScriptParserMixin.parseMaybeAssignAllowIn (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:250:17)
    at TypeScriptParserMixin.parseVar (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1532:18)
    at TypeScriptParserMixin.parseVarStatement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1196:10)
    at TypeScriptParserMixin.parseVarStatement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:2846:33)
    at TypeScriptParserMixin.parseStatementContent (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:550:21)
    at TypeScriptParserMixin.parseStatementContent (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:2895:20)
    at TypeScriptParserMixin.parseStatementLike (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:421:17)
    at TypeScriptParserMixin.parseModuleItem (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:358:17)
    at TypeScriptParserMixin.parseBlockOrModuleBlockBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1388:16)
    at TypeScriptParserMixin.parseBlockBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1362:10)
    at TypeScriptParserMixin.parseProgram (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:217:10)
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 50 files to free worker...
Sending 9 files to free worker...

and it appears to hang and not complete... the l Transformation error line happens on this code, on thie line GridItemsState<

  <
    GridItemsState<CostItem> & {
      version: GuidString
    }
  >{
    items: state[COST_PLAN_SLICE][ITEMS_KEY].items,
    itemsByIds: state[COST_PLAN_SLICE][ITEMS_KEY].itemsByIds,
    itemsFetching: state[COST_PLAN_SLICE][ITEMS_KEY].itemsFetching,
    version: state[COST_PLAN_SLICE][ITEMS_KEY].version,
  }
sterlingdcs-damian commented 3 months ago

It also appears to modifying code completely unrelated by MUI by putting redundnant parenthesis around them image

Also doesnt appear to have a fix for the UncapitalizedGridPremiumSlotsComponent export

LukasTy commented 2 months ago

@sterlingdcs-damian The wrapping part comes from the bump of the jscodeshift dependency. https://github.com/mui/mui-x/pull/12305 We hesitated bumping it due to this, but it resolved other issues that we thought were more important.

This extra parenthesis should be handled by your prettier setup, isn't it? 🤔

Also doesnt appear to have a fix for the UncapitalizedGridPremiumSlotsComponent export

In regards to this, maybe @MBilalShafi would have more context? 🤔

sterlingdcs-damian commented 2 months ago

@LukasTy yes, prettier auto fixes that, so that part is not so much of an issue.. the other parts are though

MBilalShafi commented 2 months ago

Also doesnt appear to have a fix for the UncapitalizedGridPremiumSlotsComponent export

@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. experimentalFeatures={{ columnGrouping: true }}

I appreciate your patience while we resolve this issue.

github-actions[bot] commented 1 month ago

:warning: This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@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.

sterlingdcs-damian commented 2 weeks ago

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... Spawning 15 workers... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... Sending 50 files to free worker... ERR /home/d/code/frontend/src/app-premigration/redux/cost-plan/items/CostPlanItems.slice.ts Transformation error (Unexpected token (78:29)) SyntaxError: Unexpected token (78:29) at toParseError (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parse-error.ts:95:45) at TypeScriptParserMixin.raise (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/tokenizer/index.ts:1496:19) at TypeScriptParserMixin.unexpected (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/tokenizer/index.ts:1536:16) at TypeScriptParserMixin.jsxParseIdentifier (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:271:14) at TypeScriptParserMixin.jsxParseNamespacedName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:281:25) at TypeScriptParserMixin.jsxParseAttribute (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:406:24) at TypeScriptParserMixin.jsxParseOpeningElementAfterName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:433:30) at TypeScriptParserMixin.jsxParseOpeningElementAfterName (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3883:20) at TypeScriptParserMixin.jsxParseOpeningElementAt (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:423:19) at TypeScriptParserMixin.jsxParseElementAt (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:463:35) at TypeScriptParserMixin.jsxParseElement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:552:19) at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:566:21) at TypeScriptParserMixin.parseExprSubscripts (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:706:23) at TypeScriptParserMixin.parseUpdate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:685:21) at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:647:23) at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3574:20) at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:388:14) at TypeScriptParserMixin.parseExprOps (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:400:23) at TypeScriptParserMixin.parseMaybeConditional (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:355:23) at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:297:21) at fn (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3427:23) at TypeScriptParserMixin.tryParse (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/util.ts:174:20) at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3426:20) at TypeScriptParserMixin.parseFunctionBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:2575:14) at TypeScriptParserMixin.parseArrowExpression (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:2530:10) at TypeScriptParserMixin.parseParenAndDistinguishExpression (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:1825:12) at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:1162:21) at TypeScriptParserMixin.parseExprAtom (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/jsx/index.ts:576:22) at TypeScriptParserMixin.parseExprSubscripts (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:706:23) at TypeScriptParserMixin.parseUpdate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:685:21) at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:647:23) at TypeScriptParserMixin.parseMaybeUnary (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3574:20) at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:388:14) at TypeScriptParserMixin.parseExprOps (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:400:23) at TypeScriptParserMixin.parseMaybeConditional (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:355:23) at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:297:21) at TypeScriptParserMixin.parseMaybeAssign (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:3446:22) at callback (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:251:12) at TypeScriptParserMixin.allowInAnd (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:3130:16) at TypeScriptParserMixin.parseMaybeAssignAllowIn (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/expression.ts:250:17) at TypeScriptParserMixin.parseVar (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1539:18) at TypeScriptParserMixin.parseVarStatement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1203:10) at TypeScriptParserMixin.parseVarStatement (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:2847:33) at TypeScriptParserMixin.parseStatementContent (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:555:21) at TypeScriptParserMixin.parseStatementContent (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/plugins/typescript/index.ts:2896:20) at TypeScriptParserMixin.parseStatementLike (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:426:17) at TypeScriptParserMixin.parseModuleItem (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:363:17) at TypeScriptParserMixin.parseBlockOrModuleBlockBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1395:16) at TypeScriptParserMixin.parseBlockBody (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:1369:10) at TypeScriptParserMixin.parseProgram (/home/d/.npm/_npx/51d343d56bb93e62/node_modules/@babel/parser/src/parser/statement.ts:217:10) Sending 50 files to free worker... [..snip] Sending 2 files to free worker... All done. Results: 1 errors 2971 unmodified 0 skipped 80 ok Time elapsed: 97.974seconds

We are finding we are having to manually change every place where we have GridValueFormatterParams . I assuem this isn't taken care of as part of the codemode?