-
-
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
[data grid] Remove the ariaV8 experimental flag #15694
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should aim to sell each breaking change, and even more importantly give people direction on how they can handle the new behavior.
Here, we can at least do the latter, the former is not that important since the people who already use this flag, theoretically are already sold on us making it the default:
done in: dac7c3d.