gitignore 의 *.md / .claude/ 차단을 풀어 다음 파일을 git 으로 추적. - /CLAUDE.md, /AGENTS.md (루트 에이전트 가이드) - .agents/**/*.md (skills 문서 95개) - .claude/settings.json (Claude Code 프로젝트 설정) .claude/worktrees/ 는 git worktree 메타이므로 신규 ignore 라인으로 제외. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
996 B
Markdown
39 lines
996 B
Markdown
---
|
|
title: Minimize Serialization at RSC Boundaries
|
|
impact: HIGH
|
|
impactDescription: reduces data transfer size
|
|
tags: server, rsc, serialization, props
|
|
---
|
|
|
|
## Minimize Serialization at RSC Boundaries
|
|
|
|
The React Server/Client boundary serializes all object properties into strings and embeds them in the HTML response and subsequent RSC requests. This serialized data directly impacts page weight and load time, so **size matters a lot**. Only pass fields that the client actually uses.
|
|
|
|
**Incorrect (serializes all 50 fields):**
|
|
|
|
```tsx
|
|
async function Page() {
|
|
const user = await fetchUser() // 50 fields
|
|
return <Profile user={user} />
|
|
}
|
|
|
|
'use client'
|
|
function Profile({ user }: { user: User }) {
|
|
return <div>{user.name}</div> // uses 1 field
|
|
}
|
|
```
|
|
|
|
**Correct (serializes only 1 field):**
|
|
|
|
```tsx
|
|
async function Page() {
|
|
const user = await fetchUser()
|
|
return <Profile name={user.name} />
|
|
}
|
|
|
|
'use client'
|
|
function Profile({ name }: { name: string }) {
|
|
return <div>{name}</div>
|
|
}
|
|
```
|