Skip to content

Commit 209e9d3

Browse files
committed
fix(cold-start): add description about the issue
1 parent b38d62f commit 209e9d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/studio-next/src/components/StudioEditor.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
import dynamic from 'next/dynamic'
33
const StudioWrapper = dynamic(() => import('@/components/StudioWrapper'), {ssr: false})
44

5+
/*
6+
Calling next/dynamic with client component in server component is so far not able to do code splitting.
7+
So we move them to a here as client component and call next/dynamic here to enable code splitting.
58
9+
Using next/dynamic in server components will also be including in server side rendering
10+
which will contribute to cold start and huge bundle size.
11+
https://github.com/vercel/next.js/issues/49454#issuecomment-1830053413
12+
*/
613
export default async function StudioEditor() {
714
return (
815
<StudioWrapper />

0 commit comments

Comments
 (0)