From 2e7787f70b49aac5cc18191d329c896272474152 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 27 Oct 2022 23:20:06 -0700 Subject: [PATCH] Force the bundler to build the player as its own file --- web/components/chat/ChatUserMessage/ChatUserMessage.tsx | 2 ++ web/components/ui/Content/Content.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/components/chat/ChatUserMessage/ChatUserMessage.tsx b/web/components/chat/ChatUserMessage/ChatUserMessage.tsx index ad0001c62..6d9572763 100644 --- a/web/components/chat/ChatUserMessage/ChatUserMessage.tsx +++ b/web/components/chat/ChatUserMessage/ChatUserMessage.tsx @@ -63,6 +63,8 @@ export const ChatUserMessage: FC = ({ ); } + // TODO: Find a solution to get rid of or replace "he" library since + // it's overly large for only use in this one place. useEffect(() => { setFormattedMessage(he.decode(body)); }, [message]); diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx index c4bdb4783..9d98a4c5e 100644 --- a/web/components/ui/Content/Content.tsx +++ b/web/components/ui/Content/Content.tsx @@ -18,7 +18,7 @@ import { } from '../../stores/ClientConfigStore'; import { ClientConfig } from '../../../interfaces/client-config.model'; import { CustomPageContent } from '../CustomPageContent/CustomPageContent'; -import { OwncastPlayer } from '../../video/OwncastPlayer/OwncastPlayer'; + import styles from './Content.module.scss'; import { Sidebar } from '../Sidebar/Sidebar'; import { Footer } from '../Footer/Footer'; @@ -41,6 +41,8 @@ import { FollowModal } from '../../modals/FollowModal/FollowModal'; const { Content: AntContent } = Layout; +// Lazy loaded components + const BrowserNotifyModal = dynamic(() => import('../../modals/BrowserNotifyModal/BrowserNotifyModal').then(mod => mod.BrowserNotifyModal), ); @@ -49,6 +51,10 @@ const NotifyReminderPopup = dynamic(() => import('../NotifyReminderPopup/NotifyReminderPopup').then(mod => mod.NotifyReminderPopup), ); +const OwncastPlayer = dynamic(() => + import('../../video/OwncastPlayer/OwncastPlayer').then(mod => mod.OwncastPlayer), +); + // We only need to load the chat container here if we're in mobile or narrow // windows, so lazy loading it makes sense. const ChatContainer = dynamic(() =>