-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Typescript pulls entire MUI library - super slow type checking #25085
Comments
It's possible that the package, or one of the packages it depends on, has a type declaration that is causing this slowness. If you look at issue 24435, you'll see that it's possible to get check times of It may be that the type is too complicated, or that the way it is written could be simplified. I'm not 100% sure it's the cause of your problems but it may be worth investigating. |
Thank you, that gives me a couple ideas how to try and debug this. I'll do it soon and report my findings here |
@weswigham can you take a look at the library and see what is causing the perf issues? |
@rpmonteiro do you have a list of the |
here are the imports being used, both for types, and components: type imports
component/method imports
|
Thank you for your comprehensive reply!! I'm going to do as you suggest, and report my findings ASAP. Thanks again |
Alright... I think Grid is a generic component (iirc); what do your usages of |
We found a similar repro from Developer Community (slow checking with MUI, seems to use Grid a lot as well) and will be investigating from that one - almost certainly the root cause is the same. Thanks for the help so far! |
Amazing! The entire team and I are very happy with the once again blazing fast performance. Thank you, guys!! |
TypeScript Version: 2.9.2
Search Terms:
MUI slow typescript
TSC compiles all MUI files
Code
In a react project, I use the UI library MUI (1.0).
In total, I'm doing around 15 imports of this library, always in the following way:
import CircularProgress from '@material-ui/core/CircularProgress/CircularProgress';
tsconfig.json
Expected behavior:
TS picks up only the type definitions it needs from that library. (around 20 files, as I counted)
Code compiles in 3-6 seconds, if I remove MUI (with lots of errors, certainly)
Actual behavior:
TS pulls the entire MUI library, with over 600.000 types
Compilation (type checking) usually takes >1min
tsc --extendedDiagnostics --listFiles --noEmit
and it goes on...
I would expect this to happen if I was importing from the
core
modules, which exports all types, but I am most definitely not.Related Issues:
No :( I found other cases of slow compilation, but not of this sort.
The text was updated successfully, but these errors were encountered: