Description
Heya!
Maintainer of the fork-ts-checker-webpack-plugin here. Under the covers, the plugin uses the TypeScript incremental API. Various issues have been raised when using this with the level of CPU usage on idle; i.e. it's high!
- CPU usage on idle? TypeStrong/fork-ts-checker-webpack-plugin#236
- React-scripts/fork-ts-checker-webpack-plugin constant high CPU usage when using material/icons facebook/create-react-app#6792
The marvellous @NeKJ did some digging and discovered that this could be remedied by setting an environment variable: TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling
.
This changes the behaviour of TypeScripts approach to file watching in a highly desirable fashion. You can see details of @NeKJ's investigation here:
TypeStrong/fork-ts-checker-webpack-plugin#256
As you'll see, this is a PR for fork-ts-checker-webpack-plugin
that changes the TSC_WATCHFILE
environment variable. If we merge it the users of fork-ts-checker-webpack-plugin
should gain a better experience on the resources front.
However, it feels like this is potentially the wrong place to make this change. So before we merge and ship this I wanted to throw it back to you. If this affects users of fork-ts-checker-webpack-plugin
then I'd hazard a guess other people who use the API are being burned too. Changing the default in fork-ts-checker-webpack-plugin
won't help them.
Should the default file watching approach used by TypeScript be switched to TSC_WATCHFILE=UseFsEventsWithFallbackDynamicPolling
or similar? So all users of this API have a better experience?