-
Notifications
You must be signed in to change notification settings - Fork 0
Lazy-load heavy UI components to reduce bundle size #10
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestperformanceSpeed and resource optimizationSpeed and resource optimization
Description
Problem
44 shadcn/ui components, Shiki syntax highlighting, and Recharts are all eagerly loaded, increasing the initial bundle size and time-to-interactive for every page — even pages that don't use these components.
Proposed Solution
Use next/dynamic with { ssr: false } (where appropriate) to lazy-load heavy components:
- Code blocks (
code-block.tsx) — Shiki is large; lazy-load on pages that render code - Charts (
chart-area-interactive.tsx) — Recharts is heavy; lazy-load on dashboard - Command palette — Only needed on keyboard shortcut trigger
- Promotion dialogs — Only needed on user action
- Calendar view — Only loaded on
/calendarroute
Acceptance Criteria
- Identified components are dynamically imported
- Initial page load bundle size is measurably reduced
- Loading states (skeletons/spinners) shown while components load
- No regressions in functionality
-
pnpm buildoutput shows improved chunk splitting
Notes
- Run
npx @next/bundle-analyzerbefore and after to measure impact - Prioritize components with the largest import trees
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestperformanceSpeed and resource optimizationSpeed and resource optimization