Show HN: Web Components SSR and hydration in 1KB– just a decorator, no framework

1 agiordanelli 0 8/20/2025, 2:32:50 AM github.com ↗
Hi HN,

I built Web Server Components, a minimalist (~1KB min+gz) TypeScript library that enables SSR + hydration with Custom Elements using just a simple decorator and base class — no frameworks, zero dependencies.

At its core:

withWSC decorator auto-registers your element.

WSC is an isomorphic HTMLElement wrapper — so you can safely call .render(...) on the server and append the same element client-side.

Highlights:

~1KB min+gz

Zero dependencies

Standards-only: Custom Elements + Declarative Shadow DOM

SSR + minimal hydration with no framework lock-in

Live demo: https://1kb.alexandre-giordanelli.workers.dev/

Repo: github.com/alexandregiordanelli/web-server-components

The goal is to show that you don’t need a framework to get SSR + hydration with Web Components — just a decorator and a lightweight HTMLElement wrapper.

Would love feedback, comparisons with other minimal SSR approaches (htmx, Lit, etc.), and ideas for improvements. Thanks!

Comments (0)

No comments yet