-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] Fix proptypes generation when multiple components per file #44058
Conversation
Netlify deploy previewhttps://deploy-preview-44058--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
The newly added proptypes don't add any value as they annotate internal components (and they duplicate what's already there in public components). We should add |
Doesn't this flag work on a per-file basis? These files also contain a public component as far as I understand. |
Right, in this case, it sucks :/ |
Didn't want to waste too much time on it and assumed it was better to rather have those proptypes there than the bug, even though it's at least 4 years old. |
After this change, we are facing problems on mui/mui-x#14937.
Any ideas on how to proceed with the mentioned PR? 🤔 |
🤔 As far as I understand
I remember trying this PR out on X, didn't see changes, I must have messed up. |
Ok, let's go with this approach. 👌 |
Reviewing proptypes generation code for mui/mui-public#209, I noticed this bug. original proptypes were replaced without checking for multiple instances in the file. I'm replacing the single
originalPropTypesPath
with a map that maps each component to its ownoriginalPropTypesPath
.This generated some new proptypes for two memoized components, which doesn't support a
.propTypes
property, this lead to build errors. I assign the inner components to intermediate variables to solve those.It looks like there's a similar thing going on with
previousPropTypesSource
as well, applied the same fix, which didn't result in any changes.