-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Disable static type checking for typescript #5784
Comments
Going through the same problem. If you rewrite tsConfig.json it goes back to previous fixed format! Weird! |
+1 for that. |
add SKIP_TYPE_CHECK env to disable typescript type checking fix facebook#5784
My workaround:
const path = require('path');
module.exports = function override(config) {
config.plugins = config.plugins.filter(plugin => {
return plugin.constructor.name !== 'ForkTsCheckerWebpackPlugin';
});
return config;
}; |
Looks like no longer works with latest, do you have any other alternative to this? |
https://create-react-app.dev/docs/advanced-configuration/#! ctr+f TSC_COMPILE_ON_ERROR |
Ah yes looks like we provided an escape hatch to satisfy this issue. Closing! |
@ianschmitz I disagree with closing this issue. The FLAG only allows to run the project on faulty compilation (and adresses only 1 out of 4 points raised). It is still not possible to completely disable the compilation. |
We run the type checking asynchronous from the compile now. The impact should be low. If you can provide concrete examples of before/after time comparisons that show the type checking is negatively impacting build times I'd be happy to reconsider! |
In my case it impacts on development time. VSCode is already type checking the project and I hardly ever check the terminal for type errors. They're better displayed in the editor. |
Understood. But are you experiencing slower compilation time as a result compared to if type checking was disabled? If not then I don't see the harm. If so then I would love to see comparison metrics to understand the cost in your specific project. |
My case might be more suitable for another "issue" then? Because the compilation time is not significantly impactful in my case. |
@ianschmitz as much as I appreciate the efforts you guys put into this project, I do not agree with this argument. The compilation is taking unnecessary resources, cpu, memory ... which on many machines are thin as it is. I explored my case and in my reasonably sized project the compiler takes 320mb of memory and jumps between 5-25% cpu time on my MB pro 2017. Being a bit @ss about it, we can also let SETI run in the background since it will only marginally affect compilation time. The CRA is already heavy as it is and some level of co figuration would be greatly appreciated. |
I strongly agree with @tomitrescak here, if you use vscode, the Currently bypassing this requires advanced fragile hacks (excluding Regarding the performance impact. In my small to medium sized monorepo (with roughly 100 ts files using a ts-enabled UI framework, ant-design, results are:
So roughly 100% performance penalty on every save! react-app-rewired module.exports = {
// The Webpack config to use when compiling your react app for development or production.
webpack(config, env) {
// Drop noisy eslint pre-rule
config.module.rules.splice(1, 1);
// Drop noisy tslint plugin
const EXCLUDED_PLUGINS = ['ForkTsCheckerWebpackPlugin'];
config.plugins = config.plugins.filter(plugin => !EXCLUDED_PLUGINS.includes(plugin.constructor.name));
return config;
},
// The paths config to use when compiling your react app for development or production.
paths: function(paths, env) {
// Disable react-scripts TypeScript handling
paths.appTsConfig = '';
return paths;
}
}; |
NOT
Hi, I love how easy is to include typescript, but I was wondering whether it would be possible to disable static type checking and let only Babel strip types. The reasons are following:
All and all I think static type check is great during build times, but at dev stage it comes in the way.
What do you think? Can you maybe point me to place where I could disable it? Thanks
The text was updated successfully, but these errors were encountered: