Skip to content

Commit 0c69328

Browse files
committed
Revert "perf(@angular/build): skip semantic affected-file walk when type checking is disabled"
This reverts commit 2462709.
1 parent ecc7aba commit 0c69328

2 files changed

Lines changed: 3 additions & 110 deletions

File tree

packages/angular/build/src/tools/angular/compilation/aot-compilation.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type * as ng from '@angular/compiler-cli';
1010
import assert from 'node:assert';
1111
import { relative } from 'node:path';
1212
import ts from 'typescript';
13-
import { useTypeChecking } from '../../../utils/environment-options';
1413
import { profileAsync, profileSync } from '../../esbuild/profiling';
1514
import {
1615
AngularHostOptions,
@@ -176,19 +175,9 @@ export class AotCompilation extends AngularCompilation {
176175
}
177176
}
178177

179-
// The affected files walk runs a full semantic type-check as a side effect
180-
// (via `getSemanticDiagnosticsOfNextAffectedFile`). Its result is only consumed to
181-
// scope Angular template diagnostics and to force re-emit of TS-affected files in the
182-
// slow TypeScript emit path. When type-checking is disabled, template/semantic
183-
// diagnostics are already suppressed at the consumption layer (see the compiler-plugin
184-
// `diagnoseFiles` mask), and in the isolatedModules fast path emit is per-file, so the
185-
// set is never read. Skip the walk in that case to avoid a discarded semantic pass.
186-
const affectedFiles =
187-
useTypeChecking || useTypeScriptTranspilation
188-
? profileSync('NG_FIND_AFFECTED', () =>
189-
findAffectedFiles(typeScriptProgram, angularCompiler, usingBuildInfo),
190-
)
191-
: new Set<ts.SourceFile>();
178+
const affectedFiles = profileSync('NG_FIND_AFFECTED', () =>
179+
findAffectedFiles(typeScriptProgram, angularCompiler, usingBuildInfo),
180+
);
192181

193182
const componentResourcesDependencies = new Map<string, string[]>();
194183

tests/e2e/tests/build/type-check-disabled-emit.ts

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)