Communitygithub.com

Next.js 16 Launchpad

Next.js 16 mit Turbopack, Cache Components und proxy.ts. Verwende es zum Bootstrap, zur Migration und zum Erstellen mit App Router und React 19.

Was ist Next.js 16 Launchpad?

Dieses Skill hilft Entwicklern, Next.js 16-Projekte zu bootstrappen, zu migrieren und zu erweitern. Es nutzt die wichtigsten Neuerungen von Next.js 16: Turbopack als Standard-Bundler (2-5× schnellere Builds), Cache Components mit `'use cache'` und der `cacheLife()`-Funktion für partielles Pre-Rendering (PPR) sowie die `proxy.ts`-Datei für explizite Kontrolle von Middleware wie Authentifizierung, Rewrites und Redirects auf Node.js-Basis (anstelle des bisherigen Edge-basierten `middleware.ts`). Das Skill behandelt die Umstellung von Next.js 15 auf 16, die Konfiguration von `cacheComponents: true` und `reactCompiler: true` in `next.config.ts`, die Verwendung von Async-Request-APIs (`await params`) und die optimale Nutzung von Server- und Client-Komponenten sowie Streaming mit Suspense. Es enthält einen Migrations-Checklist, Entscheidungsleitfäden, Beispielcode für E-Commerce und authentifizierte Dashboards sowie Verweise auf umfassende Referenzdateien für tiefgehende Themen. Der Fokus liegt auf Best Practices für Produktion, Performance, Sicherheit und Deployment auf Vercel oder Docker.

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

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Next.js 16 Launchpad?

Next.js 16: Turbopack als Standard (2-5× schnellere Builds), Cache Components ('use cache') und proxy.ts für explizite Steuerung.

Wann verwenden

✅ Next.js 16, Turbopack, Cache Components, Proxy-Migration, App Router, React 19.2

❌ Pages Router, Next.js ≤15, allgemeine React-Fragen

Voraussetzungen

ToolVersion
Node.js20.9.0+
TypeScript5.1.0+
React19.2+

Schnellstart

# Neues Projekt
npx create-next-app@latest my-app

# Vorhandenes Upgrade
npx @next/codemod@canary upgrade latest
npm install next@latest react@latest react-dom@latest

Empfohlen: TypeScript, ESLint, Tailwind, App Router, Turbopack, @/*-Alias.

Minimal Setup

// 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>Hallo, Next.js 16!</h1>
}

Konfiguration

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

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

export default nextConfig

Änderungen v15 → v16

v15v16
experimental.turbopackStandard
experimental.pprcacheComponents
middleware.ts (Edge)proxy.ts (Node)
Synchrone paramsawait params

Kernmuster

1. Server-Komponenten (Standard)

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-Komponenten

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-Komponenten

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

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

4. Proxy-Grenze

// 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-Aktionen

// 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 mit 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>
}

Schlüsselkonzepte

  1. Turbopack – Rust-Bundler, inkrementelle Kompilierung, Fast Refresh
  2. Server-Komponenten – Standard in app/, kein Client-JS
  3. Client-Komponenten – 'use client', Hooks, Browser-APIs
  4. Cache-Komponenten – 'use cache' + cacheLife() für PPR
  5. Proxy-Grenze – proxy.ts für Authentifizierung/Rewrites/Redirects
  6. Partielles Pre-Rendering – Statisches Gerüst + dynamisches Streaming

Migrations-Checkliste

  1. Async-Request-APIs

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

    Aktualisieren: const { slug } = await params

  2. middleware.ts → proxy.ts

    • Datei umbenennen, proxy exportieren
    • Nur Node-Laufzeit (nicht Edge)
  3. Konfigurationsupdates

    • experimental.*-Flags entfernen
    • cacheComponents, reactCompiler aktivieren
    • serverRuntimeConfig/publicRuntimeConfig entfernen
  4. Cache-Komponenten

    • experimental.ppr durch cacheComponents: true ersetzen
    • Dynamische Abschnitte mit <Suspense> umschließen
  5. Bilder

    • images.localPatterns für Abfragezeichenfolgen konfigurieren

Siehe references/nextjs16-migration-playbook.md für die vollständige Anleitung.

Häufige Fallstricke

❌ 'use cache' mit Laufzeit-APIs (cookies(), headers()) mischen ❌ Fehlendes <Suspense> bei aktivierten Cache-Komponenten ❌ Tilde-Sass-Importe unter Turbopack ❌ proxy.ts auf Edge-Laufzeit ausführen

✅ Cookies/Header zuerst lesen, als Props an gecachte Komponenten übergeben ✅ Dynamische Kind-Elemente in <Suspense> einschließen ✅ Standard-Sass-Importe verwenden ✅ Node-Laufzeit für Proxy verwenden

Entscheidungsleitfaden

Cache-Komponenten aktivieren? → Ja für statische/semi-statische Inhalte → Nein für vollständig dynamische Dashboards

Wo lebt die Authentifizierung? → proxy.ts für routenübergreifende Prüfungen → Route Handler für API-spezifische Logik

Wann 'use client' verwenden? → Nur wenn Hooks, Zustand oder Browser-APIs benötigt werden → Präsentationskomponenten serverseitig belassen

Produktionsmuster

E-Commerce

// Produktseite mit 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>
    </>
  )
}

Authentifiziertes Dashboard

// 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))
  }
}

Weitere Vorlagen in references/nextjs16-advanced-patterns.md.

Leistung

  • Turbopack aktiviert lassen (nur bei Bedarf mit --webpack deaktivieren)
  • Abrufe mit Promise.all parallelisieren
  • <Suspense> für Streaming-Grenzen verwenden
  • Dateisystem-Cache für große Repos aktivieren

Sicherheit

  • server-only-Paket + React-Taint-API verwenden
  • Authentifizierung in proxy.ts belassen
  • Eingaben in Server-Aktionen validieren
  • Umgebungsvariablen mit NEXT_PUBLIC_-Präfix versehen
  • Cookies/Header vor gecachten Bereichen extrahieren

Deployment

  • Vercel: Zero-Config
  • Docker/Node: output: 'standalone'
  • Build-Zeiten überwachen (2-5× Beschleunigung erwartet)
  • Cache-Lebenszyklen an CDN anpassen

Referenzdateien

  • references/nextjs16-reference.md – Installation/Konfiguration/Checklisten
  • references/nextjs16-migration-playbook.md – Migrationsanleitung mit Codemods
  • references/nextjs16-advanced-patterns.md – Streaming-, Cache- und Authentifizierungsmuster
  • references/NEXTJS_16_COMPLETE_GUIDE.md – Vollständige Dokumentation
  • scripts/bootstrap-nextjs16.ps1 – Automatisiertes Setup-Skript
  • assets/app-router-starter/ – Referenzimplementierung

Ressourcen

Version: 1.1.0 | Aktualisiert: 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

Verwandte Skills