Skip to content

Commit 1ec6cab

Browse files
authored
Revert "POC Sentry (#206)" (#212)
This reverts commit 99df07e.
1 parent 99df07e commit 1ec6cab

File tree

17 files changed

+40
-277
lines changed

17 files changed

+40
-277
lines changed

.github/workflows/check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- run: pnpm run -r lint
2727
- run: pnpm run -r type-check
2828
- run: pnpm run test:all
29-
- run: pnpm run -r build-no-sourcemaps
29+
- run: pnpm run -r build

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ Thumbs.db
4444

4545
# Firebase
4646
firebase-debug.log
47-
ui-debug.log
48-
# Sentry Config File
49-
.sentryclirc
47+
ui-debug.log

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"@remix-run/node": "^1.19.3",
7474
"@remix-run/react": "^1.19.3",
7575
"@remix-run/serve": "^1.19.3",
76-
"@sentry/remix": "^7.74.0",
7776
"@tanstack/react-table": "^8.10.6",
7877
"@tanstack/react-virtual": "3.0.0-beta.61",
7978
"clsx": "^1.2.1",

packages/app-builder/.env.local

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ SESSION_SECRET=SESSION_SECRET
55
SESSION_MAX_AGE=43200
66

77
MARBLE_API_DOMAIN=http://127.0.0.1:8080
8-
MARBLE_APP_DOMAIN=http://127.0.0.1:3000
98

109
FIREBASE_AUTH_EMULATOR=true
1110
FIREBASE_AUTH_EMULATOR_HOST=http://localhost:9099
@@ -15,8 +14,4 @@ FIREBASE_AUTH_DOMAIN=tokyo-country-381508.firebaseapp.com
1514
FIREBASE_PROJECT_ID=tokyo-country-381508
1615
FIREBASE_STORAGE_BUCKET=tokyo-country-381508.appspot.com
1716
FIREBASE_MESSAGING_SENDER_ID=1047691849054
18-
FIREBASE_APP_ID=1:1047691849054:web:a5b69dd2ac584c1160b3cf
19-
20-
SENTRY_AUTH_TOKEN=dummy
21-
SENTRY_DSN=dummy
22-
SENTRY_ENVIRONMENT=development
17+
FIREBASE_APP_ID=1:1047691849054:web:a5b69dd2ac584c1160b3cf

packages/app-builder/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"lint": "eslint .",
1515
"type-check": "npx tsc --noEmit",
1616
"dev": "dotenv -e .env.local -- remix dev",
17-
"build-no-sourcemaps": "remix build",
18-
"build": "remix build --sourcemap && sentry-upload-sourcemaps --org checkmarble --project marble-frontend",
17+
"build": "remix build",
1918
"start": "remix start",
2019
"generate-routes": "source scripts/generateRoutes.sh"
2120
},
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import { RemixBrowser, useLocation, useMatches } from '@remix-run/react';
2-
import * as Sentry from '@sentry/remix';
3-
import { startTransition, StrictMode, useEffect } from 'react';
1+
import { RemixBrowser } from '@remix-run/react';
2+
import { startTransition, StrictMode } from 'react';
43
import { hydrateRoot } from 'react-dom/client';
54
import { I18nextProvider } from 'react-i18next';
65

76
import { clientServices } from './services/init.client';
8-
import { getClientEnv } from './utils/environment.client';
97

108
async function hydrate() {
119
const { i18nextClientService } = clientServices;
@@ -32,35 +30,3 @@ if (window.requestIdleCallback) {
3230
// eslint-disable-next-line @typescript-eslint/no-misused-promises
3331
window.setTimeout(hydrate, 1);
3432
}
35-
36-
Sentry.init({
37-
dsn: getClientEnv('SENTRY_DSN'),
38-
environment: getClientEnv('SENTRY_ENVIRONMENT'),
39-
integrations: [
40-
new Sentry.BrowserTracing({
41-
routingInstrumentation: Sentry.remixRouterInstrumentation(
42-
useEffect,
43-
useLocation,
44-
useMatches
45-
),
46-
}),
47-
// Replay is only available in the client
48-
new Sentry.Replay(),
49-
],
50-
51-
// Set tracesSampleRate to 1.0 to capture 100%
52-
// of transactions for performance monitoring.
53-
// We recommend adjusting this value in production
54-
tracesSampleRate: 1.0,
55-
56-
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
57-
tracePropagationTargets: [
58-
getClientEnv('MARBLE_APP_DOMAIN'),
59-
getClientEnv('MARBLE_API_DOMAIN'),
60-
],
61-
62-
// Capture Replay for 10% of all sessions,
63-
// plus for 100% of sessions with an error
64-
replaysSessionSampleRate: 0.1,
65-
replaysOnErrorSampleRate: 1.0,
66-
});

packages/app-builder/src/entry.server.tsx

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import {
2-
type DataFunctionArgs,
3-
type EntryContext,
4-
Response,
5-
} from '@remix-run/node';
1+
import { type EntryContext, Response } from '@remix-run/node';
62
import { RemixServer } from '@remix-run/react';
7-
import * as Sentry from '@sentry/remix';
83
import isbot from 'isbot';
94
import { renderToPipeableStream } from 'react-dom/server';
105
import { I18nextProvider } from 'react-i18next';
116
import { PassThrough } from 'stream';
127

138
import { serverServices } from './services/init.server';
14-
import { getServerEnv } from './utils/environment.server';
159

1610
const ABORT_DELAY = 5000;
1711

@@ -111,24 +105,3 @@ function handleBrowserRequest(
111105
setTimeout(abort, ABORT_DELAY);
112106
});
113107
}
114-
115-
Sentry.init({
116-
dsn: getServerEnv('SENTRY_DSN'),
117-
environment: getServerEnv('SENTRY_ENVIRONMENT'),
118-
// Set tracesSampleRate to 1.0 to capture 100%
119-
// of transactions for performance monitoring.
120-
// We recommend adjusting this value in production
121-
tracesSampleRate: 1.0,
122-
});
123-
124-
export async function handleError(
125-
error: unknown,
126-
{ request }: DataFunctionArgs
127-
) {
128-
if (error instanceof Error) {
129-
await Sentry.captureRemixServerException(error, 'remix.server', request);
130-
} else {
131-
// Optionally capture non-Error objects
132-
Sentry.captureException(error);
133-
}
134-
}

packages/app-builder/src/root.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
useLoaderData,
1515
useRouteError,
1616
} from '@remix-run/react';
17-
import { captureRemixErrorBoundaryError, withSentry } from '@sentry/remix';
1817
import { Tooltip } from '@ui-design-system';
1918
import { LogoStandard } from '@ui-icons';
2019
import { type Namespace } from 'i18next';
@@ -102,7 +101,6 @@ export const meta: V2_MetaFunction = () => [
102101

103102
export function ErrorBoundary() {
104103
const error = useRouteError();
105-
captureRemixErrorBoundaryError(error);
106104

107105
return (
108106
<html lang="en">
@@ -137,7 +135,7 @@ export function ErrorBoundary() {
137135
);
138136
}
139137

140-
function App() {
138+
export default function App() {
141139
const { locale, ENV, toastMessage, csrf } = useLoaderData<typeof loader>();
142140

143141
const { i18n } = useTranslation(handle.i18n);
@@ -171,5 +169,3 @@ function App() {
171169
</html>
172170
);
173171
}
174-
175-
export default withSentry(App);

packages/app-builder/src/routes/__builder/decisions.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
import { DecisionsPage } from '@app-builder/components/Decisions';
77
import { getRoute } from '@app-builder/utils/routes';
88
import { Outlet, useRouteError } from '@remix-run/react';
9-
import { captureRemixErrorBoundaryError } from '@sentry/remix';
109
import { Decision } from '@ui-icons';
1110
import { type Namespace } from 'i18next';
1211
import { useTranslation } from 'react-i18next';
@@ -53,8 +52,5 @@ export default function DecisionsLayout() {
5352
}
5453

5554
export function ErrorBoundary() {
56-
const error = useRouteError();
57-
captureRemixErrorBoundaryError(error);
58-
59-
return <ErrorComponent error={error} />;
55+
return <ErrorComponent error={useRouteError()} />;
6056
}

packages/app-builder/src/routes/__builder/lists/$listId.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { serverServices } from '@app-builder/services/init.server';
1212
import { fromParams } from '@app-builder/utils/short-uuid';
1313
import { json, type LoaderArgs } from '@remix-run/node';
1414
import { Link, useLoaderData, useRouteError } from '@remix-run/react';
15-
import { captureRemixErrorBoundaryError } from '@sentry/remix';
1615
import {
1716
type ColumnDef,
1817
getCoreRowModel,
@@ -152,10 +151,9 @@ export default function Lists() {
152151
</Page.Container>
153152
);
154153
}
154+
155155
export function ErrorBoundary() {
156-
const error = useRouteError();
157-
captureRemixErrorBoundaryError(error);
158-
return <ErrorComponent error={error} />;
156+
return <ErrorComponent error={useRouteError()} />;
159157
}
160158

161159
// Correspond to this part of the UI : https://www.figma.com/file/JW6QvnhBtdZDcKvLdg9s5T/Marble-Portal?node-id=6377%3A53150&mode=dev

packages/app-builder/src/routes/__builder/lists/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { getRoute } from '@app-builder/utils/routes';
66
import { fromUUID } from '@app-builder/utils/short-uuid';
77
import { json, type LoaderArgs } from '@remix-run/node';
88
import { useLoaderData, useNavigate, useRouteError } from '@remix-run/react';
9-
import { captureRemixErrorBoundaryError } from '@sentry/remix';
109
import {
1110
type ColumnDef,
1211
getCoreRowModel,
@@ -115,8 +114,7 @@ export default function ListsPage() {
115114
</Page.Container>
116115
);
117116
}
117+
118118
export function ErrorBoundary() {
119-
const error = useRouteError();
120-
captureRemixErrorBoundaryError(error);
121-
return <ErrorComponent error={error} />;
119+
return <ErrorComponent error={useRouteError()} />;
122120
}

packages/app-builder/src/routes/__builder/scenarios/$scenarioId.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { serverServices } from '@app-builder/services/init.server';
33
import { fromParams } from '@app-builder/utils/short-uuid';
44
import { json, type LoaderArgs, type SerializeFrom } from '@remix-run/node';
55
import { Outlet, useRouteError, useRouteLoaderData } from '@remix-run/react';
6-
import { captureRemixErrorBoundaryError } from '@sentry/remix';
76
import { type Namespace } from 'i18next';
87

98
export const handle = {
@@ -31,8 +30,7 @@ export const useCurrentScenario = () =>
3130
export default function CurrentScenarioProvider() {
3231
return <Outlet />;
3332
}
33+
3434
export function ErrorBoundary() {
35-
const error = useRouteError();
36-
captureRemixErrorBoundaryError(error);
37-
return <ErrorComponent error={error} />;
35+
return <ErrorComponent error={useRouteError()} />;
3836
}

packages/app-builder/src/routes/sentry.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/app-builder/src/utils/environment.client.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ export type ClientEnvVars = {
1111
AUTH_EMULATOR_HOST?: string;
1212
FIREBASE_OPTIONS: FirebaseOptions;
1313
MARBLE_API_DOMAIN: string;
14-
MARBLE_APP_DOMAIN: string;
15-
SENTRY_DSN: string;
16-
SENTRY_ENVIRONMENT: string;
1714
};
1815

1916
export function getClientEnv<K extends keyof ClientEnvVars>(

packages/app-builder/src/utils/environment.server.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,13 @@ type ServerPublicEnvVarName =
3434
| 'FIREBASE_PROJECT_ID'
3535
| 'FIREBASE_STORAGE_BUCKET'
3636
| 'MARBLE_API_DOMAIN'
37-
| 'MARBLE_APP_DOMAIN'
3837
| 'NODE_ENV'
39-
| 'SENTRY_ENVIRONMENT'
4038
| 'SESSION_MAX_AGE';
4139

4240
/**
4341
* List of all secret env vars to defined on each deployed environments
4442
*/
45-
type ServerSecretEnvVarName =
46-
| 'SENTRY_AUTH_TOKEN'
47-
| 'SENTRY_DSN'
48-
| 'SESSION_SECRET';
43+
type ServerSecretEnvVarName = 'SESSION_SECRET';
4944

5045
type ServerEnvVarName =
5146
| DevServerEnvVarName
@@ -89,8 +84,5 @@ export function getClientEnvVars(): ClientEnvVars {
8984
appId: getServerEnv('FIREBASE_APP_ID'),
9085
},
9186
MARBLE_API_DOMAIN: getServerEnv('MARBLE_API_DOMAIN'),
92-
MARBLE_APP_DOMAIN: getServerEnv('MARBLE_APP_DOMAIN'),
93-
SENTRY_DSN: getServerEnv('SENTRY_DSN'),
94-
SENTRY_ENVIRONMENT: getServerEnv('SENTRY_ENVIRONMENT'),
9587
};
9688
}

packages/app-builder/src/utils/routes/routes.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ export const routes = [
229229
}
230230
]
231231
},
232-
{
233-
"id": "routes/sentry",
234-
"path": "sentry",
235-
"file": "routes/sentry.tsx"
236-
},
237232
{
238233
"id": "routes/index",
239234
"index": true,

0 commit comments

Comments
 (0)