diff --git a/packages/compiler-cli/ngcc/src/execution/api.ts b/packages/compiler-cli/ngcc/src/execution/api.ts index 65b9a45eed..4a0ac9fe95 100644 --- a/packages/compiler-cli/ngcc/src/execution/api.ts +++ b/packages/compiler-cli/ngcc/src/execution/api.ts @@ -8,11 +8,14 @@ import {EntryPoint, EntryPointJsonProperty} from '../packages/entry_point'; -/** The type of the function that analyzes entry-points and creates the list of tasks. */ -export type AnalyzeEntryPointsFn = () => { - processingMetadataPerEntryPoint: Map; - tasks: Task[]; -}; + +/** + * The type of the function that analyzes entry-points and creates the list of tasks. + * + * @return A list of tasks that need to be executed in order to process the necessary format + * properties for all entry-points. + */ +export type AnalyzeEntryPointsFn = () => Task[]; /** The type of the function that can process/compile a task. */ export type CompileFn = (task: Task) => void; @@ -29,15 +32,6 @@ export interface Executor { void|Promise; } -/** Represents metadata related to the processing of an entry-point. */ -export interface EntryPointProcessingMetadata { - /** - * Whether the typings for the entry-point have been successfully processed (or were already - * processed). - */ - hasProcessedTypings: boolean; -} - /** Represents a unit of work: processing a specific format property of an entry-point. */ export interface Task { /** The `EntryPoint` which needs to be processed as part of the task. */ diff --git a/packages/compiler-cli/ngcc/src/execution/single_process_executor.ts b/packages/compiler-cli/ngcc/src/execution/single_process_executor.ts index 7ee55e6f50..aa962113ce 100644 --- a/packages/compiler-cli/ngcc/src/execution/single_process_executor.ts +++ b/packages/compiler-cli/ngcc/src/execution/single_process_executor.ts @@ -22,10 +22,9 @@ export class SingleProcessExecutor implements Executor { execute(analyzeEntryPoints: AnalyzeEntryPointsFn, createCompileFn: CreateCompileFn): void { this.logger.debug(`Running ngcc on ${this.constructor.name}.`); - const {processingMetadataPerEntryPoint, tasks} = analyzeEntryPoints(); - const compile = createCompileFn( - (task, outcome) => - onTaskCompleted(this.pkgJsonUpdater, processingMetadataPerEntryPoint, task, outcome)); + const tasks = analyzeEntryPoints(); + const compile = + createCompileFn((task, outcome) => onTaskCompleted(this.pkgJsonUpdater, task, outcome)); // Process all tasks. for (const task of tasks) { diff --git a/packages/compiler-cli/ngcc/src/execution/utils.ts b/packages/compiler-cli/ngcc/src/execution/utils.ts index d7c66df2fe..418e571939 100644 --- a/packages/compiler-cli/ngcc/src/execution/utils.ts +++ b/packages/compiler-cli/ngcc/src/execution/utils.ts @@ -11,14 +11,12 @@ import {markAsProcessed} from '../packages/build_marker'; import {PackageJsonFormatProperties} from '../packages/entry_point'; import {PackageJsonUpdater} from '../writing/package_json_updater'; -import {EntryPointProcessingMetadata, Task, TaskProcessingOutcome} from './api'; +import {Task, TaskProcessingOutcome} from './api'; /** A helper function for handling a task's being completed. */ export const onTaskCompleted = - (pkgJsonUpdater: PackageJsonUpdater, - processingMetadataPerEntryPoint: Map, task: Task, - outcome: TaskProcessingOutcome, ): void => { + (pkgJsonUpdater: PackageJsonUpdater, task: Task, outcome: TaskProcessingOutcome): void => { const {entryPoint, formatPropertiesToMarkAsProcessed, processDts} = task; if (outcome === TaskProcessingOutcome.Processed) { @@ -27,8 +25,6 @@ export const onTaskCompleted = [...formatPropertiesToMarkAsProcessed]; if (processDts) { - const processingMeta = processingMetadataPerEntryPoint.get(entryPoint.path) !; - processingMeta.hasProcessedTypings = true; propsToMarkAsProcessed.push('typings'); } diff --git a/packages/compiler-cli/ngcc/src/main.ts b/packages/compiler-cli/ngcc/src/main.ts index dbfc2abc56..caae5c489f 100644 --- a/packages/compiler-cli/ngcc/src/main.ts +++ b/packages/compiler-cli/ngcc/src/main.ts @@ -16,7 +16,7 @@ import {ModuleResolver} from './dependencies/module_resolver'; import {UmdDependencyHost} from './dependencies/umd_dependency_host'; import {DirectoryWalkerEntryPointFinder} from './entry_point_finder/directory_walker_entry_point_finder'; import {TargetedEntryPointFinder} from './entry_point_finder/targeted_entry_point_finder'; -import {AnalyzeEntryPointsFn, CreateCompileFn, EntryPointProcessingMetadata, Executor, Task, TaskProcessingOutcome} from './execution/api'; +import {AnalyzeEntryPointsFn, CreateCompileFn, Executor, Task, TaskProcessingOutcome} from './execution/api'; import {AsyncSingleProcessExecutor, SingleProcessExecutor} from './execution/single_process_executor'; import {ConsoleLogger, LogLevel} from './logging/console_logger'; import {Logger} from './logging/logger'; @@ -138,7 +138,6 @@ export function mainNgcc( fileSystem, pkgJsonUpdater, logger, dependencyResolver, config, absBasePath, targetEntryPointPath, pathMappings, supportedPropertiesToConsider, compileAllFormats); - const processingMetadataPerEntryPoint = new Map(); const unprocessableEntryPointPaths: string[] = []; const tasks: Task[] = []; @@ -165,8 +164,6 @@ export function mainNgcc( // Only process typings for the first property (if not already processed). processDts = false; } - - processingMetadataPerEntryPoint.set(entryPoint.path, {hasProcessedTypings}); } // Check for entry-points for which we could not process any format at all. @@ -177,7 +174,7 @@ export function mainNgcc( unprocessableEntryPointPaths.map(path => `\n - ${path}`).join('')); } - return {processingMetadataPerEntryPoint, tasks}; + return tasks; }; // The function for creating the `compile()` function.