Skip to content

Add DISABLE_TSC_PLUGIN advanced configuration flag #11671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LinusU
Copy link

@LinusU LinusU commented Nov 20, 2021

Fixes #5784

This patch adds an additional environment flag: DISABLE_TSC_PLUGIN. When set to true it will skip type checking the code using the TypeScript compiler (via fork-ts-checker-webpack-plugin).

It was modeled to follow how DISABLE_ESLINT_PLUGIN work:

  ESLint TSC
Ignore errors ESLINT_NO_DEV_ERRORS TSC_COMPILE_ON_ERROR
Disable plugin DISABLE_ESLINT_PLUGIN DISABLE_TSC_PLUGIN

This is useful because some libraries that (ab?)uses the TypeScript type system can cause significant CPU usage. While I love that those libraries can bring type safety to very dynamic problems, it slows the machine down when developing...

@raix
Copy link
Contributor

raix commented Dec 12, 2021

@LinusU if I understand the motivation here it's about performance only right?
I'm pushing back abit on adding more custom configurations, we try to keep it to a minimum - yes, the setting might solve the symptom but not the problem.

In CRA v5 we have enabled incremental builds setting for the forkTypeCheckerPlugin - not sure if it solves the performance issue you are facing?

(The motivation for disabling Eslint was maybe not so much about performance as about BYO eslint setup afaik)

@LinusU
Copy link
Author

LinusU commented Dec 13, 2021

@raix my use case is really that I'm already running the type checker in my editor and I would prefer to not get any errors from type checking whilst editing.

In addition to that I'm having performance problems where my editor (VS Code) is super slow to provide type checking and autocomplete suggestions without the flag that I introduced in this PR. I'm not sure if this is actually CPU bound, or if there is some cache or other file-lock that make them compete with each other. If you want to try this out, my project is here: https://github.com/LinusU/beer-recipe-editor

Running npm start and also editing the files in VS Code makes the type checking/autocomplete super slow.

(Is there any documentation for version 5 available?)

@raix
Copy link
Contributor

raix commented Dec 14, 2021

@LinusU we just released v5 - let me know if still suffering from performance issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable static type checking for typescript
3 participants