-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[code-infra] Avoid loading barrel file during type checking #46177
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
Conversation
Netlify deploy previewhttps://deploy-preview-46177--material-ui.netlify.app/ Bundle size report |
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 suppose these imports can be caused by some IDE configs, would there be an eslint rule so we can block these? 🤔
I moved the internal type to
Quite hard to do with |
Edit: Issue might be in PR itself |
👍 Ok, let me know. |
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.
Thanks @Janpot
Noticed during type checking of the following:
That it loaded the whole type declarations for
@mui/material
top-level barrel file:I saw there were lots of imports from
'..'
in the individual subpaths. This is wasteful, better to import more deeply.after:
You can see there's still a large chunk being loaded for them, it still imports all component props for the theme. But it's already about 30% faster (according to those two traces, I didn't sample multiple runs).