Perf: remove user profile loading (#22710)

This commit is contained in:
KVOJJJin 2025-07-21 16:35:52 +08:00 • committed by GitHub
commit a83e4ed9a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 100 additions and 134 deletions

View file

@ -0,0 +1,29 @@
'use client'
import { useEffect } from 'react'
import * as Sentry from '@sentry/react'
const isDevelopment = process.env.NODE_ENV === 'development'
const SentryInitializer = ({
children,
}: { children: React.ReactElement }) => {
useEffect(() => {
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
if (!isDevelopment && SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
})
}
}, [])
return children
}
export default SentryInitializer