|
|
|
@ -4,8 +4,6 @@ import 'regenerator-runtime/runtime'; |
|
|
|
|
|
|
|
|
|
import 'whatwg-fetch'; // fetch polyfill needed for PhantomJs rendering
|
|
|
|
|
import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; // fetch polyfill needed for PhantomJs rendering
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
import ttiPolyfill from 'tti-polyfill'; |
|
|
|
|
|
|
|
|
|
import 'file-saver'; |
|
|
|
|
import 'jquery'; |
|
|
|
@ -115,17 +113,24 @@ function initExtensions() { |
|
|
|
|
function initEchoSrv() { |
|
|
|
|
setEchoSrv(new Echo({ debug: process.env.NODE_ENV === 'development' })); |
|
|
|
|
|
|
|
|
|
ttiPolyfill.getFirstConsistentlyInteractive().then((tti: any) => { |
|
|
|
|
window.addEventListener('load', (e) => { |
|
|
|
|
// Collecting paint metrics first
|
|
|
|
|
const paintMetrics = performance && performance.getEntriesByType ? performance.getEntriesByType('paint') : []; |
|
|
|
|
if (performance && performance.getEntriesByType) { |
|
|
|
|
performance.mark('load'); |
|
|
|
|
|
|
|
|
|
const paintMetrics = performance.getEntriesByType('paint'); |
|
|
|
|
|
|
|
|
|
for (const metric of paintMetrics) { |
|
|
|
|
reportPerformance(metric.name, Math.round(metric.startTime + metric.duration)); |
|
|
|
|
for (const metric of paintMetrics) { |
|
|
|
|
reportPerformance(metric.name, Math.round(metric.startTime + metric.duration)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const loadMetric = performance.getEntriesByName('load')[0]; |
|
|
|
|
reportPerformance(loadMetric.name, Math.round(loadMetric.startTime + loadMetric.duration)); |
|
|
|
|
} |
|
|
|
|
reportPerformance('tti', tti); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
registerEchoBackend(new PerformanceBackend({})); |
|
|
|
|
|
|
|
|
|
if (config.sentry.enabled) { |
|
|
|
|
registerEchoBackend( |
|
|
|
|
new SentryEchoBackend({ |
|
|
|
|