I know there is a React wrapper. I haven’t used it yet, but I don’t like the looks of it. Multiplatform has been tricky enough. I’m hesitant to add yet another layer and a lot of baggage from Javascript-world.
I’m wondering if anyone is working on something written in Kotlin, for Kotlin, that uses that same principle of declarative UI, for web apps.
Since I spend time with SwiftUI and Jetpack Compose, I’d like something with that declarative style (which React also has). Ideally I could just use one of those for web, but I won’t hold my breath for that.
I’ve written some pretty complicated UIs just with Kotlin/JS and OOP “controllers” that manipulate the DOM. But I like the code clarity of the declarative style.
You can wait for Compose for Web as I do. Meanwhile, as they say, there are several Kotlin-first solutions. React covers most cases, but I am not happy with it (the JS part, not kotlin) and I want to try something else, but do not have time.
I wonder if the essential parts of React could be copied and used as a library and some design patterns in more traditional MVC code. What are these essential pieces? I can think of two at the moment…
The “reconciliation” algorithm - ie, taking the UI descriptions (generated by pure functions) and using them to update the browser DOM.
Imposing some global order on model change events, so that you don’t update UI that is about to be invalidated by another UI update further up the tree.
I am using react for now, but I am not happy with it. Don’t have time right now to experiment with a new technology, but I really like the compose prototype. And KVision is on my to-do list.