From ec70a078ad8ebb15a77f550e6d8083117daeedb6 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 10 Apr 2024 16:37:09 +0300 Subject: [PATCH] connected --- package.json | 3 ++- src/graphql/query/core/my-followed.ts | 28 --------------------------- src/renderer/_default.page.client.tsx | 21 +++++++++++--------- src/utils/config.ts | 1 + 4 files changed, 15 insertions(+), 38 deletions(-) delete mode 100644 src/graphql/query/core/my-followed.ts diff --git a/package.json b/package.json index 1da95480..5a604c85 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "postinstall": "npm run codegen && npx patch-package", "check:code": "npx @biomejs/biome check src --log-kind=compact --verbose", "check:code:fix": "npx @biomejs/biome check src --log-kind=compact", + "check:types": "tsc --noEmit", "lint": "npm run lint:code && stylelint **/*.{scss,css}", "lint:code": "npx @biomejs/biome lint src --log-kind=compact --verbose", "lint:code:fix": "npx @biomejs/biome lint src --apply-unsafe --log-kind=compact --verbose", @@ -47,7 +48,7 @@ "@nanostores/solid": "0.4.2", "@playwright/test": "1.41.2", "@popperjs/core": "2.11.8", - "@sentry/browser": "7.99.0", + "@sentry/browser": "^7.109.0", "@solid-primitives/media": "2.2.3", "@solid-primitives/memo": "1.2.4", "@solid-primitives/pagination": "0.2.10", diff --git a/src/graphql/query/core/my-followed.ts b/src/graphql/query/core/my-followed.ts deleted file mode 100644 index f33808fd..00000000 --- a/src/graphql/query/core/my-followed.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { gql } from '@urql/core' - -export default gql` - query MySubscriptionsQuery { - get_my_followed { - topics { - id - title - body - slug - } - authors { - id - name - slug - pic - created_at - } - communities { - id - name - slug - pic - created_at - } - } - } -` diff --git a/src/renderer/_default.page.client.tsx b/src/renderer/_default.page.client.tsx index fff76e88..6b5f29b3 100644 --- a/src/renderer/_default.page.client.tsx +++ b/src/renderer/_default.page.client.tsx @@ -1,7 +1,7 @@ import type { PageContextBuiltInClientWithClientRouting } from 'vike/types' import type { PageContext } from './types' -// import * as Sentry from '@sentry/browser' +import * as Sentry from '@sentry/browser' import i18next from 'i18next' import HttpApi from 'i18next-http-backend' import ICU from 'i18next-icu' @@ -9,7 +9,7 @@ import { hydrate } from 'solid-js/web' import { App } from '../components/App' import { initRouter } from '../stores/router' -// import { SENTRY_DSN } from '../utils/config' +import { GLITCHTIP_DSN } from '../utils/config' import { resolveHydrationPromise } from '../utils/hydrationPromise' let layoutReady = false @@ -20,13 +20,16 @@ export const render = async (pageContext: PageContextBuiltInClientWithClientRout const { pathname, search } = window.location const searchParams = Object.fromEntries(new URLSearchParams(search)) initRouter(pathname, searchParams) - /* - if (SENTRY_DSN) { - Sentry.init({ - dsn: SENTRY_DSN, - }) - } - */ + + Sentry.init({ + dsn: GLITCHTIP_DSN, + tracesSampleRate: 0.01, + integrations: [Sentry.replayIntegration()], + // Session Replay + 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. + replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur. + }); + // eslint-disable-next-line import/no-named-as-default-member await i18next .use(HttpApi) diff --git a/src/utils/config.ts b/src/utils/config.ts index cfc2f7fa..41710c83 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -5,6 +5,7 @@ export const cdnUrl = 'https://cdn.discours.io' export const thumborUrl = import.meta.env.PUBLIC_THUMBOR_URL || defaultThumborUrl export const SENTRY_DSN = import.meta.env.PUBLIC_SENTRY_DSN || '' +export const GLITCHTIP_DSN = import.meta.env.PUBLIC_GLITCHTIP_DSN || '' const defaultSearchUrl = 'https://search.discours.io' export const searchUrl = import.meta.env.PUBLIC_SEARCH_URL || defaultSearchUrl