feat(ivy): add more DOM manipulation counters to ngDevMode (#30315)
PR Close #30315
This commit is contained in:
parent
4a96ddfb54
commit
de651122a5
|
@ -620,6 +620,7 @@ function getHostNative(currentView: LView): RElement|null {
|
||||||
*/
|
*/
|
||||||
export function nativeInsertBefore(
|
export function nativeInsertBefore(
|
||||||
renderer: Renderer3, parent: RElement, child: RNode, beforeNode: RNode | null): void {
|
renderer: Renderer3, parent: RElement, child: RNode, beforeNode: RNode | null): void {
|
||||||
|
ngDevMode && ngDevMode.rendererInsertBefore++;
|
||||||
if (isProceduralRenderer(renderer)) {
|
if (isProceduralRenderer(renderer)) {
|
||||||
renderer.insertBefore(parent, child, beforeNode);
|
renderer.insertBefore(parent, child, beforeNode);
|
||||||
} else {
|
} else {
|
||||||
|
@ -628,6 +629,7 @@ export function nativeInsertBefore(
|
||||||
}
|
}
|
||||||
|
|
||||||
function nativeAppendChild(renderer: Renderer3, parent: RElement, child: RNode): void {
|
function nativeAppendChild(renderer: Renderer3, parent: RElement, child: RNode): void {
|
||||||
|
ngDevMode && ngDevMode.rendererAppendChild++;
|
||||||
if (isProceduralRenderer(renderer)) {
|
if (isProceduralRenderer(renderer)) {
|
||||||
renderer.appendChild(parent, child);
|
renderer.appendChild(parent, child);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -30,6 +30,8 @@ declare global {
|
||||||
rendererDestroyNode: number;
|
rendererDestroyNode: number;
|
||||||
rendererMoveNode: number;
|
rendererMoveNode: number;
|
||||||
rendererRemoveNode: number;
|
rendererRemoveNode: number;
|
||||||
|
rendererAppendChild: number;
|
||||||
|
rendererInsertBefore: number;
|
||||||
rendererCreateComment: number;
|
rendererCreateComment: number;
|
||||||
styleMap: number;
|
styleMap: number;
|
||||||
styleMapCacheMiss: number;
|
styleMapCacheMiss: number;
|
||||||
|
@ -63,6 +65,8 @@ export function ngDevModeResetPerfCounters(): NgDevModePerfCounters {
|
||||||
rendererDestroyNode: 0,
|
rendererDestroyNode: 0,
|
||||||
rendererMoveNode: 0,
|
rendererMoveNode: 0,
|
||||||
rendererRemoveNode: 0,
|
rendererRemoveNode: 0,
|
||||||
|
rendererAppendChild: 0,
|
||||||
|
rendererInsertBefore: 0,
|
||||||
rendererCreateComment: 0,
|
rendererCreateComment: 0,
|
||||||
styleMap: 0,
|
styleMap: 0,
|
||||||
styleMapCacheMiss: 0,
|
styleMapCacheMiss: 0,
|
||||||
|
|
Loading…
Reference in New Issue