Sharing a slide I am preparing for my next talk, p...
# multiplatform
d
Sharing a slide I am preparing for my next talk, putting KMP and JetpackCompose and SwiftUI on a timeline
๐Ÿ’ก 1
๐Ÿ‘ 3
r
Native support for multiplatform actually came in Feb 2018 during 1.2. 1.3 added the multiplatform gradle plugin and promoted Kotlin/Native to beta https://blog.jetbrains.com/kotlin/2018/02/kotlinnative-v0-6-is-here/ https://blog.jetbrains.com/kotlin/2018/10/kotlin-1-3/
s
Where did you get the timeline for Kotlin Multiplatform from? ๐Ÿค”
d
@Sebastian Sellmair [JB] I am assuming that in next Kotlin release MultiPlatform will be Beta, and that in the following one will be Stable. The new Kotlin release cycle is now every 6 months: https://blog.jetbrains.com/kotlin/2020/10/new-release-cadence-for-kotlin-and-the-intellij-kotlin-plugin/
@russhwolf thanks for pointing this out. I am going to update the timeline, linking Kotlin/Native support to Kotlin version 1.2.20
r
To Sebastian's point, you shouldn't expect the faster release cycle to mean things automatically get more stable each release. In fact you should expect the opposite: they want to decouple new features from specific releases, so they'll promote stability of features in the next major release after they're ready, rather than holding up a release while they work out the last bugs.
โ˜๏ธ 1
๐Ÿ‘ 2
d
I have updated the diagram like this:
๐Ÿ‘ 3
m
great info people, nice job ๐Ÿ‘
d
From my experience, multiplatform is already stable. I havenโ€™t come across blockers. Whether they will give it the โ€œBetaโ€ or โ€œStableโ€ label in the next months is not really going to affect our development plans.
m
I think the same, in my company we are already using the KMP for some Apps, and it's working really well, despite the technology is not in its final version
d
This is good to hear, I'm also going ahead with Multiplatform for a client, largely on the basis of having no roadblocks in a couple of personal proof-of-concepts.
A minor pickup on the timeline - that's the use of seasons, which are flipped here in Australia ๐Ÿ™‚. Q1-Q4 are location agnostic.
d
@darkmoon_uk good point! I will change that
๐Ÿ‘Œ 1
Here we go
d
Hey Daniele while you're here I just wanted to say thank you for your series of articles on KMP and Declarative UI's.
I recently gave some internal talks at work on this very combination of techs; and only immediately after discovered your articles.
I then shared these enthusiastically as I felt they did a better job of what I was 'aiming for' in the talk!
Definitely a compelling combination; consensus in my consultancy at the moment is that KMP is mature enough to use in production - the Declarative UI's, less so.
๐Ÿ‘ 1
d
@darkmoon_uk I am glad! I will be giving some talks in the next weeks: 14th Dec: DroidCon APAC 7th Jan: GDG Washington 13th Jan (tbc): GDG San Francisco 27th Jan (tbc): GDG Berlin 3rd Feb: Kotlin London
๐Ÿ‘ 1
d
That's quite a calendar - thanks - will make sure to catch those ๐Ÿ‘ ๐Ÿ‘
d
yes, I definitely think itโ€™s the perfect time to start designing apps with Kotlin Multiplatform and Declarative UIs
d
I'm at the foothills of a project where KMP is a dead cert; but we might just go MVP w/ traditional UI kits for the View.
d
oh, thatโ€™s a waste! especially if itโ€™s a greenfield project!
d
Pains me slightly as I'm a bit of a bleeding edge risk taker by nature ๐Ÿ™‚ but I have to do what's right by the client and my initial exploration with Compose and SwiftUI threw up some risks.
There's still time to be swayed though ๐Ÿ˜„ ๐Ÿ˜‰
One point of concern for me is the way SwiftUI mixes navigation logic in with the View declaration.
This feels like a blurring of layers
so I can use a Coordinator alongside the ViewModel quite happily for Android
...I but I feel like I'd be fighting SwiftUI to apply a Coordinator there.
d
I would say if the shipping date is Q4 2021, then go for KMP + declarative UIs, without any doubt If the shipping date is Q3 2021, then go for KMP + declarative UIs, expecting to retouch something in Q4. If the shipping date is Q2 2021, then only if you are brave
d
Yeah we're at the 'brave' end of the scale there.
d
ok ๐Ÿ˜„
d
I totally share your enthusiasm for the architecture; I fear being the guy standing in the middle of a fire with everyone's fingers pointing saying 'He said this was a good idea'
๐Ÿ™‚ 1
Yeah 6 months later, I think it'll change, this is fast moving
In a good way
d
Yes, I much prefer the JetpackCompose navigation to the SwiftUI. Itโ€™s much more flexible, as it uses the URI paradigm, which fits very well also in a โ€œCompose for Webโ€ perspective. SwiftUI navigation is much more limited, as they are trying to put too much magic in it.
I have built 2 apps already using the โ€œD-KMP architectureโ€ I talk about in the article. And they are by far the cleanest apps I have ever written. So, smooth. Such a graceful separation of concerns. And the code is so readable. No boilerplate whatsoever. And itโ€™s impressive to see how quick it is to fix any bug. Productivity easily improved by 3 times.
๐Ÿ‘ 1
๐Ÿ˜ฒ 1
K 1
d
Strong endorsement - I have some thinking to do ๐Ÿ™‚
As someone who always held a soft-spot for native desktop Apps, in a world of Web Apps, the prospect of sharing View implementation with JetBrains Compose is another star coming into alignment...
d
yes, being able to share the same code across any device is something that 2 years ago, but maybe not even 1 year ago, I could have imagined
Compose for Desktop is great, but the thing I am waiting with greatest expectations is Compose for Web. At the moment, I still cannot say if it will ever be able to compete with Javascript frameworks. But I think itโ€™s possible, especially as the future is WebAssembly and eventually it would probably be compiled for that.
๐Ÿ‘ 1
The great thing in using KMP with declarative UIs is that all the choices you make are independent from the UI layer. So, you donโ€™t really care much about what new platforms will become available. In the meantime you can just focus on the 85% shared code. Then you write your Android UI layer with JetpackCompose and your iOS UI layer with SwiftUI. And if anything later comes (such as Compose for Desktop or Compose for Web), you just need to add a tiny fraction of code to make it available for those platforms too.
โž• 1
๐Ÿ’ฏ 1
d
I hold faith that KMP/WASM + Compose is part of JB's divine plan โœจ โœจ ๐ŸŽโœจ K ๐Ÿง˜โ€โ™€๏ธ K โœจ ๐ŸŽ โœจ โœจ
๐Ÿ˜‚ 3
๐Ÿ‘ 2
s
What about adding Flutter
d
@sunbreak The talk is about the D-KMP architecture (Declarative UIs + Kotlin MultiPlatform), so Flutter is not taken into consideration. You can find more info in this article: https://danielebaroncelli.medium.com/the-future-of-apps-declarative-uis-with-kotlin-multiplatform-d-kmp-part-1-3-c0e1530a5343