JFX2 – a Scala.js UI architecture with SSR, hydration, runtime metadata and source-first i18n

Hi all,

I’d like to share a project I’ve been working on:

https://anjunar.github.io/scalajs-jfx2/
https://github.com/anjunar/scalajs-jfx2

JFX2 is my current Scala.js UI architecture.

It started from the ideas behind scala-js-jfx, but goes further in one important direction: I wanted the UI layer to feel like one coherent system instead of a loose collection of widgets, helpers, and integration points.

The main idea is to keep several concerns inside one architectural model:

  • declarative UI composition in Scala

  • reactive state

  • SSR + hydration

  • typed controls and forms

  • runtime metadata for domain models

  • JSON mapping

  • source-first i18n

What I was aiming for is not “Scala syntax on top of the DOM”, but a structure where UI, state, metadata and transport stay aligned.

A few aspects that matter to me:

  • SSR and hydration are first-class concerns, not afterthoughts

  • forms can bind to domain models with runtime metadata

  • i18n is source-first instead of key-first

  • virtualization is part of the system design

  • the DSL is meant to stay declarative and readable even as applications grow

The project is still evolving, but the core direction is already visible in the docs and examples.

I’m sharing it because I’d be genuinely interested in feedback from people working with Scala.js:
does this direction make sense to you?

Especially interesting to me would be reactions to these questions:

  • Is there value in bringing runtime metadata more directly into the UI layer?

  • Does source-first i18n feel like a better model than traditional key-based catalogs?

  • How do you see the tradeoff between architectural integration and library minimalism in Scala.js UI work?

Happy to hear criticism, questions, or thoughts.

5 Likes