News for hackers. Stuff that matters.

Show HN: Enforcing Safe RSC Boundaries

https://github.com/yuuichieguchi/capsule-rsc

React Server Components make it easy to accidentally break server/client boundaries: Dates silently turning into strings, non-serializable values leaking across the boundary, or runtime errors when a function slips through.

CapsuleRSC is a framework focused on one thing: mechanically enforcing RSC boundaries instead of relying on conventions.

It enforces safety at three layers: - Type-level: strict Serializable types - Build-time: ESLint rules that block boundary violations - Runtime: assertSerializable as a final backstop

It also uses capability injection to make server-side effects explicit rather than relying on globals like fetch or process.env.

There’s a small demo here: https://yuu1ch13-portfollio-tau-sepia.vercel.app/capsule-rsc

Feedback welcome.

( no comments | on HN )

There are no comments yet.