question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript performance during watch mode

See original GitHub issue

CRA performance can still be a pain with TypeScript.

We already reduce the waiting times for type-check by https://github.com/facebook/create-react-app/pull/5903, then we speed it up even more by using the IncrementalAPI in fork-ts-checker-webpack-plugin.

Unfortunately, even after all of these improvements, type-check can took 5 or more seconds to finish in big projects. Yes, it’s much better now as you can see your changes immediately and type-errors will appear when they are ready.

Now, the important thing:

I discover that using the isolatedModules: false in tsconfig.json reduces type-checks between code changes from 5 seconds to less than 1 second.

I know the reason, why we are using isolatedModules - it is a limitation of Babel compiler. However, we should definitely do something with it as developers are required to wait a lot of time just to catch a few edge cases.

I’m not sure how to solve it right now but I’m pretty sure that we can figure it out together.

cc @johnnyreilly (creator of fork-ts-checker-webpack-plugin)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
johnnyreillycommented, Jul 2, 2019

Credit where it’s due: @piotr-oles is the creator of fork-ts-checker-webpack-plugin - I’ve just worked on it an awful lot. And I’m louder 😁

In ts-loader we did fiddling with isolatedModules. I’ve actually forgotten most of the details. However here’s some links that should provide some useful info:

https://github.com/Microsoft/TypeScript/issues/16351

https://github.com/TypeStrong/ts-loader/pull/569

0reactions
deftomatcommented, Sep 17, 2019

Closing as fix will probably be available in TypeScript v3.7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to speed up your TypeScript project? - The Software House
In its raw form, running the `npm run watch` command (which starts the TypeScript Compiler – tsc – in a watch mode) takes...
Read more >
Documentation - Configuring Watch - TypeScript
Configuring Watch. Compiler supports configuring how to watch files and directories using compiler flags in TypeScript 3.8+, and environment variables before ...
Read more >
Announcing TypeScript 4.8 - Microsoft Developer Blogs
TypeScript 4.8 introduces several optimizations that should speed up scenarios around --watch and --incremental , along with project references ...
Read more >
fork-ts-checker-webpack-plugin - npm
Thanks to that it doesn't block the compilation. Used only in the watch mode. typescript, object, {}, See TypeScript options.
Read more >
Using Vue with TypeScript - Vue.js
You can run vue-tsc in watch mode in parallel to the Vite dev server, ... Volar provides a feature called "Takeover Mode" to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found