Scala-js-jfx – A structured UI DSL for Scala.js

Hi all,

I’d like to share a project I’ve been working on:
:backhand_index_pointing_right: https://anjunar.github.io/scala-js-jfx
:backhand_index_pointing_right: https://github.com/anjunar/scala-js-jfx

scala-js-jfx is a reactive UI framework for Scala.js with a strong focus on structure, lifecycle control, and composability.

The core idea is simple:
Instead of treating the UI as a loosely connected tree of components, it treats it as a well-defined, scoped system with explicit lifecycles and controlled state flow.

What makes it different

  • Structured lifecycle model
    Components are bound to explicit scopes (NodeScope / DisposeScope), avoiding hidden leaks and uncontrolled subscriptions.

  • Composable DSL
    A declarative, Scala-native UI DSL that stays type-safe without becoming verbose or “framework-heavy”.

  • No magic reactivity
    State changes are explicit and predictable. No hidden diffing, no implicit re-render storms.

  • Virtualization-first design
    Designed to handle large datasets efficiently (e.g. table virtualization, lazy loading, controlled rendering).

  • Clear separation of concerns
    UI, state, and lifecycle are not mixed implicitly – they are first-class concepts.

Motivation

In many frontend frameworks, complexity tends to accumulate in hidden layers:

  • implicit lifecycle handling

  • uncontrolled observers

  • unclear ownership of state

scala-js-jfx is an attempt to make these things explicit again, without losing developer ergonomics.

Current state

  • Already used in a real project (Technology Speaks)

  • Core patterns are stable

  • Published on Maven Central

  • Still evolving, feedback is very welcome

Why I’m sharing this

I’m curious how this resonates with others working in Scala.js.

Does this direction – more explicit structure instead of more abstraction – make sense to you?

Happy to hear thoughts, criticism, or ideas.

2 Likes