vercel-react-best-practices

Optimize React and Next.js applications with 57 prioritized performance rules.

8.9k|1.3k|Updated May 29, 2023
One-click install
npx skills add https://github.com/mfts/papermark --skill vercel-react-best-practices-mfts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-react-best-practices
Source: https://github.com/mfts/papermark/tree/main/.agents/skills/vercel-react-best-practices
Command: npx skills add https://github.com/mfts/papermark --skill vercel-react-best-practices-mfts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive set of rules and best practices to significantly improve the performance of React and Next.js applications, addressing critical areas like bundle size, server-side rendering, and re-render optimizations.

Core Features & Use Cases

  • Performance Auditing: Identifies and suggests fixes for performance bottlenecks in React/Next.js codebases.
  • Code Refactoring Guidance: Offers specific, actionable advice for optimizing data fetching, bundle size, and rendering.
  • AI-Assisted Development: Designed for agents and LLMs to ensure consistent application of performance best practices during code generation and maintenance.
  • Use Case: When refactoring a Next.js application, apply these rules to reduce initial load times, improve Time To Interactive (TTI), and enhance overall user experience.

Quick Start

Apply the vercel-react-best-practices skill to review and optimize the provided React component code for performance.

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 code refactoring?

To optimize React and Next.js performance, apply a set of 57 prioritized rules targeting bundle size reduction, server-side rendering, and re-render elimination. This provides specific code examples to reduce initial load times and improve Time To Interactive.

What is the best way to reduce bundle size in a Next.js application?

The best way to reduce bundle size involves applying targeted optimization rules that eliminate unnecessary code imports and split bundles effectively. This guide provides actionable code examples to minimize the initial JavaScript payload and enhance loading speed.

How does eliminating data fetching waterfalls improve React server-side performance?

Eliminating data fetching waterfalls improves React server-side performance by preventing sequential network requests from blocking rendering. Implementing parallel data fetching rules ensures faster server-side execution and reduces overall application latency.

Can I use these React optimization rules to guide AI-assisted code generation?

Yes, you can use these React optimization rules to guide AI-assisted code generation. The rules are designed for agents and LLMs to ensure consistent application of performance best practices during automated code generation and maintenance tasks.

Why does my Next.js application have poor Time To Interactive despite using server-side rendering?

Poor Time To Interactive in a Next.js application often stems from large bundle sizes or unoptimized re-renders. Applying targeted performance rules helps identify these bottlenecks, offering specific refactoring advice to enhance rendering efficiency.

Are there specific rules for React re-render optimization in complex components?

Yes, there are specific rules for React re-render optimization in complex components. The guide covers actionable strategies to prevent unnecessary re-renders, ensuring efficient state management and rendering cycles for enhanced application speed.