feat: 添加 认证检查 和 首页渲染 的性能标记

This commit is contained in:
zdl
2025-11-26 11:10:50 +08:00
parent ee78e00d3b
commit 5f959fb44f
2 changed files with 18 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import { usePostHogTrack } from '@/hooks/usePostHogRedux';
import { useHomeResponsive } from '@/hooks/useHomeResponsive';
import { ACQUISITION_EVENTS } from '@/lib/constants';
import { CORE_FEATURES } from '@/constants/homeFeatures';
import { performanceMonitor } from '@/utils/performanceMonitor';
import type { Feature } from '@/types/home';
import { HeroBackground } from './components/HeroBackground';
import { HeroHeader } from './components/HeroHeader';
@@ -36,6 +37,11 @@ const HomePage: React.FC = () => {
showDecorations
} = useHomeResponsive();
// ⚡ 性能标记:首页组件挂载 = 渲染开始
useEffect(() => {
performanceMonitor.mark('homepage-render-start');
}, []);
// PostHog 追踪:页面浏览
useEffect(() => {
track(ACQUISITION_EVENTS.LANDING_PAGE_VIEWED, {
@@ -67,6 +73,8 @@ const HomePage: React.FC = () => {
// 背景图片加载完成回调
const handleImageLoad = useCallback(() => {
setImageLoaded(true);
// ⚡ 性能标记:首页渲染完成(背景图片加载完成 = 首屏视觉完整)
performanceMonitor.mark('homepage-render-end');
}, []);
// 特色功能(第一个)