vercel-react-best-practices

Audit Next.js pages for data-fetching waterfalls and bundle bloat.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Alfie728/my-skills --skill vercel-react-best-practices-alfie728
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/Alfie728/my-skills/tree/main/vercel-react-best-practices
Command: npx skills add https://github.com/Alfie728/my-skills --skill vercel-react-best-practices-alfie728

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill codifies Vercel Engineering's best practices to eliminate common React and Next.js performance pitfalls—especially sequential data-fetching waterfalls, oversized bundles, and server-client serialization overhead—that slow load times and increase user-perceived latency.

Core Features & Use Cases

  • Waterfall elimination: Patterns and examples to defer awaits, parallelize dependent tasks, and start promises early in API routes and Server Actions.
  • Bundle optimization: Guidance on avoiding barrel imports, using dynamic imports, deferring non-critical libraries, and preloading based on user intent.
  • Server & client data strategies: Recommendations for React.cache(), cross-request LRU caches, Suspense boundaries, SWR deduplication, and minimizing RSC serialization for efficient server rendering.
  • Use Case: Automate an audit of a Next.js page to identify blocking awaits, large initial imports, and RSC serialization bloat, then produce targeted refactors to improve TTI and LCP.

Quick Start

Use this skill to audit a Next.js page and recommend concrete refactors to remove waterfalls, split heavy bundles, and reduce server-side serialization.

Frequently Asked Questions about vercel-react-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix sequential data-fetching waterfalls in Next.js?

Eliminate sequential data-fetching waterfalls in Next.js by deferring awaits, parallelizing dependent tasks with Promise.all, and starting promises early in API routes and Server Actions. This approach removes blocking requests to improve load times.

What is the best way to reduce bundle size in a React application?

Reduce React bundle size by avoiding barrel imports, using next/dynamic imports for non-critical libraries, and deferring heavy dependencies. Preloading components based on user intent further optimizes initial load performance.

How does React.cache work with Suspense boundaries for server-side rendering?

React.cache deduplicates data fetches across server-side rendering requests, while Suspense boundaries handle async streaming. Combined with cross-request LRU caches, they minimize RSC serialization overhead and accelerate server rendering.

Why are my Next.js Server Actions slow and how can I optimize them?

Next.js Server Actions slow down due to sequential awaits and server-client serialization bloat. Optimize them by starting promises early, parallelizing tasks, and minimizing serialized data passed across the RSC boundary.

Can I automate a performance audit for my React components and API routes?

Yes, you can automate audits of React components and Next.js API routes to identify blocking awaits, large initial imports, and RSC serialization bloat, generating targeted refactors to improve TTI and LCP.

When should I not use dynamic imports in Next.js?

Avoid next/dynamic imports for above-the-fold critical components required for initial render, as deferring them delays LCP. Reserve dynamic imports for non-critical libraries to prevent oversized initial bundles without hurting core metrics.