-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DataGridPremium] Remove the ariaV8 experimental flag (mui#15694)
- Loading branch information
Showing
19 changed files
with
197 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
docs/data/data-grid/row-grouping/RowGroupingAriaV8.tsx.preview
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ | |
groupingColDef={{ | ||
leafField: 'traderEmail', | ||
}} | ||
experimentalFeatures={{ ariaV8: true }} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/actual.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import { DataGridPremium } from '@mui/x-data-grid-premium'; | ||
|
||
function App() { | ||
return ( | ||
<React.Fragment> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
warnIfFocusStateIsNotSynced: true, | ||
ariaV8: true, | ||
}} | ||
/> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
ariaV8: true, | ||
}} | ||
/> | ||
<DataGridPremium {...props} /> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
export default App; |
18 changes: 18 additions & 0 deletions
18
...es/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/expected.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from 'react'; | ||
import { DataGridPremium } from '@mui/x-data-grid-premium'; | ||
|
||
function App() { | ||
return ( | ||
(<React.Fragment> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
warnIfFocusStateIsNotSynced: true, | ||
}} | ||
/> | ||
<DataGridPremium /> | ||
<DataGridPremium {...props} /> | ||
</React.Fragment>) | ||
); | ||
} | ||
|
||
export default App; |
22 changes: 22 additions & 0 deletions
22
packages/x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import removeObjectProperty from '../../../util/removeObjectProperty'; | ||
import { JsCodeShiftAPI, JsCodeShiftFileInfo } from '../../../types'; | ||
|
||
const componentsNames = ['DataGridPremium']; | ||
const propName = 'experimentalFeatures'; | ||
const propKeys = ['ariaV8']; | ||
|
||
export default function transformer(file: JsCodeShiftFileInfo, api: JsCodeShiftAPI, options: any) { | ||
const j = api.jscodeshift; | ||
const root = j(file.source); | ||
|
||
const printOptions = options.printOptions || { | ||
quote: 'single', | ||
trailingComma: true, | ||
}; | ||
|
||
propKeys.forEach((propKey) => { | ||
removeObjectProperty({ root, j, propName, componentsNames, propKey }); | ||
}); | ||
|
||
return root.toSource(printOptions); | ||
} |
48 changes: 48 additions & 0 deletions
48
...rid/remove-stabilized-experimentalFeatures/remove-stabilized-experimentalFeatures.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import path from 'path'; | ||
import { expect } from 'chai'; | ||
import jscodeshift from 'jscodeshift'; | ||
import transform from '.'; | ||
import readFile from '../../../util/readFile'; | ||
|
||
function read(fileName) { | ||
return readFile(path.join(__dirname, fileName)); | ||
} | ||
|
||
describe('v8.0.0/data-grid', () => { | ||
describe('remove-stabilized-experimentalFeatures', () => { | ||
it('transforms props as needed - js', () => { | ||
const actual = transform({ source: read('./actual.spec.js') }, { jscodeshift }, {}); | ||
|
||
const expected = read('./expected.spec.js'); | ||
expect(actual).to.equal(expected, 'The transformed version should be correct'); | ||
}); | ||
|
||
it('should be idempotent - js', () => { | ||
const actual = transform({ source: read('./expected.spec.js') }, { jscodeshift }, {}); | ||
|
||
const expected = read('./expected.spec.js'); | ||
expect(actual).to.equal(expected, 'The transformed version should be correct'); | ||
}); | ||
|
||
it('transforms props as needed - ts', () => { | ||
const actual = transform( | ||
{ source: read('./ts-actual.spec.tsx') }, | ||
{ jscodeshift: jscodeshift.withParser('tsx') }, | ||
{}, | ||
); | ||
const expected = read('./ts-expected.spec.tsx'); | ||
expect(actual).to.equal(expected, 'The transformed version should be correct'); | ||
}); | ||
|
||
it('should be idempotent - ts', () => { | ||
const actual = transform( | ||
{ source: read('./ts-expected.spec.tsx') }, | ||
{ jscodeshift: jscodeshift.withParser('tsx') }, | ||
{}, | ||
); | ||
|
||
const expected = read('./ts-expected.spec.tsx'); | ||
expect(actual).to.equal(expected, 'The transformed version should be correct'); | ||
}); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
.../x-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/ts-actual.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// @ts-nocheck | ||
import * as React from 'react'; | ||
import { DataGridPremium } from '@mui/x-data-grid-premium'; | ||
|
||
// prettier-ignore | ||
function App() { | ||
return ( | ||
<React.Fragment> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
warnIfFocusStateIsNotSynced: true, | ||
ariaV8: true, | ||
}} | ||
/> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
ariaV8: true, | ||
}} | ||
/> | ||
<DataGridPremium {...props} /> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
export default App; |
20 changes: 20 additions & 0 deletions
20
...-codemod/src/v8.0.0/data-grid/remove-stabilized-experimentalFeatures/ts-expected.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// @ts-nocheck | ||
import * as React from 'react'; | ||
import { DataGridPremium } from '@mui/x-data-grid-premium'; | ||
|
||
// prettier-ignore | ||
function App() { | ||
return ( | ||
(<React.Fragment> | ||
<DataGridPremium | ||
experimentalFeatures={{ | ||
warnIfFocusStateIsNotSynced: true, | ||
}} | ||
/> | ||
<DataGridPremium /> | ||
<DataGridPremium {...props} /> | ||
</React.Fragment>) | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.