- Scala 97.7%
- JavaScript 1.9%
- Shell 0.2%
- Nix 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| benchmarks | ||
| docs | ||
| documentation | ||
| e2eApp | ||
| rootSliceApp | ||
| scalive | ||
| scripts | ||
| test | ||
| .envrc | ||
| .gitignore | ||
| .scalafix.conf | ||
| .scalafmt.conf | ||
| AGENTS.md | ||
| build.mill | ||
| DomDefsGenerator.mill | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| NpmAssets.mill | ||
| README.md | ||
Scalive
Live interfaces. Typed end to end.
Scalive is a Scala 3 reimplementation of the Phoenix LiveView programming model. It keeps application state, rendering, and effects on the server, handles browser interactions as typed messages, and sends efficient HTML updates through the Phoenix LiveView client.
Scalive provides Scala-first APIs for typed models, messages, routes, forms, components, and HTML, with ZIO for effects. It targets observable LiveView behavior and feature coverage rather than Phoenix source or API compatibility.
Warning
Scalive is alpha software. APIs may change without compatibility shims, and feature coverage and production maturity are still evolving. Review the project status and compatibility matrix before use.
A LiveView In Scala
import scalive.*
import zio.{Task, ZIO}
final class CounterLiveView extends LiveView[CounterLiveView.Msg, Int]:
import CounterLiveView.Msg
def mount(ctx: MountContext): Task[Int] =
ZIO.succeed(0)
def handleMessage(model: Int, ctx: MessageContext) =
case Msg.Decrement => ZIO.succeed(model - 1)
case Msg.Increment => ZIO.succeed(model + 1)
def view(model: Signal[Int]): HtmlElement[Msg] =
mainTag(
h1("Scalive counter"),
button(typ := "button", on.click(Msg.Decrement), "Decrease"),
outputTag(aria.live := "polite", model.map(_.toString)),
button(typ := "button", on.click(Msg.Increment), "Increase")
)
object CounterLiveView:
enum Msg:
case Decrement, Increment
Run the counter or build it from scratch.
Start Here
- Learn the programming model
- Explore runnable examples
- Browse the API reference
- Check Phoenix LiveView compatibility
Development
Enter the repository development environment and run the common checks:
nix develop
mill __.reformat + __.fix
mill __.test
mill documentation.check
The Nix shell also provides the hash-pinned Phoenix client resources required by
the Mill build. Run maintainer builds inside nix develop; published artifacts
remain self-contained and impose no Nix requirement on application consumers.
The snapshot workflow also runs the root-slice and upstream Phoenix LiveView browser suites.
Report bugs, missing behavior, and focused feature requests through GitHub issues.
License
Scalive is available under the MIT License.