| 1 | --- |
| 2 | title: Minimize Serialization at RSC Boundaries |
| 3 | impact: HIGH |
| 4 | impactDescription: reduces data transfer size |
| 5 | tags: server, rsc, serialization, props |
| 6 | --- |
| 7 | |
| 8 | ## Minimize Serialization at RSC Boundaries |
| 9 | |
| 10 | 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. |
| 11 | |
| 12 | **Incorrect (serializes all 50 fields):** |
| 13 | |
| 14 | ```tsx |
| 15 | async function Page() |
| 16 | const user = |
| 17 | return <Profile |
| 18 | } |
| 19 | |
| 20 | ("use client"); |
| 21 | function Profile({ user |
| 22 | return <div>{ |
| 23 | } |
| 24 | ``` |
| 25 | |
| 26 | **Correct (serializes only 1 field):** |
| 27 | |
| 28 | ```tsx |
| 29 | async function Page() |
| 30 | const user = |
| 31 | return <Profile |
| 32 | } |
| 33 | |
| 34 | ("use client"); |
| 35 | function Profile({ name |
| 36 | return <div>{ |
| 37 | } |
| 38 | ``` |