WEB Signal 499
Proposal to add a JVM target to Compose HTML for type-safe server-side rendering
Frederik Pietzko explores extending Compose HTML, which currently only compiles to JS for browser-side SPAs, with a JVM target so Kotlin developers can render HTML server-side using typed Composable functions instead of string-based templating languages like Thymeleaf or JSP.
The JVM ecosystem lacks a component-based SSR framework comparable to Next.js, Nuxt, or SvelteKit, relying instead on templating engines that lose type safety at the boundary between code and markup. If Compose HTML gained a JVM target, backend developers could write server-rendered UI as compiler-checked Kotlin functions, catching refactoring and type errors at compile time rather than runtime.
Written by elseif from the cluster below · every claim links back to a sourceThe three things worth knowing
Compose HTML already uses the Compose runtime to build browser SPAs via the Kotlin/JS compiler, but has no JVM target and therefore cannot do server-side rendering today.
Existing JVM SSR libraries like Thymeleaf and JSP rely on string-based templating languages where parameter names and types are invisible to the compiler, so rename or type mismatches surface only at runtime.
Kobweb, Kilua, and Summon already use Compose for web rendering with varying degrees of SSR or prerendering support, and a shared JVM target in Compose HTML could give them a common foundation.
THE CLUSTER
↗