From b87d650da28333aacf5d04333b0ed80804693d5f Mon Sep 17 00:00:00 2001 From: JoostK Date: Sun, 13 May 2018 18:29:45 +0200 Subject: [PATCH] refactor(ivy): rename `PipeDef.n` to `PipeDef.factory` (#23883) The original reason for this property to be short no longer holds true, as pipes always need to be defined using `definePipe`. PR Close #23883 --- packages/core/src/render3/definition.ts | 2 +- packages/core/src/render3/interfaces/definition.ts | 7 ++----- packages/core/src/render3/pipe.ts | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/core/src/render3/definition.ts b/packages/core/src/render3/definition.ts index da3c36e1c5..dbe6f53663 100644 --- a/packages/core/src/render3/definition.ts +++ b/packages/core/src/render3/definition.ts @@ -431,7 +431,7 @@ export function definePipe(pipeDef: { }): never { return (>{ name: pipeDef.name, - n: pipeDef.factory, + factory: pipeDef.factory, pure: pipeDef.pure !== false, onDestroy: pipeDef.type.prototype.ngOnDestroy || null }) as never; diff --git a/packages/core/src/render3/interfaces/definition.ts b/packages/core/src/render3/interfaces/definition.ts index 4395efdca8..dc41b96f33 100644 --- a/packages/core/src/render3/interfaces/definition.ts +++ b/packages/core/src/render3/interfaces/definition.ts @@ -204,12 +204,9 @@ export interface PipeDef { name: string; /** - * factory function used to create a new directive instance. - * - * NOTE: this property is short (1 char) because it is used in - * component templates which is sensitive to size. + * Factory function used to create a new pipe instance. */ - n: () => T; + factory: () => T; /** * Whether or not the pipe is pure. diff --git a/packages/core/src/render3/pipe.ts b/packages/core/src/render3/pipe.ts index fd9031ca07..7f736721f7 100644 --- a/packages/core/src/render3/pipe.ts +++ b/packages/core/src/render3/pipe.ts @@ -33,7 +33,7 @@ export function pipe(index: number, pipeName: string): any { pipeDef = tView.data[index] as PipeDef; } - const pipeInstance = pipeDef.n(); + const pipeInstance = pipeDef.factory(); store(index, pipeInstance); return pipeInstance; }