refactor(core): use performance API for afterRender feature logging (#52235)

Add a standard performance marker that can be viewed in Chrome Dev Tools and other tooling. See more info at https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark

PR Close #52235
This commit is contained in:
Gerald Monaco
2023-10-16 19:59:44 +00:00
committed by Dylan Hunn
parent f5aed23924
commit f206d1041f
@@ -224,6 +224,8 @@ export function afterRender(callback: VoidFunction, options?: AfterRenderOptions
return NOOP_AFTER_RENDER_REF;
}
performance.mark('mark_use_counter', {detail: {feature: 'NgAfterRender'}});
const afterRenderEventManager = injector.get(AfterRenderEventManager);
// Lazily initialize the handler implementation, if necessary. This is so that it can be
// tree-shaken if `afterRender` and `afterNextRender` aren't used.
@@ -298,6 +300,8 @@ export function afterNextRender(
return NOOP_AFTER_RENDER_REF;
}
performance.mark('mark_use_counter', {detail: {feature: 'NgAfterNextRender'}});
const afterRenderEventManager = injector.get(AfterRenderEventManager);
// Lazily initialize the handler implementation, if necessary. This is so that it can be
// tree-shaken if `afterRender` and `afterNextRender` aren't used.