vercel-react-best-practices

Review React and Next.js code for performance optimization best practices.

38|3|Updated Mar 22, 2024
One-click install
npx skills add https://github.com/anthonyshew/dotfiles --skill vercel-react-best-practices-anthonyshew
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/anthonyshew/dotfiles/tree/main/opencode/.config/opencode/skills/vercel-react-best-practices
Command: npx skills add https://github.com/anthonyshew/dotfiles --skill vercel-react-best-practices-anthonyshew

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured, rule-based guide for optimizing React and Next.js code to improve performance. It addresses common bottlenecks like waterfalls, large bundles, slow data fetching, and SSR/CSR inefficiencies, enabling teams to write, review, and refactor code with confidence.

Core Features & Use Cases

  • Guided performance patterns for eliminating waterfalls, bundle size optimization, and server/client data-fetching strategies.
  • Actionable rules & examples covering common Next.js patterns, such as parallel data fetching, suspense boundaries, and lazy loading.
  • Use Case: When reviewing a React component or Next.js page, apply these practices to ensure fast render and low bundle size.

Quick Start

Run a performance audit on your React/Next.js project and implement the top-priority rules from the guide.

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 optimize React and Next.js performance during a code review?

To optimize React and Next.js performance during code reviews, apply rule-based guidelines targeting waterfalls, large bundles, and slow data fetching. Reviewers check components and pages against actionable rules for parallel data fetching, suspense boundaries, and bundle size reduction.

What's the best way to eliminate data fetching waterfalls in Next.js?

The best way to eliminate data fetching waterfalls in Next.js is implementing parallel data fetching and suspense boundaries. These performance patterns restructure sequential requests into concurrent operations, significantly reducing load times for server and client rendered pages.

How do I reduce bundle size when refactoring React components?

Reduce bundle size when refactoring React components by applying lazy loading and strict bundle optimization rules. Evaluate component imports against performance guidelines to eliminate unnecessary code and ensure fast render times.

When do I need suspense boundaries for React data fetching?

You need suspense boundaries for React data fetching when resolving slow asynchronous operations that delay render. Suspense boundaries allow the UI to stream content progressively, preventing data fetching bottlenecks from blocking the entire page load.

Can I use these React performance patterns for both SSR and CSR pages?

Yes, you can use these React performance patterns for both SSR and CSR pages. The guidelines specifically address server/client data-fetching strategies and rendering inefficiencies, ensuring fast render times across different Next.js rendering approaches.

Why does my Next.js page load slowly despite using server-side rendering?

Your Next.js page may load slowly due to sequential data fetching or large bundle sizes despite SSR. Apply performance guidelines to identify waterfalls, implement parallel fetching, and add suspense boundaries to improve render efficiency.