remove sentry

This commit is contained in:
m5r
2023-04-29 07:49:56 +02:00
parent 2ebdca5484
commit cb35455722
8 changed files with 4 additions and 374 deletions

View File

@ -88,9 +88,6 @@ export default {
url: process.env.REDIS_URL,
password: process.env.REDIS_PASSWORD,
},
sentry: {
dsn: process.env.SENTRY_DSN,
},
webPush: {
privateKey: process.env.WEB_PUSH_VAPID_PRIVATE_KEY,
publicKey: process.env.WEB_PUSH_VAPID_PUBLIC_KEY,

View File

@ -1,15 +1,5 @@
import { hydrate } from "react-dom";
import { RemixBrowser } from "@remix-run/react";
import * as Sentry from "@sentry/browser";
import { Integrations } from "@sentry/tracing";
if (window.shellphoneConfig.sentry.dsn) {
Sentry.init({
dsn: window.shellphoneConfig.sentry.dsn,
tracesSampleRate: 1.0,
integrations: [new Integrations.BrowserTracing()],
});
}
hydrate(<RemixBrowser />, document);

View File

@ -1,58 +1,17 @@
import type { FunctionComponent, PropsWithChildren } from "react";
import { type LinksFunction, type LoaderFunction, json } from "@remix-run/node";
import {
Link,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
useCatch,
useLoaderData,
} from "@remix-run/react";
import type { LinksFunction } from "@remix-run/node";
import { Link, Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration, useCatch } from "@remix-run/react";
import config from "~/config/config.server";
import Logo from "~/features/core/components/logo";
import styles from "./styles/tailwind.css";
export const links: LinksFunction = () => [{ rel: "stylesheet", href: styles }];
declare global {
interface Window {
shellphoneConfig: LoaderData["shellphoneConfig"];
}
}
type LoaderData = {
shellphoneConfig: {
sentry: {
dsn?: string;
};
};
};
export const loader: LoaderFunction = () => {
return json<LoaderData>({
shellphoneConfig: {
sentry: {
dsn: config.sentry.dsn,
},
},
});
};
export default function App() {
const { shellphoneConfig } = useLoaderData<LoaderData>();
return (
<Document>
<Outlet />
<script
suppressHydrationWarning
dangerouslySetInnerHTML={{
__html: `window.shellphoneConfig=${JSON.stringify(shellphoneConfig)};`,
}}
/>
</Document>
);
}

View File

@ -1,10 +1,7 @@
import { useEffect } from "react";
import { type LinksFunction, type LoaderFunction, json } from "@remix-run/node";
import { Outlet, useCatch, useLoaderData, useMatches } from "@remix-run/react";
import * as Sentry from "@sentry/browser";
import { Outlet, useCatch, useMatches } from "@remix-run/react";
import serverConfig from "~/config/config.server";
import { type SessionData, requireLoggedIn } from "~/utils/auth.server";
import Footer from "~/features/core/components/footer";
import ServiceWorkerUpdateNotifier from "~/features/core/components/service-worker-update-notifier";
import Notification from "~/features/core/components/notification";
@ -19,15 +16,11 @@ export const links: LinksFunction = () => [
];
export type AppLoaderData = {
sessionData: SessionData;
config: { webPushPublicKey: string };
};
export const loader: LoaderFunction = async ({ request }) => {
const sessionData = await requireLoggedIn(request);
return json<AppLoaderData>({
sessionData,
config: {
webPushPublicKey: serverConfig.webPush.publicKey,
},
@ -37,14 +30,9 @@ export const loader: LoaderFunction = async ({ request }) => {
export default function __App() {
useDevice();
useServiceWorkerRevalidate();
const { sessionData } = useLoaderData<AppLoaderData>();
const matches = useMatches();
const hideFooter = matches.some((match) => match.handle?.hideFooter === true);
useEffect(() => {
Sentry.setUser(sessionData.user);
}, []);
return (
<>
<div className="h-full w-full overflow-hidden fixed bg-gray-100">