refactor(core): use performance API for Event Replay (#56509)

This commit adds 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 #56509
This commit is contained in:
Andrew Kushnir 2024-06-18 18:09:34 -07:00
parent 83ffa94783
commit 69e0aa56f1

View file

@ -38,6 +38,7 @@ import {
invokeRegisteredListeners,
} from '../event_delegation_utils';
import {APP_ID} from '../application/application_tokens';
import {performanceMarkFeature} from '../util/performance';
declare global {
var ngContracts: {[key: string]: EarlyJsactionDataContainer};
@ -81,6 +82,9 @@ export function withEventReplay(): Provider[] {
const appId = inject(APP_ID);
isEnabled = !!globalThis[CONTRACT_PROPERTY]?.[appId];
}
if (isEnabled) {
performanceMarkFeature('NgEventReplay');
}
return isEnabled;
},
},