vercel-react-best-practices
Optimize React and Next.js performance
๋ํ ๋ค์์์ ์ฌ์ฉํ ์ ์์ต๋๋ค: ZhanlinCui,vercel-labs
Build faster React and Next.js applications with proven performance patterns. This skill provides actionable guidelines from Vercel Engineering to eliminate waterfalls, reduce bundle size, and optimize rendering.
์คํฌ ZIP ๋ค์ด๋ก๋
Claude์์ ์ ๋ก๋
์ค์ โ ๊ธฐ๋ฅ โ ์คํฌ โ ์คํฌ ์ ๋ก๋๋ก ์ด๋
ํ ๊ธ์ ์ผ๊ณ ์ฌ์ฉ ์์
ํ ์คํธํด ๋ณด๊ธฐ
"vercel-react-best-practices" ์ฌ์ฉ ์ค์ ๋๋ค. Component with sequential useEffect fetches
์์ ๊ฒฐ๊ณผ:
Issue: Three useEffect hooks fetch data sequentially, causing render waterfall. Solution: Combine fetches into single useEffect with Promise.all() or convert parent to server component.
"vercel-react-best-practices" ์ฌ์ฉ ์ค์ ๋๋ค. Import statement pulling entire lodash library
์์ ๊ฒฐ๊ณผ:
Issue: import _ from lodash adds 72KB to bundle. Solution: Use tree-shakeable imports like import debounce from lodash/debounce or switch to lodash-es for better bundler optimization.
"vercel-react-best-practices" ์ฌ์ฉ ์ค์ ๋๋ค. Component recalculating expensive value on every render
์์ ๊ฒฐ๊ณผ:
Issue: Expensive computation runs on every render. Solution: Wrap in useMemo with proper dependencies, or extract to separate memoized component that only re-renders when inputs change.
๋ณด์ ๊ฐ์ฌ
์์ Static analysis detected 911 pattern matches across 51 files (4901 lines), but all findings are FALSE POSITIVES. The skill is a documentation-only repository containing React/Next.js performance optimization guidelines in markdown format. Detected patterns (shell commands, dynamic imports, fetch calls, storage access) exist solely as code examples within documentation, not as executable code. No actual security risks identified.
ํ์ง ์ ์
๋ง๋ค ์ ์๋ ๊ฒ
Building new React features
React developers building new features write components with optimal performance from the start, following Vercel-approved patterns for data fetching, rendering, and bundle optimization
Reviewing pull requests
Teams reviewing pull requests check code for performance anti-patterns before merging, catching waterfalls, unnecessary re-renders, and bundle bloat early in development
Migrating to Next.js App Router
Engineers migrating to Next.js App Router convert client-side patterns to server component architecture, learning proper use of server caching, serialization boundaries, and parallel data fetching
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Review this React component for performance issues. Identify any render waterfalls, unnecessary re-renders, or bundle optimization opportunities. Suggest specific improvements based on Vercel best practices.
This component fetches data sequentially. Refactor it to fetch in parallel using Promise.all() or restructure as server components. Explain which approach is better for this use case.
Analyze this server component's data fetching. Recommend a caching strategy using React.cache() for per-request deduplication or LRU caching for cross-request optimization. Include cache invalidation considerations.
Design a dashboard with 10+ widgets showing real-time and historical data. Specify: 1) Server vs client component boundaries, 2) Data fetching and caching strategy, 3) Loading states with Suspense, 4) Bundle optimization for third-party charting libraries.
๋ชจ๋ฒ ์ฌ๋ก
- Start promises early and await late - initiate data fetching before it's needed, defer await until value is required
- Use server components by default - only add 'use client' when browser APIs or interactivity are required
- Prefer SWR or React Query for client data fetching - built-in caching, deduplication, and revalidation
ํผํ๊ธฐ
- Sequential data fetching in separate useEffect hooks - causes render waterfalls
- Importing entire utility libraries - bloated bundles, use specific imports instead
- Using && for conditional rendering of components that render '0' - use ternary operator
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
When should I use server components vs client components?
How do I fix render waterfalls in my components?
What's the difference between React.cache() and LRU caching?
How can I reduce my Next.js bundle size?
Why does SWR help with client-side data fetching?
When should I use startTransition?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
์์ฑ์
sickn33๋ผ์ด์ ์ค
MIT
๋ฆฌํฌ์งํ ๋ฆฌ
https://github.com/sickn33/antigravity-awesome-skills/tree/main/web-app/public/skills/react-best-practices์ฐธ์กฐ
main
ํ์ผ ๊ตฌ์กฐ
๐ SKILL.md
๐ README.md
๐ metadata.json
๐ AGENTS.md
๐ rules/_sections.md
๐ rules/_template.md
๐ rules/async-*.md
๐ rules/bundle-*.md
๐ rules/server-*.md
๐ rules/client-*.md
๐ rules/rerender-*.md
๐ rules/rendering-*.md
๐ rules/js-*.md
๐ rules/advanced-*.md