r/elm • u/New_Form_1654 • 20h ago
Jorn 1.0: write your UI once in Elm, run it in the browser, on the server, or as a static site
Hi all! I've just released Jorn 1.0 (bazylhorsey/jorn on the package site).
Jorn has its own Element type: a virtual DOM that's plain Elm data, so view can be diffed anywhere. That lets one TEA program run three ways:
In the browser, with a small patcher script applying the diff.
On a server (Node, Deno or Bun), one instance per page, streaming JSON patches over websockets, SSE or polling. Effect.call lets update ask your server code for things like a database query, so there's no API layer. If you know Gleam's Lustre server components, it's the same idea, for Elm.
As a static site: jorn build renders every route to HTML and the app hydrates it. My portfolio is built this way: https://bazylhorsey.github.io
No kernel code and no fork. The Elm side is an ordinary package, and the TypeScript only covers the DOM patcher, server runtime and CLI. Jorn.Dev.Query and Jorn.Dev.Simulate let you test views and whole apps with elm-test.
The honest limits: it can't render elm/html, so elm-ui and elm-css don't work with it, and the time-travel debugger only works with Browser programs.
Repo: https://github.com/bazylhorsey/jorn I'd love feedback, especially on the API.