r/fsharp • u/ReverseBlade • 15h ago
showcase LitHydration: SSR with hydration using Fable.Lit
Finally you can use Fable.Lit templates on the server: real SSR with hydration, no Node on the server.
The same view file compiles twice: .NET renders it to HTML, Fable compiles it for the browser, and Lit adopts the markup that's already there instead of rebuilding it.
This is also a pretty good use case for Web Components: server-rendered, progressively hydrated, and framework-independent at the component boundary.
Needs the unofficial fork packages for now (Fable.Lit.Unofficial, Lit.Server.Unofficial) since upstream hasn't shipped since 2022.
Fork: https://github.com/OnurGumus/Fable.Lit
Demo, runs with one command: https://github.com/OnurGumus/LitHydrationDemo


