Skip to content

Performance with isolatedModules=true #32294

Closed
@deftomat

Description

@deftomat

TypeScript Version: 3.6.0-dev.20190704 | 3.5.2

Search Terms: isolatedModules, performance

We discovered that using isolatedModules=false in React apps drastically decrease type-check times. For example, in our application, tsc --watch --noEmit can took 5 seconds with isolatedModules=true. However, when we change it to isolatedModules=false, then the incremental type-check took 1 second or less.

The obvious solution is to disable isolated modules. Unfortunately, our application us create-react-app which use Babel to compile TS into JS and fork-ts-checker-webpack-plugin to run type-checks.

Due to Babel limitations, isolatedModules=true is a recommended option. TypeScript is definitely fast enough to make developers happy but we are forced to wait a lot of seconds just to catch a few edge cases.

So, my question is: Is this a bug or just a limitation of isolatedModules option?

Being able to use TypeScript in existing Babel toolchains is a huge thing but we are missing the last thing: SPEED 😞

(Related to facebook/create-react-app#7309)

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions