rsc-data-optimizer

Convert client-side data fetching to React Server Components in Next.js apps.

Updated Jul 8, 2022
One-click install
npx skills add https://github.com/limaon/dotfiles --skill rsc-data-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rsc-data-optimizer
Source: https://github.com/limaon/dotfiles/tree/main/.config/opencode/skills/rsc-data-optimizer
Command: npx skills add https://github.com/limaon/dotfiles --skill rsc-data-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps Next.js developers move data fetching from client components to server components to improve initial render performance and SEO by leveraging server-side rendering.

Core Features & Use Cases

  • Identify client-side data fetching patterns (useEffect + useState, useStore) that block the initial render.
  • Convert eligible pages to server components to render data on the server and reduce hydration delays.
  • Use in cases where pages rely on dynamic data during first paint, want to improve SEO, or eliminate loading spinners.

Quick Start

Identify a slow, client-side data fetching page, then follow the 3-step workflow to convert it to a server component and deploy.

Frequently Asked Questions about rsc-data-optimizer

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

FAQPage Schema
How do I convert client-side data fetching to server components in Next.js?

Converting client-side data fetching to server components in Next.js involves a 3-step workflow: identify data requirements, extract interactive sections, and convert the page to a server component to render data on the server.

Why does my Next.js page show a loading spinner before content appears?

Your Next.js page shows a loading spinner because client-side fetching via useEffect and useState blocks the initial render. Moving data fetching to server components eliminates loading spinners by rendering data directly on the server.

Can I use React Server Components to improve SEO for dynamic Next.js pages?

You can use React Server Components to improve SEO for dynamic Next.js pages by shifting data fetching to the server side, which delivers fully rendered HTML during the first paint and reduces hydration delays.

How do I handle interactive elements when converting a page to a server component?

When converting a page to a server component, handle interactive elements by extracting them into separate client components. This isolates interactivity while allowing the parent page to fetch data on the server.

Does this approach work with data-store patterns like useStore in Next.js?

This approach works by identifying data-store patterns like useStore that block the initial render. It targets these specific client-side state management patterns to convert eligible pages to server components for faster SSR.