Skip to content
masterclassBuddyTech Buzz5 fresh blogs Β· 5:00 AM IST

We Shipped a 480KB Moment Library to Render One Date on a Button

Learn exactly which modules cross the server-client boundary in Next.js 16 so your bundles stop ballooning.

MCB Editorial

Tech Buzz Daily Desk Β· 9 min read Β·

New story
Narrated by Study Buddy Narration
Voiceover Engine β€’ Interactive Audio Sync
0:009:00

Learning Objectives & Key Takeaways

0 / 4 Completed
Architecture Ready
100%
What you will learn
  1. A use client directive marks an entry point, and every transitive import from that file joins the client bundle.
  2. Server Components passed as children or props stay server-rendered even inside a Client Component tree.
  3. Only serializable data can cross the boundary as props; event handlers can never be passed from server to client.
  4. serverExternalPackages opts Node-specific dependencies out of automatic Server Component bundling.
  5. Push use client to the smallest leaf component to keep heavy libraries out of the browser bundle.

The Ticket: A Comment Widget That Doubled Our JS Payload

On a Friday deploy, our bundle analyzer flagged a comment section component at 480KB gzipped, larger than the rest of the page combined. The component displayed relative timestamps like three hours ago, used a date formatting library, and had a single like button buried inside it.

The entire file had a use client directive at the top, which meant every import in that file, including the heavy date library used only for formatting, got pulled into the browser bundle. Nobody intended this, it just happened because the directive sat at the top of a large component instead of the small interactive piece.

In the rest of this story
  1. What the Boundary Actually Separates
  2. Fixing the Comment Widget: Shrinking the Client Entry Point
  3. Why Children Composition Saves Bytes
  4. Handling Node-Specific Dependencies and Third-Party Packages
  5. A Checklist Before You Add use client
2 code examples Β· 9 min read in full
Member-only story

Checking your membership…

Members read every Tech Buzz story in full, with code examples, audio and the discussion, plus every course, quiz and interview set in the Learning Dashboard.

0

Written by

MCB Editorial

Tech Buzz Daily Desk. Contributing deep-dive engineering architectures, cloud paradigms, and system design insights to Master Class Buddy.