Hey, I plan to start a personal project and I woul...
# javascript
r
Hey, I plan to start a personal project and I would like to make the frontend in Kotlin. What are viable solutions right now? I remember looking at some React things in Kotlin but it was mostly PoC at the time.
I think Kotlin -> wasm isn’t ready, it would have been nice to try that as well
b
Kotlin react is definitely the most stable way to go now. JB team themselves are using it, so they provide up to date wrappers for it.
r
r
Yeah React and KVision were the 2 solutions I found to be currently under development. Thanks
b
Just to be clear, kotlin react is not a react implementation in kotlin. It's just a bunch of JS wrappers for the actual JS react
As for KVision, it's definitelly worth a look, especially if you;re considering multiplatform architecture
r
Well I do use multiplatform but I don’t see anything about it in KVision’s doc?
In the end I’ll probably want multiple frontends
b
It's not built as universal frontend if that's what you expect. It has support with simmilar structure wrapping the common frontend technologies for all platforms
e.g. bootstrap for web, electron for desktop, cordova for mobile
From my experience the only downside to it that it is a bit rigid, not allowing for too much customisations
But everything is doable with it, just in a slightly constrained manner
Furthermore the author is open to pull requests if you are missing a specific feature
r
I don’t think I’ll use things like electron and cordova. I prefer to use Kotlin/Native on iOS, and actual Android app, and probably OpenJFX on desktop
I understand that it’s more work but it’s also more fun and more performance
b
For MPP client architecture I'd strongly recomment to look into MVP (ModelViewPresenter) design.
It'll allow you to put all the client logic in a shared module and only implement the "skins" (i.e. display logic) in platform-specific module
👍 1
r
Yes, that’s what I use. I’m not sure if I’ll be able to only have the View part for each platform, I don’t have the frontends designed yet
b
I'm currently working on the example of this. Can share it with you if you;re interested.
r
I have a MPP app in production for Android & iOS already
Which actually shares code with some of the backends
b
If it's MVP and you're able to share code I'd very much like to have a look at it
r
That’s work code I don’t have the right to share unfortunately. I did made some Gists a long time ago about one specific problem https://gist.github.com/Ribesg/95a172ceb2177d74cf5b15993d40092e
b
Unfortunately I'm interested in how people implement MPP MVP, rather than the tooling setup. But it's fine.
r
Well it’s kinda straightforward, iOS and Kotlin/Native are a pain but in general it works great. We write our ViewControllers in Swift to ease outlets mapping.