From 046dad1a8d878ea537a6e2ef5f5ef24a85a2cf02 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Tue, 29 Mar 2022 17:58:24 -0700 Subject: [PATCH] fix(compiler-cli): fix issue with incremental tracking of APIs for pipes (#45672) `PipeSymbol` contains logic to detect changes in the public API surface of pipes, which includes the pipe name. However, the pipe handler inadvertently uses the pipe class name instead of the actual pipe name to initialize the `PipeSymbol`, which breaks incremental compilation when pipe names change. There is a test which attempts to verify that this logic is working, but the test actually passes for a different reason. The test swaps the names of 2 pipes that are both used in a component, and asserts that the component is re-emitted, theoretically because the public APIs of the pipes is changed. However, the emit order of the references to the pipes depends on the order in which they match in the template, which changes when the names are swapped. This ordering dependency is picked up by the semantic dependency tracking system, and is what actually causes the component to be re-emitted and therefore the pipe test to pass in spite of the bug with name tracking. This commit fixes the `PipeSymbol` initialization to use the correct pipe name. The test is still flawed in that it's sensitive to the ordering of pipe emits, but this ordering is due to change soon as a result of the standalone components work, so this issue will be resolved in a future commit. PR Close #45672 --- packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts b/packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts index 6b71133ae13..685de36f351 100644 --- a/packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts +++ b/packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts @@ -148,7 +148,7 @@ export class PipeDecoratorHandler implements } symbol(node: ClassDeclaration, analysis: Readonly): PipeSymbol { - return new PipeSymbol(node, analysis.meta.name); + return new PipeSymbol(node, analysis.meta.pipeName); } register(node: ClassDeclaration, analysis: Readonly): void {