vercel-react-best-practices

Apply React and Next.js performance best practices to optimize rendering and bundle efficiency.

47.4k|14.7k|Updated Mar 22, 2021
One-click install
npx skills add https://github.com/calcom/cal.com --skill vercel-react-best-practices-calcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/calcom/cal.com/tree/main/.opencode/skill/vercel-react-best-practices
Command: npx skills add https://github.com/calcom/cal.com --skill vercel-react-best-practices-calcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates and disseminates proven React and Next.js performance strategies to help teams ship faster, more efficient web apps by guiding optimization decisions and code patterns.

Core Features & Use Cases

  • Rendering & bundle optimization: guidelines to reduce waterfalls, trim bundle size, and speed up initial paint.
  • Server/Client patterns: best practices for React Server Components, Suspense, and efficient data flows across server and client.
  • Use Case: during code reviews or refactors of React/Next.js apps, identify bottlenecks and propose concrete, automated improvements.

Quick Start

Instruct the AI to audit a React/Next.js project and apply the recommended performance patterns to improve render times, bundle size, and data-fetching strategies.

Frequently Asked Questions about vercel-react-best-practices

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

FAQPage Schema
What are the best practices for optimizing React and Next.js bundle size and rendering performance?

React Server Components optimize data fetching by executing on the server to avoid client-side waterfalls and reduce bundle size. Combined with Suspense, this pattern streamlines data flows across server and client contexts to improve initial render times.

How do I audit a Next.js project to identify React performance bottlenecks?

Auditing a Next.js project for React performance bottlenecks involves reviewing data fetching strategies and component rendering patterns. You identify inefficient client-server data flows and apply concrete improvements to reduce waterfalls and bundle bloat.

Does this approach to React performance work with standard client-side components?

Yes, these performance patterns apply to standard client-side React components by optimizing their rendering efficiency and bundle footprint. The guidelines address data flows and performance improvements across both client and server rendering contexts.

When should I use React Suspense for data fetching in Next.js?

React Suspense should be used in Next.js when you need to streamline asynchronous data flows and prevent rendering waterfalls. It suspends component rendering while awaiting data, enabling faster initial paint and better Time to Interactive.

What is the best way to reduce waterfalls in Next.js server components?

The best way to reduce waterfalls in Next.js server components is to colocate data fetching on the server and implement Suspense boundaries. This avoids sequential client-side requests and directly improves UI rendering efficiency.

Why does my React app have a large bundle size and slow Time to Interactive?

A large React bundle size and slow Time to Interactive usually result from excessive client-side JavaScript and data fetching waterfalls. Refactoring to use Next.js server components and bundle optimization patterns reduces client payload and accelerates initial paint.