Skip to content

createStyles typings slows down typescript type checking #18789

@beholderrk

Description

@beholderrk
  • 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 : 20

Checking time after update

# [email protected] @material-ui/[email protected] @material-ui/[email protected]
PS> time tsc -p tsconfig.json
TotalSeconds : 63

If I change createStyles.d.ts definition like this
image
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 : 20

Expected 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions