From fd9dee87e4aed179787ff72b0a8fcfb54b17d946 Mon Sep 17 00:00:00 2001 From: Leon Sorokin Date: Mon, 22 Mar 2021 04:42:02 -0500 Subject: [PATCH] EchoSrv: remove deprecated tti-polyfill (#32140) * EchoSrv: remove deprecated tti-polyfill * more cleanup --- package.json | 1 - public/app/app.ts | 19 ++++++++++++------- public/views/index-template.html | 12 ------------ yarn.lock | 5 ----- 4 files changed, 12 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 096e934ccc9..1a6bcb8172b 100644 --- a/package.json +++ b/package.json @@ -292,7 +292,6 @@ "tether": "1.4.7", "tether-drop": "https://github.com/torkelo/drop", "tinycolor2": "1.4.1", - "tti-polyfill": "0.2.2", "uuid": "8.3.0", "visjs-network": "4.25.0", "whatwg-fetch": "3.1.0" diff --git a/public/app/app.ts b/public/app/app.ts index 232981c5b33..7d531beebc5 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -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'); - for (const metric of paintMetrics) { - reportPerformance(metric.name, Math.round(metric.startTime + metric.duration)); + const paintMetrics = performance.getEntriesByType('paint'); + + 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({ diff --git a/public/views/index-template.html b/public/views/index-template.html index ebcdc18e5cc..33e60ff89ab 100644 --- a/public/views/index-template.html +++ b/public/views/index-template.html @@ -1,18 +1,6 @@ - diff --git a/yarn.lock b/yarn.lock index cb1b631aedf..d0a3715f94b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25486,11 +25486,6 @@ tsutils@^3.17.1: dependencies: tslib "^1.8.1" -tti-polyfill@0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/tti-polyfill/-/tti-polyfill-0.2.2.tgz#f7bbf71b13afa9edf60c8bb0d0c05f134e1513b9" - integrity sha512-URIoJxvsHThbQEJij29hIBUDHx9UNoBBCQVjy7L8PnzkqY8N6lsAI6h8JrT1Wt2lA0avus/DkuiJxd9qpfCpqw== - tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"