Skip to content

Commit 9b373fd

Browse files
authored
Merge pull request #47 from ProLoser/feat/sentry-integration
Re-add Sentry test button
2 parents 53f9ad8 + 64ab2a2 commit 9b373fd

File tree

4 files changed

+155
-2
lines changed

4 files changed

+155
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"react-dom": "^17.0.0 || ^18.0.0",
2525
"react-firebaseui": "^6.0.0",
2626
"styled-components": "^6.1.10",
27-
"vite-plugin-devtools-json": "^0.1.0"
27+
"vite-plugin-devtools-json": "^0.1.0",
28+
"@sentry/react": "^7.100.0"
2829
},
2930
"devDependencies": {
3031
"@types/react": "^18.3.2",

src/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Sentry initialization should be imported first!
2+
import "./instrument";
13
import { StrictMode, useEffect, useState, useCallback, type DragEventHandler, useMemo } from "react";
24
import ReactDOM from 'react-dom/client'
35
// TODO: Upgrade to modular after firebaseui upgrades
@@ -17,8 +19,16 @@ import firebase, { saveFcmToken } from "./firebase.config";
1719
import { playCheckerSound } from './Utils';
1820
import type firebaseType from 'firebase/compat/app';
1921

22+
import * as Sentry from "@sentry/react";
23+
2024
// Start React
21-
ReactDOM.createRoot(document.getElementById('root')!).render(<StrictMode><App /></StrictMode>)
25+
ReactDOM.createRoot(document.getElementById('root')!).render(
26+
<StrictMode>
27+
<Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>
28+
<App />
29+
</Sentry.ErrorBoundary>
30+
</StrictMode>
31+
);
2232

2333
const diceSound = new Audio('./shake-and-roll-dice-soundbible.mp3');
2434

src/instrument.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as Sentry from "@sentry/react";
2+
3+
Sentry.init({
4+
dsn: "https://b80f9fdaa62b4c4bc1481bc069202917@o4508232176304128.ingest.us.sentry.io/4509570123038720",
5+
integrations: [
6+
Sentry.browserTracingIntegration(),
7+
Sentry.replayIntegration(),
8+
// Sentry.feedbackIntegration({
9+
// // Additional SDK configuration goes in here, for example:
10+
// colorScheme: "system",
11+
// }),
12+
],
13+
// Performance Monitoring
14+
tracesSampleRate: 1.0, // Capture 100% of the transactions
15+
// Session Replay
16+
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
17+
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
18+
});

yarn.lock

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2857,6 +2857,99 @@
28572857
resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.41.1.tgz#848f99b0d9936d92221bb6070baeff4db6947a30"
28582858
integrity sha512-Wq2zpapRYLfi4aKxf2Xff0tN+7slj2d4R87WEzqw7ZLsVvO5zwYCIuEGSZYiK41+GlwUo1HiR+GdkLEJnCKTCw==
28592859

2860+
"@sentry-internal/feedback@7.120.3":
2861+
version "7.120.3"
2862+
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.120.3.tgz#e37c9fe42f361963710c040727dcc8975fbd0fcd"
2863+
integrity sha512-ewJJIQ0mbsOX6jfiVFvqMjokxNtgP3dNwUv+4nenN+iJJPQsM6a0ocro3iscxwVdbkjw5hY3BUV2ICI5Q0UWoA==
2864+
dependencies:
2865+
"@sentry/core" "7.120.3"
2866+
"@sentry/types" "7.120.3"
2867+
"@sentry/utils" "7.120.3"
2868+
2869+
"@sentry-internal/replay-canvas@7.120.3":
2870+
version "7.120.3"
2871+
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.120.3.tgz#748c40deeae628097193553c8460644d8398519a"
2872+
integrity sha512-s5xy+bVL1eDZchM6gmaOiXvTqpAsUfO7122DxVdEDMtwVq3e22bS2aiGa8CUgOiJkulZ+09q73nufM77kOmT/A==
2873+
dependencies:
2874+
"@sentry/core" "7.120.3"
2875+
"@sentry/replay" "7.120.3"
2876+
"@sentry/types" "7.120.3"
2877+
"@sentry/utils" "7.120.3"
2878+
2879+
"@sentry-internal/tracing@7.120.3":
2880+
version "7.120.3"
2881+
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.120.3.tgz#a54e67c39d23576a72b3f349c1a3fae13e27f2f1"
2882+
integrity sha512-Ausx+Jw1pAMbIBHStoQ6ZqDZR60PsCByvHdw/jdH9AqPrNE9xlBSf9EwcycvmrzwyKspSLaB52grlje2cRIUMg==
2883+
dependencies:
2884+
"@sentry/core" "7.120.3"
2885+
"@sentry/types" "7.120.3"
2886+
"@sentry/utils" "7.120.3"
2887+
2888+
"@sentry/browser@7.120.3":
2889+
version "7.120.3"
2890+
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.120.3.tgz#484cffab5a5ab5f91166eedf241c03baf0c668e0"
2891+
integrity sha512-i9vGcK9N8zZ/JQo1TCEfHHYZ2miidOvgOABRUc9zQKhYdcYQB2/LU1kqlj77Pxdxf4wOa9137d6rPrSn9iiBxg==
2892+
dependencies:
2893+
"@sentry-internal/feedback" "7.120.3"
2894+
"@sentry-internal/replay-canvas" "7.120.3"
2895+
"@sentry-internal/tracing" "7.120.3"
2896+
"@sentry/core" "7.120.3"
2897+
"@sentry/integrations" "7.120.3"
2898+
"@sentry/replay" "7.120.3"
2899+
"@sentry/types" "7.120.3"
2900+
"@sentry/utils" "7.120.3"
2901+
2902+
"@sentry/core@7.120.3":
2903+
version "7.120.3"
2904+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.120.3.tgz#88ae2f8c242afce59e32bdee7f866d8788e86c03"
2905+
integrity sha512-vyy11fCGpkGK3qI5DSXOjgIboBZTriw0YDx/0KyX5CjIjDDNgp5AGgpgFkfZyiYiaU2Ww3iFuKo4wHmBusz1uA==
2906+
dependencies:
2907+
"@sentry/types" "7.120.3"
2908+
"@sentry/utils" "7.120.3"
2909+
2910+
"@sentry/integrations@7.120.3":
2911+
version "7.120.3"
2912+
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.120.3.tgz#ea6812b77dea7d0090a5cf85383f154b3bd5b073"
2913+
integrity sha512-6i/lYp0BubHPDTg91/uxHvNui427df9r17SsIEXa2eKDwQ9gW2qRx5IWgvnxs2GV/GfSbwcx4swUB3RfEWrXrQ==
2914+
dependencies:
2915+
"@sentry/core" "7.120.3"
2916+
"@sentry/types" "7.120.3"
2917+
"@sentry/utils" "7.120.3"
2918+
localforage "^1.8.1"
2919+
2920+
"@sentry/react@^7.100.0":
2921+
version "7.120.3"
2922+
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.120.3.tgz#4d11803db3fd6dadc265cd521151f4b7b36d20b1"
2923+
integrity sha512-BcpoK9dwblfb20xwjn/1DRtplvPEXFc3XCRkYSnTfnfZNU8yPOcVX4X2X0I8R+/gsg+MWiFOdEtXJ3FqpJiJ4Q==
2924+
dependencies:
2925+
"@sentry/browser" "7.120.3"
2926+
"@sentry/core" "7.120.3"
2927+
"@sentry/types" "7.120.3"
2928+
"@sentry/utils" "7.120.3"
2929+
hoist-non-react-statics "^3.3.2"
2930+
2931+
"@sentry/replay@7.120.3":
2932+
version "7.120.3"
2933+
resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.120.3.tgz#270d561a4dcd116ed4d5f31c1f0dc71462e04394"
2934+
integrity sha512-CjVq1fP6bpDiX8VQxudD5MPWwatfXk8EJ2jQhJTcWu/4bCSOQmHxnnmBM+GVn5acKUBCodWHBN+IUZgnJheZSg==
2935+
dependencies:
2936+
"@sentry-internal/tracing" "7.120.3"
2937+
"@sentry/core" "7.120.3"
2938+
"@sentry/types" "7.120.3"
2939+
"@sentry/utils" "7.120.3"
2940+
2941+
"@sentry/types@7.120.3":
2942+
version "7.120.3"
2943+
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.120.3.tgz#25f69ae27f0c8430f1863ad2a9ee9cab7fccf232"
2944+
integrity sha512-C4z+3kGWNFJ303FC+FxAd4KkHvxpNFYAFN8iMIgBwJdpIl25KZ8Q/VdGn0MLLUEHNLvjob0+wvwlcRBBNLXOow==
2945+
2946+
"@sentry/utils@7.120.3":
2947+
version "7.120.3"
2948+
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.120.3.tgz#0cc891c315d3894eb80c2e7298efd7437e939a5d"
2949+
integrity sha512-UDAOQJtJDxZHQ5Nm1olycBIsz2wdGX8SdzyGVHmD8EOQYAeDZQyIlQYohDe9nazdIOQLZCIc3fU0G9gqVLkaGQ==
2950+
dependencies:
2951+
"@sentry/types" "7.120.3"
2952+
28602953
"@sindresorhus/is@^4.6.0":
28612954
version "4.6.0"
28622955
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f"
@@ -5707,6 +5800,13 @@ highlight.js@^10.7.1:
57075800
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531"
57085801
integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==
57095802

5803+
hoist-non-react-statics@^3.3.2:
5804+
version "3.3.2"
5805+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
5806+
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
5807+
dependencies:
5808+
react-is "^16.7.0"
5809+
57105810
html-entities@^2.5.2:
57115811
version "2.6.0"
57125812
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.6.0.tgz#7c64f1ea3b36818ccae3d3fb48b6974208e984f8"
@@ -5800,6 +5900,11 @@ ignore@^7.0.4:
58005900
resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9"
58015901
integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==
58025902

5903+
immediate@~3.0.5:
5904+
version "3.0.6"
5905+
resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
5906+
integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
5907+
58035908
import-fresh@^3.2.1:
58045909
version "3.3.1"
58055910
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf"
@@ -6465,6 +6570,13 @@ libsodium@^0.7.15:
64656570
resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.15.tgz#ac284e3dcb1c29ae9526c5581cdada6a072f6d20"
64666571
integrity sha512-sZwRknt/tUpE2AwzHq3jEyUU5uvIZHtSssktXq7owd++3CSgn8RGrv6UZJJBpP7+iBghBqe7Z06/2M31rI2NKw==
64676572

6573+
lie@3.1.1:
6574+
version "3.1.1"
6575+
resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e"
6576+
integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==
6577+
dependencies:
6578+
immediate "~3.0.5"
6579+
64686580
lightningcss-darwin-arm64@1.30.1:
64696581
version "1.30.1"
64706582
resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz#3d47ce5e221b9567c703950edf2529ca4a3700ae"
@@ -6556,6 +6668,13 @@ lmdb@2.8.5:
65566668
"@lmdb/lmdb-linux-x64" "2.8.5"
65576669
"@lmdb/lmdb-win32-x64" "2.8.5"
65586670

6671+
localforage@^1.8.1:
6672+
version "1.10.0"
6673+
resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4"
6674+
integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==
6675+
dependencies:
6676+
lie "3.1.1"
6677+
65596678
locate-path@^6.0.0:
65606679
version "6.0.0"
65616680
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
@@ -7819,6 +7938,11 @@ react-firebaseui@^6.0.0:
78197938
dependencies:
78207939
firebaseui "^6.0.0"
78217940

7941+
react-is@^16.7.0:
7942+
version "16.13.1"
7943+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
7944+
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
7945+
78227946
react-refresh@^0.16.0:
78237947
version "0.16.0"
78247948
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.16.0.tgz#e7d45625f05c9709466d09348a25d22f79b2ad23"

0 commit comments

Comments
 (0)