ts-checker-rspack-plugin 1.2.5 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/lib/getDependenciesWorker.js +1 -1
- package/lib/getIssuesWorker.js +8 -9
- package/lib/index.js +3709 -894
- package/lib/index.js.LICENSE.txt +13 -0
- package/package.json +28 -28
package/README.md
CHANGED
|
@@ -245,6 +245,21 @@ setting "generateTrace" compiler option. This is an instruction from [microsoft/
|
|
|
245
245
|
6. Open `types.json` in an editor
|
|
246
246
|
7. When you see a type ID in the tracing output, go-to-line {id} to find data about that type
|
|
247
247
|
|
|
248
|
+
## Performance optimization
|
|
249
|
+
|
|
250
|
+
This plugin delegates type checking to TypeScript, so overall performance is mostly determined by `tsc` itself.
|
|
251
|
+
|
|
252
|
+
If you need faster type checks, start by optimizing your TypeScript setup using the [official TypeScript performance guide](https://github.com/microsoft/TypeScript/wiki/Performance).
|
|
253
|
+
|
|
254
|
+
For example, properly configuring the `include` and `exclude` scopes in `tsconfig.json` can significantly reduce unnecessary type checking and improve TypeScript performance:
|
|
255
|
+
|
|
256
|
+
```json title="tsconfig.json"
|
|
257
|
+
{
|
|
258
|
+
"include": ["src"],
|
|
259
|
+
"exclude": ["**/node_modules", "**/.*/"]
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
248
263
|
## Enabling incremental mode
|
|
249
264
|
|
|
250
265
|
TypeScript's "incremental" mode speeds up initial cold-start typechecks keeping an on-disk cache.
|
|
@@ -663,7 +663,7 @@ const get_dependencies_worker_getDependenciesWorker = (change)=>{
|
|
|
663
663
|
return getDependencies();
|
|
664
664
|
};
|
|
665
665
|
exposeRpc(get_dependencies_worker_getDependenciesWorker);
|
|
666
|
-
for(var
|
|
666
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
667
667
|
Object.defineProperty(exports, '__esModule', {
|
|
668
668
|
value: true
|
|
669
669
|
});
|
package/lib/getIssuesWorker.js
CHANGED
|
@@ -1013,6 +1013,7 @@ function createWatchSolutionBuilderHost(parsedConfig, createProgram, reportDiagn
|
|
|
1013
1013
|
let solutionBuilderHost;
|
|
1014
1014
|
let solutionBuilder;
|
|
1015
1015
|
let hostDiagnostics = [];
|
|
1016
|
+
const HOST_DIAGNOSTICS_KEY = `GLOBAL_${worker_config_config.configFile}`;
|
|
1016
1017
|
function useSolutionBuilder() {
|
|
1017
1018
|
if (!solutionBuilderHost) {
|
|
1018
1019
|
const parsedConfig = getParsedConfig();
|
|
@@ -1021,16 +1022,14 @@ function useSolutionBuilder() {
|
|
|
1021
1022
|
return typescript.createSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
|
1022
1023
|
}, (diagnostic)=>{
|
|
1023
1024
|
hostDiagnostics.push(diagnostic);
|
|
1024
|
-
updateDiagnostics(
|
|
1025
|
+
updateDiagnostics(HOST_DIAGNOSTICS_KEY, hostDiagnostics);
|
|
1025
1026
|
}, (diagnostic)=>{
|
|
1026
|
-
if (6031 === diagnostic.code || 6032 === diagnostic.code)
|
|
1027
|
+
if (6031 === diagnostic.code || 6032 === diagnostic.code) {
|
|
1028
|
+
hostDiagnostics = [];
|
|
1029
|
+
updateDiagnostics(HOST_DIAGNOSTICS_KEY, hostDiagnostics);
|
|
1030
|
+
}
|
|
1027
1031
|
}, void 0, void 0, (builderProgram)=>{
|
|
1028
|
-
|
|
1029
|
-
const programDiagnostics = getDiagnosticsOfProgram(builderProgram);
|
|
1030
|
-
updateDiagnostics(programConfigFile, programConfigFile === worker_config_config.configFile ? [
|
|
1031
|
-
...programDiagnostics,
|
|
1032
|
-
...hostDiagnostics
|
|
1033
|
-
] : programDiagnostics);
|
|
1032
|
+
updateDiagnostics(getConfigFilePathFromBuilderProgram(builderProgram), getDiagnosticsOfProgram(builderProgram));
|
|
1034
1033
|
emitTsBuildInfoIfNeeded(builderProgram);
|
|
1035
1034
|
stopTracingIfNeeded(builderProgram);
|
|
1036
1035
|
});
|
|
@@ -1120,7 +1119,7 @@ const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
|
1120
1119
|
return issues;
|
|
1121
1120
|
};
|
|
1122
1121
|
exposeRpc(getIssuesWorker);
|
|
1123
|
-
for(var
|
|
1122
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
1124
1123
|
Object.defineProperty(exports, '__esModule', {
|
|
1125
1124
|
value: true
|
|
1126
1125
|
});
|