From 27ed834bda7531a0ac701df7869d6efe28754c82 Mon Sep 17 00:00:00 2001 From: jerensl <54782057+jerensl@users.noreply.github.com> Date: Fri, 5 Jul 2024 18:20:09 +0800 Subject: [PATCH] fix(cold-start): simplify description and add reference issue --- apps/studio-next/src/components/StudioEditor.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/studio-next/src/components/StudioEditor.tsx b/apps/studio-next/src/components/StudioEditor.tsx index 28df9d5ca..cc2d9c815 100644 --- a/apps/studio-next/src/components/StudioEditor.tsx +++ b/apps/studio-next/src/components/StudioEditor.tsx @@ -3,12 +3,11 @@ import dynamic from 'next/dynamic' const StudioWrapper = dynamic(() => import('@/components/StudioWrapper'), {ssr: false}) /* -Calling next/dynamic with client component in server component is so far not able to do code splitting. -So we move them to a here as client component and call next/dynamic here to enable code splitting. +Calling StudioWrapper as Code Splitting in Server Components will also make them be included in server-side rendering, +that's why we added another layer and told them as client components to make the code splitting work in client-side only -Using next/dynamic in server components will also be including in server side rendering -which will contribute to cold start and huge bundle size. -https://github.com/vercel/next.js/issues/49454#issuecomment-1830053413 +Related Issue: https://github.com/asyncapi/studio/issues/1118 +Reference: https://github.com/vercel/next.js/issues/49454#issuecomment-1830053413 */ export default async function StudioEditor() { return (