From de651122a5dbd119f388198ab0d68275d672c41f Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Tue, 7 May 2019 23:56:37 +0200 Subject: [PATCH] feat(ivy): add more DOM manipulation counters to ngDevMode (#30315) PR Close #30315 --- packages/core/src/render3/node_manipulation.ts | 2 ++ packages/core/src/util/ng_dev_mode.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/core/src/render3/node_manipulation.ts b/packages/core/src/render3/node_manipulation.ts index 3932c785e8..2392393567 100644 --- a/packages/core/src/render3/node_manipulation.ts +++ b/packages/core/src/render3/node_manipulation.ts @@ -620,6 +620,7 @@ function getHostNative(currentView: LView): RElement|null { */ export function nativeInsertBefore( renderer: Renderer3, parent: RElement, child: RNode, beforeNode: RNode | null): void { + ngDevMode && ngDevMode.rendererInsertBefore++; if (isProceduralRenderer(renderer)) { renderer.insertBefore(parent, child, beforeNode); } else { @@ -628,6 +629,7 @@ export function nativeInsertBefore( } function nativeAppendChild(renderer: Renderer3, parent: RElement, child: RNode): void { + ngDevMode && ngDevMode.rendererAppendChild++; if (isProceduralRenderer(renderer)) { renderer.appendChild(parent, child); } else { diff --git a/packages/core/src/util/ng_dev_mode.ts b/packages/core/src/util/ng_dev_mode.ts index 6f34ba24ab..d70d65c44a 100644 --- a/packages/core/src/util/ng_dev_mode.ts +++ b/packages/core/src/util/ng_dev_mode.ts @@ -30,6 +30,8 @@ declare global { rendererDestroyNode: number; rendererMoveNode: number; rendererRemoveNode: number; + rendererAppendChild: number; + rendererInsertBefore: number; rendererCreateComment: number; styleMap: number; styleMapCacheMiss: number; @@ -63,6 +65,8 @@ export function ngDevModeResetPerfCounters(): NgDevModePerfCounters { rendererDestroyNode: 0, rendererMoveNode: 0, rendererRemoveNode: 0, + rendererAppendChild: 0, + rendererInsertBefore: 0, rendererCreateComment: 0, styleMap: 0, styleMapCacheMiss: 0,