mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
perf: lazy load video presentation in public chat
Convert GenerateVideoPresentationToolUI from static import to dynamic import with ssr: false in public-thread.tsx. This prevents Remotion and @babel/standalone from being bundled in the public chat page. The main app's assistant-message.tsx already correctly lazy-loads this component, but the public thread was still using a static import, unnecessarily increasing the bundle size for public shared chats. Benefits: - Removes Remotion and @babel/standalone from public chat bundle - Reduces initial bundle size for public shared chats - Video presentations still render correctly when present - Faster page load for users viewing public chats Fixes #1145
This commit is contained in:
parent
e404b05b11
commit
ac554974f6
1 changed files with 6 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
useAuiState,
|
||||
} from "@assistant-ui/react";
|
||||
import { CheckIcon, CopyIcon } from "lucide-react";
|
||||
import dynamic from "next/dynamic";
|
||||
import Image from "next/image";
|
||||
import { type FC, type ReactNode, useState } from "react";
|
||||
import { CitationMetadataProvider } from "@/components/assistant-ui/citation-metadata-context";
|
||||
|
|
@ -17,7 +18,11 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|||
import { GenerateImageToolUI } from "@/components/tool-ui/generate-image";
|
||||
import { GeneratePodcastToolUI } from "@/components/tool-ui/generate-podcast";
|
||||
import { GenerateReportToolUI } from "@/components/tool-ui/generate-report";
|
||||
import { GenerateVideoPresentationToolUI } from "@/components/tool-ui/video-presentation";
|
||||
|
||||
const GenerateVideoPresentationToolUI = dynamic(
|
||||
() => import("@/components/tool-ui/video-presentation").then((m) => ({ default: m.GenerateVideoPresentationToolUI })),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
interface PublicThreadProps {
|
||||
footer?: ReactNode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue