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

[core] Remove unnecessary conditional around .muiName = #44071

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Oct 11, 2024

This was added in #42001. Why?

@mui-bot
Copy link

mui-bot commented Oct 11, 2024

Netlify deploy preview

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

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 14761c3

@Janpot Janpot added the core Infrastructure work going on behind the scenes label Oct 11, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 11, 2024

It could be a use case for mui/pigment-css#84.

I have tried to apply this change with https://github.com/mui/material-ui/tree/4bcf32bbb8db43c5fe8c52d300116af00aae40d1/examples/material-ui-pigment-css-vite-ts (and found #44074 along the way), it seems to work fine. A big 💯 to move in this direction. If this code branche is needed, then muiName isn't applied, then it's broken, so in any cases, we can't have this code branch.

@Janpot
Copy link
Member Author

Janpot commented Oct 12, 2024

Yep, also found that adding .displayName to a styled component breaks pigment. Still investigating.

@mnajdova
Copy link
Member

I can confirm that it was added during the migration of Pigment CSS, because otherwise it breaks Pigment CSS. @brijeshb42 can likely share more info on why (or @siriwatknp as he was mainly driving the migration).

@brijeshb42
Copy link
Contributor

It is fine to remove now since we added a fix in the Pigment transform itself.

@Janpot Janpot marked this pull request as ready for review October 16, 2024 09:31
@Janpot
Copy link
Member Author

Janpot commented Oct 16, 2024

It is fine to remove now since we added a fix in the Pigment transform itself.

Does the fix apply to .displayName as well? It seems to break pigment in #44067

@brijeshb42
Copy link
Contributor

On inspecting the code, I see that we only handle muiName and propTypes. We'll also need to add check for displayName.

@Janpot
Copy link
Member Author

Janpot commented Oct 16, 2024

There is also defaultProps, and Toolpad is also attaching a static (Symbol) property to the component. I've seen other tools rely on similar patterns. Would it be possible to support just any static property on a component?

@zannager zannager requested a review from DiegoAndai October 16, 2024 10:10
@DiegoAndai
Copy link
Member

Sorry for the delay, this PR got buried. @brijeshb42 can you confirm if we can merge this one?

@brijeshb42
Copy link
Contributor

We can merge it as long as the example apps (during CI) are building correctly after rebasing.

@DiegoAndai DiegoAndai merged commit 2dacfe6 into mui:master Dec 20, 2024
19 checks passed
@oliviertassinari
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants