refactor(ivy): compute ignoreFiles for compilation on initialization (#34792)
This commit moves the calculation of `ignoreFiles` - the set of files to be ignored by a consumer of the `NgCompiler` API - from its `prepareEmit` operation to its initialization. It's now available as a field on `NgCompiler`. This will allow a consumer to skip gathering diagnostics for `ignoreFiles` as well as skip emit. PR Close #34792
This commit is contained in:

committed by
Misko Hevery

parent
49dd7b6a0a
commit
14aa6d090e
@ -22,9 +22,11 @@ const STRIP_NG_FACTORY = /(.*)NgFactory$/;
|
||||
* class of an input ts.SourceFile.
|
||||
*/
|
||||
export class FactoryGenerator implements ShimGenerator {
|
||||
private constructor(private map: Map<string, string>) {}
|
||||
private constructor(private map: Map<AbsoluteFsPath, AbsoluteFsPath>) {}
|
||||
|
||||
get factoryFileMap(): Map<string, string> { return this.map; }
|
||||
get factoryFileMap(): Map<AbsoluteFsPath, AbsoluteFsPath> { return this.map; }
|
||||
|
||||
get factoryFileNames(): AbsoluteFsPath[] { return Array.from(this.map.keys()); }
|
||||
|
||||
recognize(fileName: AbsoluteFsPath): boolean { return this.map.has(fileName); }
|
||||
|
||||
@ -101,7 +103,7 @@ export class FactoryGenerator implements ShimGenerator {
|
||||
}
|
||||
|
||||
static forRootFiles(files: ReadonlyArray<AbsoluteFsPath>): FactoryGenerator {
|
||||
const map = new Map<AbsoluteFsPath, string>();
|
||||
const map = new Map<AbsoluteFsPath, AbsoluteFsPath>();
|
||||
files.filter(sourceFile => isNonDeclarationTsPath(sourceFile))
|
||||
.forEach(
|
||||
sourceFile =>
|
||||
|
@ -15,9 +15,9 @@ import {ShimGenerator} from './api';
|
||||
import {generatedModuleName} from './util';
|
||||
|
||||
export class SummaryGenerator implements ShimGenerator {
|
||||
private constructor(private map: Map<AbsoluteFsPath, string>) {}
|
||||
private constructor(private map: Map<AbsoluteFsPath, AbsoluteFsPath>) {}
|
||||
|
||||
getSummaryFileNames(): string[] { return Array.from(this.map.keys()); }
|
||||
getSummaryFileNames(): AbsoluteFsPath[] { return Array.from(this.map.keys()); }
|
||||
|
||||
recognize(fileName: AbsoluteFsPath): boolean { return this.map.has(fileName); }
|
||||
|
||||
@ -78,7 +78,7 @@ export class SummaryGenerator implements ShimGenerator {
|
||||
}
|
||||
|
||||
static forRootFiles(files: ReadonlyArray<AbsoluteFsPath>): SummaryGenerator {
|
||||
const map = new Map<AbsoluteFsPath, string>();
|
||||
const map = new Map<AbsoluteFsPath, AbsoluteFsPath>();
|
||||
files.filter(sourceFile => isNonDeclarationTsPath(sourceFile))
|
||||
.forEach(
|
||||
sourceFile =>
|
||||
|
Reference in New Issue
Block a user