nextjs-rsc-performance-patterns
Installation
SKILL.md
Next.js RSC Performance Patterns
This skill provides expert knowledge on optimizing Next.js 14+ applications using the App Router, focusing on React Server Components (RSC), data fetching strategies, and rendering optimizations to improve Core Web Vitals.
RSC Data Fetching
React Server Components enable you to fetch data directly on the server, eliminating client-server request waterfalls and reducing JavaScript bundle size.
Parallel Data Fetching
Fetch independent data sources in parallel to minimize total wait time:
// app/product/[id]/page.tsx - GOOD
async function ProductPage({ params }: { params: { id: string } }) {
// These fetches happen in parallel - Next.js automatically deduplicates
const productPromise = fetch(`https://api.example.com/products/${params.id}`)
const reviewsPromise = fetch(`https://api.example.com/reviews?product=${params.id}`)