Feedback

bundle-dynamic-imports

@theorcdev Claim

Basic information

Repository
TheOrcDev
Skill
bundle-dynamic-imports

About bundle-dynamic-imports

Use next/dynamic for lazy-loading heavy components. Apply when importing large components like editors, charts, or rich text editors that aren't needed on initial render.

bundle-dynamic-imports is an agent skill listed in the AddMCP.net directory, published by TheOrcDev. Runtime: TypeScript. License: MIT. The repository has 2,061 GitHub stars. Source code is hosted on github.com. Related topics: 8-bit, components, retro, shadcn, ui.

Overview

What is bundle-dynamic-imports?


name: bundle-dynamic-imports description: Use next/dynamic for lazy-loading heavy components. Apply when importing large components like editors, charts, or rich text editors that aren't needed on initial render.


Dynamic Imports for Heavy Components

Use next/dynamic to lazy-load large components not needed on initial render.

Incorrect (Monaco bundles with main chunk ~300KB):

import { MonacoEditor } from './monaco-editor'

function CodePanel({ code }: { code: string }) {
  return <MonacoEditor value={code} />
}

Correct (Monaco loads on demand):

import dynamic from 'next/dynamic'

const MonacoEditor = dynamic(
  () => import('./monaco-editor').then(m => m.MonacoEditor),
  { ssr: false }
)

function CodePanel({ code }: { code: string }) {
  return <MonacoEditor value={code} />
}

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬