Skip to content
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] Support sx conditional inside spread element #42894

Merged
merged 4 commits into from
Jul 12, 2024

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jul 10, 2024

The test actual comes from:

The change is to support conditional expression inside a spread element:

…horizontal ?
  { color: 'red' } :
  { color: 'blue' }

and to iterate inside theme.apply*:

…theme.applyDarkStyles({})

@siriwatknp siriwatknp added package: codemod Specific to @mui/codemod enhancement This is not a bug, nor a new feature v6.x migration labels Jul 10, 2024
@siriwatknp siriwatknp requested a review from mnajdova July 10, 2024 04:48
(data.node.argument.alternate.type === 'Identifier' &&
data.node.argument.alternate.name === 'sx');

if (!isSxSpread) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do nothing for

...(Array.isArray(sx) ? sx : [sx])

@mui-bot
Copy link

mui-bot commented Jul 10, 2024

Netlify deploy preview

https://deploy-preview-42894--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 544d57e

@siriwatknp siriwatknp merged commit 00c0b5f into mui:next Jul 12, 2024
19 checks passed
joserodolfofreitas pushed a commit to joserodolfofreitas/material-ui that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature package: codemod Specific to @mui/codemod v6.x migration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants