DefinitelyTyped / DefinitelyTyped/DefinitelyTyped
[@types/styled-components] tsserver running at 100% CPU
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 51.4k
- Forks
- 30.4k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 108
Description
If you know how to fix the issue, make a pull request instead.
- I tried using the
@types/xxxxpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @Igorbek @Igmat @lavoaster @Jessidhia
Versions
@types/styled-components@4.1.14typescript@3.3.3
Summary
Upon upgrading to the latest version of @types/styled-components and using VS Code, I noticed that editing typescript files was suddenly causing my CPU usage to jump to 100%. My editor's typescript auto-complete features and lint warnings suddenly took multiple seconds to resolve after typing each character.
On further investigation, I could see that tsserver.js was responsible for all of that CPU usage. Downgrading one version at a time, I was able to isolate the performance slowdown to something that changed between @types/styled-components@4.0.3 and @types/styled-components@4.1.0.
It looks like the two commits added in that version are:
To reproduce
- In a new typescript project:
yarn add typescript@3.3.3 styled-components@4.2.0 @types/styled-components@4.1.0
- Import
styled-componentsand begin editing the file.
This issue seems similar, but not exactly the same: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34391
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the slowdown with the listed TypeScript, styled-components, and @types/styled-components versions, then compare the two linked commits that changed the styled-components definitions. Confirm the fix removes the tsserver 100% CPU behavior and restores responsive autocomplete and lint warnings while editing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100