Jetpack Compose was first announced by Google at I/O 2019. For those that don’t know, Compose is a declarative UI framework. It will replace the traditional View-based system that has been part of Android since the beginning. In this post, I’ll explain why there hasn’t been any Compose content on Styling Android up to now. I’ll also talk about what the future holds.
When Compose was first announced, it was very embryonic. The development has been very public. This has allowed developers to play with it and provide feedback. This was an excellent way of doing things and has Compose is all the better for it, in my opinion.
The very early versions of Compose were very different to what we have now. Compose didn’t have an alpha release until August 2020 – over a year after it first went public. After that, it hit beta in February 2021. At the time of writing (early May 2021) it’s at beta06 release. The APIs appear to have stabilised over the last few releases. And it is beginning to look like a stable and useable framework.
As I have already suggested, Compose has evolved significantly since the early pre-alpha releases. Not only has the API surface changed, refined, and grown, but the semantics and overall usability have also improved vastly.
While this is fundamentally a good thing, some of these improvements have resulted in breaking changes with new releases. Therein lies the rub: an unstable API surface makes Compose more difficult to use for production projects. Each new release risks breaking your app in unexpected ways. This can add increased development overhead.
The blogger perspective
From my perspective as a technical blogger, this introduces additional overhead. It is important to try and keep the information accurate. But doing that is non-trivial when you maintain a blog in your spare time and have over 500 published articles. Even libraries with relatively small API footprints such as Data Store can have breaking API changes. These require follow-up articles to cover.
For a much larger API surface like Compose, this would be almost impossible for me to maintain. So, early on I made the decision to wait until Compose became stable before covering it.
Searching for information and guides on Compose can be a tricky business. It is very easy to find outdated information. For me, it has almost become second nature to look at the publication date. I only bother to read articles which are fairly recent.
In hindsight, I think I was right not to add to the amount of outdated information that’s currently out there.
A blog named Styling Android which does not cover the latest UI trends may be something of a misnomer. So it is only natural that my position on blogging about Compose needs to change at some point.
I feel that point has come.
I have already mentioned that the APIs have stabilised over the last few releases. Compose is currently at beta06 release, so it would seem likely that it is approaching a stable 1.0 release. With I/O 2021 approaching, it would seem plausible that an RC or even stable release is coming soon. Even if it’s not, the stability of the APIs is making it far less problematic to use in production.
So, I’m beginning to plan some posts about Compose. I don’t see much value in adding basic how-to guides as there are plenty of those. Instead, I’m going to look at concrete, real-world use-cases. Specifically where Compose can make possible things that are pretty difficult if not impossible using Views.
The future is bright. The future is Compose.
© 2021, Mark Allison. All rights reserved.
Copyright © 2021 Styling Android. All Rights Reserved.
Information about how to reuse or republish this work may be available at http://blog.stylingandroid.com/license-information.