Communitygithub.com

Next.js 16 Launchpad

Next.js 16 con Turbopack, Cache Components y proxy.ts. Ideal para iniciar, migrar y construir proyectos con App Router y React 19.

¿Qué es Next.js 16 Launchpad?

Next.js 16 Launchpad es una habilidad diseñada para desarrolladores que trabajan con Next.js 16, aprovechando las nuevas características como Turbopack como bundler predeterminado, Cache Components con la directiva 'use cache', y proxy.ts para un control explícito de middleware. Esta guía proporciona instrucciones detalladas de inicio rápido, configuración mínima, patrones esenciales como Server Components, Client Components, y Partial Pre-Rendering, así como un checklist de migración detallado desde v15. Soporta plataformas como Vercel y entornos Docker/Node, y es compatible con React 19.2, TypeScript 5.1+ y Node.js 20.9+. Los desarrolladores pueden usar esta habilidad para bootstrapping de nuevos proyectos, migración de aplicaciones existentes y construcción de aplicaciones modernas con App Router, mejorando el rendimiento y la productividad.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/calel33/next-js-16-launchpad

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace Next.js 16 Launchpad?

Next.js 16: Turbopack predeterminado (compilaciones 2-5× más rápidas), Cache Components ('use cache') y proxy.ts para control explícito.

Cuándo usarlo

✅ Next.js 16, Turbopack, Cache Components, migración proxy, App Router, React 19.2

❌ Pages Router, Next.js ≤15, preguntas genéricas de React

Requisitos

HerramientaVersión
Node.js20.9.0+
TypeScript5.1.0+
React19.2+

Inicio rápido

# Nuevo proyecto
npx create-next-app@latest my-app

# Actualizar proyecto existente
npx @next/codemod@canary upgrade latest
npm install next@latest react@latest react-dom@latest

Recomendado: TypeScript, ESLint, Tailwind, App Router, Turbopack, alias @/*.

Configuración mínima

// app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  )
}
// app/page.tsx
export default function Page() {
  return <h1>¡Hola, Next.js 16!</h1>
}

Configuración

// next.config.ts
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  cacheComponents: true,
  reactCompiler: true,
}

export default nextConfig

Cambios v15 → v16

v15v16
experimental.turbopackPredeterminado
experimental.pprcacheComponents
middleware.ts (Edge)proxy.ts (Node)
params síncronoawait params

Patrones principales

1. Server Components (predeterminado)

export default async function BlogPage() {
  const res = await fetch('https://api.example.com/posts')
  const posts = await res.json()
  return <PostList posts={posts} />
}

2. Cache Components

import { cacheLife } from 'next/cache'

export default async function BlogPage() {
  'use cache'
  cacheLife('hours')
  const posts = await fetch('https://api.example.com/posts').then(r => r.json())
  return <PostList posts={posts} />
}

3. Client Components

'use client'
import { useState } from 'react'

export default function Counter() {
  const [count, setCount] = useState(0)
  return (
    <div>
      <p>Contador: {count}</p>
      <button onClick={() => setCount(count + 1)}>+</button>
    </div>
  )
}

4. Proxy Boundary

// app/proxy.ts
export function proxy(request: NextRequest) {
  if (!request.cookies.get('auth') && request.nextUrl.pathname.startsWith('/dashboard')) {
    return NextResponse.redirect(new URL('/login', request.url))
  }
  return NextResponse.next()
}

5. Cache Tags + Server Actions

// app/blog/page.tsx
'use cache'
cacheLife('hours')
cacheTag('blog-posts')

export default async function BlogList() {
  const posts = await db.posts.findMany()
  return <PostList posts={posts} />
}
// app/actions.ts
'use server'
import { updateTag } from 'next/cache'

export async function createPost(data: PostData) {
  await db.posts.create(data)
  updateTag('blog-posts')
}

6. Streaming con Suspense

export default function Dashboard() {
  return (
    <div>
      <Suspense fallback={<Skeleton />}>
        <RevenueCard />
      </Suspense>
      <Suspense fallback={<Skeleton />}>
        <UsersCard />
      </Suspense>
    </div>
  )
}

async function RevenueCard() {
  const data = await db.analytics.revenue()
  return <div>{data}</div>
}

Conceptos clave

  1. Turbopack - Bundler en Rust, compilación incremental, Fast Refresh
  2. Server Components - Predeterminados en app/, cero JS en cliente
  3. Client Components - 'use client', hooks, APIs del navegador
  4. Cache Components - 'use cache' + cacheLife() para PPR
  5. Proxy Boundary - proxy.ts para autenticación/reescrituras/redirecciones
  6. Partial Pre-Rendering - Caparazón estático + streaming dinámico

Checklist de migración

  1. APIs de solicitud asíncronas

    npx @next/codemod@canary async-request-api
    

    Actualizar: const { slug } = await params

  2. middleware.ts → proxy.ts

    • Renombrar archivo, exportar proxy
    • Solo runtime Node (no Edge)
  3. Actualizaciones de configuración

    • Eliminar banderas experimental.*
    • Activar cacheComponents, reactCompiler
    • Eliminar serverRuntimeConfig/publicRuntimeConfig
  4. Cache Components

    • Reemplazar experimental.ppr con cacheComponents: true
    • Envolver secciones dinámicas con <Suspense>
  5. Imágenes

    • Configurar images.localPatterns para cadenas de consulta

Consulta references/nextjs16-migration-playbook.md para la guía completa.

Problemas comunes

❌ Mezclar 'use cache' con APIs de tiempo de ejecución (cookies(), headers()) ❌ Falta de <Suspense> cuando Cache Components está activado ❌ Importaciones de Sass con tilde bajo Turbopack ❌ Ejecutar proxy.ts en tiempo de ejecución Edge

✅ Leer cookies/encabezados primero, pasarlos como props a componentes en caché ✅ Envolver hijos dinámicos en <Suspense> ✅ Usar importaciones Sass estándar ✅ Usar tiempo de ejecución Node para proxy

Guía de decisiones

¿Activar Cache Components? → Sí para contenido estático/semiestático → No para paneles totalmente dinámicos

¿Dónde vive la autenticación? → proxy.ts para verificaciones entre rutas → Route handlers para lógica específica de la API

¿Cuándo usar 'use client'? → Solo cuando necesites hooks, estado o APIs del navegador → Mantén los componentes de presentación en el lado del servidor

Patrones de producción

Comercio electrónico

// Página de producto con streaming
export default async function Product({ params }) {
  const { id } = await params
  const product = await db.products.findById(id)
  
  return (
    <>
      <ProductInfo product={product} />
      <Suspense fallback={<ReviewsSkeleton />}>
        <Reviews productId={id} />
      </Suspense>
    </>
  )
}

Panel de autenticación

// proxy.ts
export function proxy(request: NextRequest) {
  const session = request.cookies.get('session')
  if (!session && request.nextUrl.pathname.startsWith('/dashboard')) {
    return NextResponse.redirect(new URL('/login', request.url))
  }
}

Consulta references/nextjs16-advanced-patterns.md para más plantillas.

Rendimiento

  • Mantén Turbopack habilitado (desactívalo con --webpack solo si es necesario)
  • Paraleliza las solicitudes con Promise.all
  • Usa <Suspense> para límites de streaming
  • Habilita la caché del sistema de archivos para repositorios grandes

Seguridad

  • Usa el paquete server-only + React Taint API
  • Mantén la autenticación en proxy.ts
  • Valida las entradas en Server Actions
  • Protege las variables de entorno con el prefijo NEXT_PUBLIC_
  • Extrae cookies/encabezados antes de ámbitos en caché

Despliegue

  • Vercel: Configuración cero
  • Docker/Node: output: 'standalone'
  • Monitorea los tiempos de compilación (se espera 2-5× de aceleración)
  • Configura los ciclos de vida de la caché para que coincidan con la CDN

Archivos de referencia

  • references/nextjs16-reference.md - Instalación/configuración/listas de verificación
  • references/nextjs16-migration-playbook.md - Guía de migración con codemods
  • references/nextjs16-advanced-patterns.md - Patrones de streaming, caché y autenticación
  • references/NEXTJS_16_COMPLETE_GUIDE.md - Documentación completa
  • scripts/bootstrap-nextjs16.ps1 - Script de configuración automatizado
  • assets/app-router-starter/ - Implementación de referencia

Recursos

Versión: 1.1.0 | Actualizado: 2025-12-27

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

Skills relacionados