Definitelytyped: [@types/styled-components]

Created on 11 Apr 2019  路  2Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/styled-components package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x]

    • Authors: @eps1lon @Igorbek @Jessidhia

The problem is that styled components types makes my typescript intellisense work real slow. It takes sometimes up to 100% CPU. I found out that this particular line

export type ThemedStyledProps<P, T> = P & ThemeProps<T>;

is causing troubles. Once you remove P & it works again as normal.

Most helpful comment

Hi, I have the same issue. Typescript version and @types/styled-components version give a big impact on performance.

Results on some not cleare repo

Typescript 3.4.3, @types/styled-components 4.1.14, Vscode 1.33.1
yarn tsc  66.81s user 0.95s system 106% cpu 1:03.74 total

VS

Typescript 3.4.3, @types/styled-components 4.1.5, Vscode 1.33.1
yarn tsc  56.45s user 0.79s system 108% cpu 52.669 total

VS

Typescript 3.3.4000, @types/styled-components 4.1.5, Vscode 1.33.1
yarn tsc  41.79s user 0.62s system 106% cpu 39.667 total

And I've tried to reproduce this issue on cleare repo.
The Impact is huge 61.44s. vs 3.92s.
https://github.com/kolengri/reakit-perfomance-issue

All 2 comments

Please include the exact version of @types/styled-components, typescript and vscode. Likely a duplicate of #34391.

Hi, I have the same issue. Typescript version and @types/styled-components version give a big impact on performance.

Results on some not cleare repo

Typescript 3.4.3, @types/styled-components 4.1.14, Vscode 1.33.1
yarn tsc  66.81s user 0.95s system 106% cpu 1:03.74 total

VS

Typescript 3.4.3, @types/styled-components 4.1.5, Vscode 1.33.1
yarn tsc  56.45s user 0.79s system 108% cpu 52.669 total

VS

Typescript 3.3.4000, @types/styled-components 4.1.5, Vscode 1.33.1
yarn tsc  41.79s user 0.62s system 106% cpu 39.667 total

And I've tried to reproduce this issue on cleare repo.
The Impact is huge 61.44s. vs 3.92s.
https://github.com/kolengri/reakit-perfomance-issue

Was this page helpful?
0 / 5 - 0 ratings