nextjs-react-expert
4
总安装量
4
周安装量
#48246
全站排名
安装命令
npx skills add https://github.com/dokhacgiakhoa/antigravity-ide --skill nextjs-react-expert
Agent 安装分布
amp
4
gemini-cli
4
antigravity
4
github-copilot
4
codex
4
kimi-cli
4
Skill 文档
Next.js & React Performance Expert
From Vercel Engineering – 57 optimization rules prioritized by impact Philosophy: Eliminate waterfalls first, optimize bundles second, then micro-optimize.
ð¯ Selective Reading Rule (MANDATORY)
Read ONLY sections relevant to your task! Check the content map below and load what you need.
ð´ For performance reviews: Start with CRITICAL sections (1-2), then move to HIGH/MEDIUM.
ð Content Map
| File | Impact | Rules | When to Read |
|---|---|---|---|
1-async-eliminating-waterfalls.md |
ð´ CRITICAL | 5 rules | Slow page loads, sequential API calls, data fetching waterfalls |
2-bundle-bundle-size-optimization.md |
ð´ CRITICAL | 5 rules | Large bundle size, slow Time to Interactive, First Load issues |
3-server-server-side-performance.md |
ð HIGH | 7 rules | Slow SSR, API route optimization, server-side waterfalls |
4-client-client-side-data-fetching.md |
ð¡ MEDIUM-HIGH | 4 rules | Client data management, SWR patterns, deduplication |
5-rerender-re-render-optimization.md |
ð¡ MEDIUM | 12 rules | Excessive re-renders, React performance, memoization |
6-rendering-rendering-performance.md |
ð¡ MEDIUM | 9 rules | Rendering bottlenecks, virtualization, image optimization |
7-js-javascript-performance.md |
⪠LOW-MEDIUM | 12 rules | Micro-optimizations, caching, loop performance |
8-advanced-advanced-patterns.md |
ðµ VARIABLE | 3 rules | Advanced React patterns, useLatest, init-once |
Total: 57 rules across 8 categories
ð Quick Decision Tree
What’s your performance issue?
ð Slow page loads / Long Time to Interactive
â Read Section 1: Eliminating Waterfalls
â Read Section 2: Bundle Size Optimization
ð¦ Large bundle size (> 200KB)
â Read Section 2: Bundle Size Optimization
â Check: Dynamic imports, barrel imports, tree-shaking
ð¥ï¸ Slow Server-Side Rendering
â Read Section 3: Server-Side Performance
â Check: Parallel data fetching, streaming
ð Too many re-renders / UI lag
â Read Section 5: Re-render Optimization
â Check: React.memo, useMemo, useCallback
ð¨ Rendering performance issues
â Read Section 6: Rendering Performance
â Check: Virtualization, layout thrashing
ð Client-side data fetching problems
â Read Section 4: Client-Side Data Fetching
â Check: SWR deduplication, localStorage
⨠Need advanced patterns
â Read Section 8: Advanced Patterns
ð Impact Priority Guide
Use this order when doing comprehensive optimization:
1ï¸â£ CRITICAL (Biggest Gains - Do First):
ââ Section 1: Eliminating Waterfalls
â ââ Each waterfall adds full network latency (100-500ms+)
ââ Section 2: Bundle Size Optimization
ââ Affects Time to Interactive and Largest Contentful Paint
2ï¸â£ HIGH (Significant Impact - Do Second):
ââ Section 3: Server-Side Performance
ââ Eliminates server-side waterfalls, faster response times
3ï¸â£ MEDIUM (Moderate Gains - Do Third):
ââ Section 4: Client-Side Data Fetching
ââ Section 5: Re-render Optimization
ââ Section 6: Rendering Performance
4ï¸â£ LOW (Polish - Do Last):
ââ Section 7: JavaScript Performance
ââ Section 8: Advanced Patterns
ð Related Skills
| Need | Skill |
|---|---|
| API design patterns | @[skills/api-patterns] |
| Database optimization | @[skills/database-design] |
| Testing strategies | @[skills/testing-patterns] |
| UI/UX design principles | @[skills/frontend-design] |
| TypeScript patterns | @[skills/typescript-expert] |
| Deployment & DevOps | @[skills/deployment-procedures] |
â Performance Review Checklist
Before shipping to production:
Critical (Must Fix):
- No sequential data fetching (waterfalls eliminated)
- Bundle size < 200KB for main bundle
- No barrel imports in app code
- Dynamic imports used for large components
- Parallel data fetching where possible
High Priority:
- Server components used where appropriate
- API routes optimized (no N+1 queries)
- Suspense boundaries for data fetching
- Static generation used where possible
Medium Priority:
- Expensive computations memoized
- List rendering virtualized (if > 100 items)
- Images optimized with next/image
- No unnecessary re-renders
Low Priority (Polish):
- Hot path loops optimized
- RegExp patterns hoisted
- Property access cached in loops
â Anti-Patterns (Common Mistakes)
DON’T:
- â Use sequential
awaitfor independent operations - â Import entire libraries when you need one function
- â Use barrel exports (
index.tsre-exports) in app code - â Skip dynamic imports for large components/libraries
- â Fetch data in useEffect without deduplication
- â Forget to memoize expensive computations
- â Use client components when server components work
DO:
- â
Fetch data in parallel with
Promise.all() - â
Use dynamic imports:
const Comp = dynamic(() => import('./Heavy')) - â
Import directly:
import { specific } from 'library/specific' - â Use Suspense boundaries for better UX
- â Leverage React Server Components
- â Measure performance before optimizing
- â Use Next.js built-in optimizations (next/image, next/font)