Skip to content

Commit 046dad1

Browse files
committed
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
1 parent 989e840 commit 046dad1

File tree

1 file changed

+1
-1
lines changed
  • packages/compiler-cli/src/ngtsc/annotations/src

1 file changed

+1
-1
lines changed

packages/compiler-cli/src/ngtsc/annotations/src/pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class PipeDecoratorHandler implements
148148
}
149149

150150
symbol(node: ClassDeclaration, analysis: Readonly<PipeHandlerData>): PipeSymbol {
151-
return new PipeSymbol(node, analysis.meta.name);
151+
return new PipeSymbol(node, analysis.meta.pipeName);
152152
}
153153

154154
register(node: ClassDeclaration, analysis: Readonly<PipeHandlerData>): void {

0 commit comments

Comments
 (0)