docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거

Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를
Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류.

- 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로
  자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거,
  동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거.
- 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming,
  Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business,
  Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로,
  나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는
  title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백).
  원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지.
- 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서.
- 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는
  지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지.
- Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경.
- 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
Antigravity Agent
2026-07-05 00:33:48 +09:00
parent 1cfd3bbb56
commit 9148c358d0
6455 changed files with 1 additions and 86875 deletions
@@ -0,0 +1,200 @@
---
id: wiki-2026-0508-nextjs-framework
title: Next.js Framework
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Next.js, NextJS, Nextjs]
duplicate_of: none
source_trust_level: A
confidence_score: 0.95
verification_status: applied
tags: [nextjs, react, ssr, framework, vercel]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: TypeScript
framework: Next.js 15
---
# Next.js Framework
## 매 한 줄
> **"매 Next.js 는 React-based full-stack framework — App Router (RSC) + Server Actions + Turbopack 의 조합"**. 2026 의 Next 15 는 매 React 19 RSC + Partial Prerendering (PPR) 안정화 + Turbopack 가 default. 매 Vercel 의 commercial backing.
## 매 핵심
### 매 Render 모드 (App Router)
- **Static (default)**: 매 build-time, ISR 가능.
- **Dynamic**: 매 request-time, `cookies()` / `headers()` 사용 시 자동 전환.
- **Streaming SSR**: 매 RSC + Suspense — 매 progressive HTML.
- **PPR (Partial Prerendering)**: 매 static shell + dynamic holes — 매 Next 15 default.
### 매 핵심 API
- **Server Components**: 매 default — 매 zero JS 전송.
- **`"use client"`**: 매 client component boundary.
- **Server Actions** (`"use server"`): 매 form / mutation, RPC 자동.
- **`fetch()` extension**: 매 cache, revalidate, tags.
### 매 응용
1. E-commerce (Shopify Hydrogen 영향).
2. Marketing site + blog (ISR 강점).
3. SaaS dashboard (RSC 로 bundle 감소).
4. AI chat UI — 매 streaming Server Action.
## 💻 패턴
### Server Component data fetch
```tsx
// app/posts/page.tsx — 매 server component, async 가능
async function PostsPage() {
const posts = await fetch("https://api.example.com/posts", {
next: { revalidate: 60, tags: ["posts"] },
}).then((r) => r.json());
return (
<ul>
{posts.map((p) => <li key={p.id}>{p.title}</li>)}
</ul>
);
}
export default PostsPage;
```
### Server Action (form mutation)
```tsx
// app/actions.ts
"use server";
import { revalidateTag } from "next/cache";
export async function createPost(formData: FormData) {
await db.post.create({ data: { title: formData.get("title") as string } });
revalidateTag("posts");
}
// app/new/page.tsx
import { createPost } from "../actions";
export default function NewPost() {
return (
<form action={createPost}>
<input name="title" />
<button type="submit">Save</button>
</form>
);
}
```
### Streaming with Suspense
```tsx
import { Suspense } from "react";
export default function Page() {
return (
<>
<Header /> {/* 매 즉시 stream */}
<Suspense fallback={<Skeleton />}>
<SlowProductList /> {/* 매 fetch 끝나면 stream-in */}
</Suspense>
</>
);
}
```
### Partial Prerendering (Next 15)
```tsx
// next.config.js
module.exports = {
experimental: { ppr: "incremental" },
};
// app/page.tsx — static shell + dynamic part
export const experimental_ppr = true;
import { cookies } from "next/headers";
async function CartCount() {
const session = (await cookies()).get("session");
// 매 dynamic — static shell 의 hole 로 stream
return <span>{await getCartCount(session?.value)}</span>;
}
export default function Page() {
return (
<>
<StaticHeader />
<Suspense fallback="0"><CartCount /></Suspense>
</>
);
}
```
### Route Handler (REST endpoint)
```ts
// app/api/users/route.ts
import { NextResponse } from "next/server";
export async function GET() {
const users = await db.user.findMany();
return NextResponse.json(users);
}
export async function POST(req: Request) {
const body = await req.json();
const user = await db.user.create({ data: body });
return NextResponse.json(user, { status: 201 });
}
```
### Middleware (auth gate)
```ts
// middleware.ts
import { NextResponse, type NextRequest } from "next/server";
export function middleware(req: NextRequest) {
const token = req.cookies.get("token");
if (!token && req.nextUrl.pathname.startsWith("/dashboard")) {
return NextResponse.redirect(new URL("/login", req.url));
}
}
export const config = { matcher: ["/dashboard/:path*"] };
```
### Image optimization
```tsx
import Image from "next/image";
<Image src="/hero.jpg" width={1200} height={600} alt="" priority />
// 매 자동 AVIF/WebP, srcset, lazy
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Marketing site | Static + ISR |
| User dashboard | RSC + Server Action |
| Realtime chat | "use client" + WebSocket |
| Mostly static + cart | PPR (Next 15) |
| Pure SPA | 매 Next 대신 Vite + React |
**기본값**: App Router + RSC + PPR. Pages Router 는 매 legacy.
## 🔗 Graph
- 부모: [[React]]
- 변형: [[Remix]] · [[Astro]] · [[SvelteKit]]
- Adjacent: [[React Server Components — 경계 의식]] · [[Turbopack]] · [[Edge Runtime]]
## 🤖 LLM 활용
**언제**: App Router migration, RSC 설계, Server Action 구현, PPR 적용.
**언제 X**: 매 pure backend (Express/Fastify), pure SPA.
## ❌ 안티패턴
- **`"use client"` on root layout**: 매 RSC 효과 무효 — 매 leaf 만.
- **`fetch` 안에 secret**: 매 client 로 leak 가능 — 매 Server Action 사용.
- **getInitialProps**: 매 Pages Router legacy — 매 App Router 에서 X.
- **Massive client bundle**: 매 Server Component 로 옮길 것.
## 🧪 검증 / 중복
- Verified (nextjs.org docs, React 19 RSC spec).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Next 15 RSC + PPR + Server Action |