The place where random ideas get written down and lost in time.
2024-12-29 - Kotlin Web
Category DEVIt's time to look again at Kotlin for web development. Last time I tried it, a few years ago, it was embryonic and really not suitable for usage. Since then things have changed.
The entry point is Kotlin Multi Platform. It has now a version of Jetpack Compose: https://www.jetbrains.com/lp/compose-multiplatform/
The goal is to evaluate that against my use of Dart / Flutter on Firebase GCP.
There's currently some uncertainty in the future of Flutter. Dart should survive a bit longer as it still seems to be used internally by core projects, however the same can't be said of Flutter according to the water tank hearsay.
Evaluation criteria:
- How to build a Kotlin MP project.
- What can Compose do for the web.
- Overall app architecture.
- Integration with Firebase authentication.
- Integration with Firebase DB.
- Ecosystem of 3rd party libraries.
- Ease of maintenance over time.
These are all points where Flutter more or less excels. Dart seemed like a barrier at first, until I understood it as basically “Java/Kotlin meets Typescript”. After that, it just made sense and it's easy to work with and pick it up again when I only tweak a project once a year.
The “web UI” aspect of Flutter is familiar -- it's basically ReactJS, but easier to use, and better documented.
The Flutter doc is very strong, and the IJ plugin is a delight to use.
The Firebase Flutter library was a bit more annoying. It felt like a side project, with confusingly 2 names or implementations, and the doc was weak.
It sure works, but feels clumsy at times. For example the authentication has all sorts of knobs, yet the generated UI layout is not flexible at all and hard to customize -- clearly designed for mobile and weak on desktop. I have a feeling they almost expect users to ditch the UI and rewrite their own, using only the underlying API. I'm very afraid that's what I will have to do with Compose.
Anyhow, I need a guinea pig project. I'm thinking the Randall Automation Status web page might be a good candidate.