Settings

Theme

Show HN: Enforcing Safe RSC Boundaries

github.com

2 points by yuu1ch13 2 months ago · 0 comments · 1 min read

Reader

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 yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection