The import-versus-prop rule holds, but two cases fall outside it. First, props that cross the boundary must be serializable, so a plain function or class instance passed from a server file into a client component fails at runtime, while children works because the server has already rendered it. Second, the boundary follows transitive imports, so a barrel file (index.ts re-exporting everything) can pull a server-only module into the client graph without any visible import of it. Adding import 'server-only' to the data layer turns that case into a build error instead of silent bundle growth. After adding the provider, did you compare the client bundle size in the build output's per-route table before and after?
"'use client' Doesn't Turn Your Whole App Into a Client Component (The Children Trick Nobody Explain
3 Comments
Bubblegun
•
Anas Sheikh
•
@[Bubblegun] Good points! The transitive import issue is especially easy to overlook when using barrel files. I agree that checking the production bundle before and after adding a provider is the best way to verify its actual impact rather than making assumptions. Keeping server-only code isolated and client boundaries as small as possible makes a lot of sense.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
chevron_left
More From Anas Sheikh
Related Jobs
- Opportunistic ApplicationsHeadlands Technologies LLC · Full time · Singapore
- Product Manager @ Social app startupCheez · Full time · Hagerstown, MD
- Associate Client Solutions Director-TechnologyWorld Wide Technology · Full time · Hagerstown, MD
Commenters (This Week)
vadymchernets
1 comment
pvlakshm
1 comment
seosiri
1 comment
Contribute meaningful comments to climb the leaderboard and earn badges!