Refactor AIPage and EQPage components to use lazy loading with PageSuspense for improved performance; update vite.config.ts to adjust chunking strategy and increase chunk size warning limit for better handling of large libraries.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import AIPage from "@/pages/AIPage";
|
||||
import PageSuspense from "@/components/PageSuspense";
|
||||
import { useAIDrawer } from "@/contexts/AIDrawerContext";
|
||||
import { useIsLgUp } from "@/hooks/useIsLgUp";
|
||||
import { cn } from "@/lib/utils";
|
||||
@@ -7,10 +7,13 @@ import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useRef,
|
||||
lazy,
|
||||
type ReactNode,
|
||||
type RefObject,
|
||||
} from "react";
|
||||
|
||||
const AIPage = lazy(() => import("@/pages/AIPage"));
|
||||
|
||||
function SplitDivider({
|
||||
containerRef,
|
||||
onResize,
|
||||
@@ -114,7 +117,9 @@ export default function DesktopAIShell({ children }: { children: ReactNode }) {
|
||||
className="flex h-full min-h-0 min-w-0 flex-col overflow-hidden border-l border-white/[0.08] bg-[#0d1117]"
|
||||
style={{ flex: `${splitPercent} 1 0%` }}
|
||||
>
|
||||
<AIPage variant="split" onClose={() => setOpen(false)} />
|
||||
<PageSuspense>
|
||||
<AIPage variant="split" onClose={() => setOpen(false)} />
|
||||
</PageSuspense>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user