Skip to content

Commit

Permalink
fix(cold-start): simplify description and add reference issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jerensl committed Jul 15, 2024
1 parent 209e9d3 commit 27ed834
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions apps/studio-next/src/components/StudioEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 27ed834

Please sign in to comment.