mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
EchoSrv: remove deprecated tti-polyfill (#32140)
* EchoSrv: remove deprecated tti-polyfill * more cleanup
This commit is contained in:
parent
9cb865ea5c
commit
fd9dee87e4
@ -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"
|
||||
|
@ -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({
|
||||
|
@ -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" />
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user