feat(ivy): add more DOM manipulation counters to ngDevMode (#30315)

PR Close #30315
This commit is contained in:
Pawel Kozlowski 2019-05-07 23:56:37 +02:00 committed by Alex Rickabaugh
parent 4a96ddfb54
commit de651122a5
2 changed files with 6 additions and 0 deletions

View File

@ -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 {

View File

@ -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,