C.W.K.
Stream
Lesson 02 of 08 · published

Next.js 가 주는 것들

~22 min · conventions, Turbopack, App Router

Level 0Curious
0 XP0/68 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Convention 표 한 번에

React 가 안 채우는 자리마다 Next.js 한테 convention 이 있어. 한 번 외워두면 매번 다시 발견 안 해:

문제Convention
RoutingFile-system: page.tsx 가 들어 있는 폴더 = route
LayoutSegment 마다 layout.tsx, navigation 너머에서도 살아남음
Loadingloading.tsx, Suspense 자동 wiring
Errorsegment 마다 error.tsx, root 에 global-error.tsx
API endpointroute.ts handler (GET/POST/…)
Server dataasync Server Component, fetch 직접
MutationServer Action ('use server')
BundlingTurbopack (Rust) — v16 부터 default
Image / font / scriptnext/image, next/font, next/script
Production 서버next start — Node 어디든, 또는 self-host edge

Starter 모양

CLI 가 default 깔아줘 — TypeScript on, ESLint on, App Router on, Turbopack on, Tailwind 선택, src/ 선택, import alias @/*.

표 외워두는 가치

Next.js 헷갈림 대부분이 위 표 건너뛰고 이미 box 에 있는 걸 npm 으로 다시 끌어오면서 생겨. 표 먼저 보고, 거기 있으면 built-in 써.

Code

최신 Next.js project bootstrap·bash
npx create-next-app@latest cwk-app
cd cwk-app
# 고를 것: TypeScript yes, ESLint yes, Tailwind yes (or no), App Router yes,
# Turbopack yes, src/ no, import alias '@/*'.
npm run dev
# Turbopack HMR 로 http://localhost:3000 dev server
설치 결과 한 번 확인·bash
tree -L 2 -I node_modules
# .
# ├── app/
# │   ├── layout.tsx
# │   ├── page.tsx
# │   └── globals.css
# ├── public/
# ├── next.config.ts
# ├── package.json
# └── tsconfig.json

External links

Exercise

npx create-next-app@latest 돌리고 한 페이지 정리해 — 어떤 file 이 만들어졌는지, entry route 는 어디고, root layout 은 어디인지. 어떤 prompt 에서 default 받았고 왜 그랬는지도 메모.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.