Split a Heavy Client Component
Take one heavy client component off the first load. Keep the page useful before it arrives. COMPONENT What it is: [CHART | EDITOR | MAP | PDF] Where it sits: [PAGE] Framework: [NEXT.JS | VITE] Why it is heavy: [LIBRARY NAME] What the user needs immediately: [THE REST OF THE PAGE] DELIVER 1) The dynamic import with a loading fallback that has the same size as the component so the page does not jump. Show the code. 2) What must stay in the server or static tree (the heading, the data summary) so the import is not the whole page. 3) How we verify: the bundle analyzer before and after, and the chunk name. A one-line instruction, not a tour of the tool. 4) The SSR choice: disable SSR only if the library touches window at import time, and name that bug. 5) Prefetch: when to warm the chunk (idle, or when the section is near the viewport) and when not to (a rare admin screen). Do not dynamic-import every component. Say why this one qualifies.
🌟 Example Output / Preview
Prompt Metadata
Primary Use Cases:
- •Legacy code modernization & technical refactoring
- •Full-stack layout generation & component structuring
- •CI/CD workflow automation & unit/E2E testing suites
Associated Tags:
💡 Pro Tips & Advice
1. Use bracketed items: Be sure to fill out all [PLACEHOLDER] elements with specific details before sending the prompt to the AI model.
2. Adjust temperature: For creative tasks, set AI temperature higher (e.g., 0.8), or lower (e.g., 0.2) for strict coding/technical tasks.
🔗 Related AI Prompts
Full SaaS Landing Page Build Spec (SEO + Conversion)
You are a Staff Product Designer + Frontend Engineer + SEO strategist. Build a complete, production-ready marketing landing page f...
SaaS Analytics Dashboard Full Build Spec
You are a Principal Product Designer + Frontend Lead. Design and specify a complete [LIGHT | DARK] analytics dashboard for [PRODUC...
SaaS Admin Panel Dashboard Build Spec
Design a full internal Admin Dashboard for [PRODUCT_NAME] used by [ADMIN_ROLE: support | ops | super-admin]. --- 🎯 CONTEXT Adm...