Course contentsShow
← React
Lesson 1553 of 2,39638. Server Components FundamentalsFree lesson

Why Islands Are Small: Minimizing the JS Bundle

The architectural goal of keeping client boundaries as small as possible to ship less code to the browser.

Why Islands Are Small: Minimizing the JS Bundle

What you'll learn: Why the architectural goal of Server Components is to keep client boundaries as small as possible to reduce JavaScript sent to the browser.

The Bundle Size Problem

Every component marked with 'use client' becomes part of your JavaScript bundle. When a client component imports libraries, event handlers, or other dependencies, all of that code must ship to the browser. The more client components you have, the larger your bundle grows, and the slower your app loads.

The "Island" Strategy

Think of client components as islands of interactivity in a sea of static server content. The goal is to make these islands as small as possible—like tiny tropical islands, not massive continents.

Instead of marking an entire feature as a client component, you identify only the interactive parts that need JavaScript. A button that tracks clicks? That's an island. The surrounding layout, text, and images? Those stay on the server.

Practical Impact

Consider a dashboard with charts. If you wrap everything in 'use client', you ship all the charting library code—often hundreds of kilobytes. But if you create small <ChartWidget> client components and keep the dashboard layout as a server component, you only ship JavaScript for the charts themselves.

This is why you learned to place 'use client' at the lowest point in your component tree. Push interactivity down as far as possible. The server tree does the heavy lifting; client islands handle clicks, hovers, and dynamic state.

Key Takeaway: Keep client boundaries small and specific—only mark components as 'use client' when they absolutely need browser interactivity. The smaller your islands, the less JavaScript you ship, and the faster your app loads.