From 6dcc8c169671a738160c1992defb4fd829bd355a Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Sun, 2 Jun 2024 00:14:38 +0200 Subject: [PATCH] Edgio rum (#338) * Edgio rum * Prettier --- packages/web/package.json | 1 + packages/web/public/index.html | 8 ------ packages/web/src/index.tsx | 7 +++++ yarn.lock | 50 +++++++++++++++------------------- 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/packages/web/package.json b/packages/web/package.json index d4b8ac7f..aeeed19c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -13,6 +13,7 @@ "dependencies": { "@ant-design/icons": "4.7.0", "@ant-design/plots": "1.2.6", + "@edgio/rum": "^7.0.13", "@nivo/bar": "0.72.0", "@nivo/core": "0.72.0", "@nivo/geo": "0.72.0", diff --git a/packages/web/public/index.html b/packages/web/public/index.html index 7a517e54..954459cf 100644 --- a/packages/web/public/index.html +++ b/packages/web/public/index.html @@ -67,14 +67,6 @@ Learn how to configure a non-root public URL by running `npm run build`. --> COH2 Game Statistics - - diff --git a/packages/web/src/index.tsx b/packages/web/src/index.tsx index 3203b434..593200ae 100644 --- a/packages/web/src/index.tsx +++ b/packages/web/src/index.tsx @@ -6,8 +6,10 @@ import "./index.css"; import Root from "./root"; import analytics from "./analytics"; import "firebase/compat/firestore"; +import { Metrics } from "@edgio/rum"; import { firebase } from "./firebase"; + firebase.init(); // Initialize Firebase @@ -32,3 +34,8 @@ if (process.env.NODE_ENV !== "production" && module.hot) { // Render our app renderApp(); + +// Collect RUM metrics +new Metrics({ + token: "cdbeca7f-be87-45d8-a36a-0ba520f1ec5c", +}).collect(); diff --git a/yarn.lock b/yarn.lock index 1fed86d8..e08caeaf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2237,6 +2237,15 @@ enabled "2.0.x" kuler "^2.0.0" +"@edgio/rum@^7.0.13": + version "7.0.13" + resolved "https://registry.yarnpkg.com/@edgio/rum/-/rum-7.0.13.tgz#95377434b55e8ab90f1d91df7f802d1803f6be8c" + integrity sha512-FBpDX1W2N7NyJ09Fpx8+yCf2usbURAVyFj9lICEMe2L3YHMkdGGW39UpuJvtl0wRDLv0pRl6CyeHcqqaXsgOfg== + dependencies: + lodash.debounce "^4.0.8" + path-to-regexp "^6.2.1" + web-vitals "^3.5.0" + "@electron-forge/cli@7.4.0": version "7.4.0" resolved "https://registry.yarnpkg.com/@electron-forge/cli/-/cli-7.4.0.tgz#db16f4bc678d1f6cec8890cdf86041e9c8336350" @@ -13632,6 +13641,11 @@ path-to-regexp@^1.7.0, path-to-regexp@^1.8.0: dependencies: isarray "0.0.1" +path-to-regexp@^6.2.1: + version "6.2.2" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.2.tgz#324377a83e5049cbecadc5554d6a63a9a4866b36" + integrity sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw== + path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" @@ -17140,16 +17154,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -17247,7 +17252,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -17261,13 +17266,6 @@ strip-ansi@^3.0.0: dependencies: ansi-regex "^2.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.0, strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" @@ -18230,6 +18228,11 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-vitals@^3.5.0: + version "3.5.2" + resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-3.5.2.tgz#5bb58461bbc173c3f00c2ddff8bfe6e680999ca9" + integrity sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -18777,7 +18780,7 @@ workbox-window@6.4.2: "@types/trusted-types" "^2.0.2" workbox-core "6.4.2" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -18795,15 +18798,6 @@ wrap-ansi@^6.0.1: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"