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 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 __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
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
  });
@@ -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(worker_config_config.configFile, hostDiagnostics);
1025
+ updateDiagnostics(HOST_DIAGNOSTICS_KEY, hostDiagnostics);
1025
1026
  }, (diagnostic)=>{
1026
- if (6031 === diagnostic.code || 6032 === diagnostic.code) hostDiagnostics = [];
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
- const programConfigFile = getConfigFilePathFromBuilderProgram(builderProgram);
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 __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
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
  });