EchoSrv: remove deprecated tti-polyfill (#32140)

* EchoSrv: remove deprecated tti-polyfill

* more cleanup
This commit is contained in:
Leon Sorokin 2021-03-22 04:42:02 -05:00 committed by GitHub
parent 9cb865ea5c
commit fd9dee87e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 25 deletions

View File

@ -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"

View File

@ -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({

View File

@ -1,18 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script nonce="[[.Nonce]]">
// https://github.com/GoogleChromeLabs/tti-polyfill
!(function () {
if ('PerformanceLongTaskTiming' in window) {
var g = (window.__tti = { e: [] });
g.o = new PerformanceObserver(function (l) {
g.e = g.e.concat(l.getEntries());
});
g.o.observe({ entryTypes: ['longtask'] });
}
})();
</script>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width" />

View File

@ -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"