-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
createStyles typings slows down typescript type checking #18789
Copy link
Copy link
Closed
Labels
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
createStyles function typings slow down typescript type checking by ~3 times in our case.
An attempt was made to move from @material-ui/[email protected] to @material-ui/[email protected] @material-ui/[email protected] which led to a decrease in build performance by 3 times.
Also, my vscode now works with large delays (~10s) on type checking or intellisence.
Checking time before update
# [email protected] @material-ui/[email protected]
PS> time tsc -p tsconfig.json
TotalSeconds : 20Checking time after update
# [email protected] @material-ui/[email protected] @material-ui/[email protected]
PS> time tsc -p tsconfig.json
TotalSeconds : 63If I change createStyles.d.ts definition like this

then checking time returns to normal 20s.
Checking time after fix typings in @material-ui/styles
# [email protected] @material-ui/[email protected] @material-ui/styles@fixed-types
PS> time tsc -p tsconfig.json
TotalSeconds : 20Expected Behavior 🤔
Type checking time is about the same for 3.9.2 version
Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | v4.7.2 |
| React | 16.11.0 |
| TypeScript | 3.7.3 |
| System | Windows 10 |
Reactions are currently unavailable