About seven months ago, I wrote a blog post about where Compose could go
. This was written after the first milestone release of Compose for Desktop shipped, and I ran down some other possible Compose targets:
- Web: I pointed out that JetBrains appeared to be working on this, and they did indeed release a Compose for Web recently. I had expected that it would take the Skia canvas approach; instead, they are focused more on composables manipulating the DOM. In other words, this is Compose, not Compose UI/Compose Material.
- iOS: I was not expecting much here. As usual, Jake Wharton pushed the envelope, demonstrating composables driving a UIKit interface. Once again, this is Compose, not Compose UI/Compose Material.
- Chrome OS: As I wrote then, we have both Android and Linux options, so we are in reasonable shape here. It will be interesting if somebody does create a Compose for Web variant that uses the Skia canvas, with an eye towards using it for Chrome OS, Chrome extensions, or other “installed” Web apps.
- Fuchsia: Since I wrote that post, Fuchsia is slowly being rolled out to the Google Home Hub. However, there is still little sign of third-party apps, let alone ones that might be based on Compose.
The real fun is with “Platform X”. Here is what I wrote then:
If you were trying to create a new platform, to compete with the desktop, mobile, and Web options that we have today, your new platform will need apps. Adopting one of the cross-platform options (React, Flutter, Compose) would help a fair bit in getting developers interested in trying your platform, at least for conventional apps. For gaming-centric platforms, trying to adopt Unity 3D or similar cross-platform game engines would be the likely starting point.
If Google alone were pursing Compose, it would likely be an Android thing and that’s it. The fact that JetBrains has apparently decided to make Compose a focus area means that Compose is going to go further than just Android devices. We will have to see how well that turns out — after all, there is no guarantee that Compose will succeed beyond Android. But it has a lot of promise, and it will be interesting to see how the next 12 months or so play out!
To me the real power of Jake’s iOS demo, or Jake’s mosaic
, or even Google’s likely forthcoming Compose for App Widgets, is to further demonstrate how we can drive UI with Compose without that UI being defined
by Compose. Some Compose targets include Compose UI/Compose Material (Android, desktop). Some do not (iOS, terminal, app widgets). Some do not now but could, as an option, in the future (Web).
So, if you are creating Platform X, you can adopt Compose and decide the level of Compose support that you want:
- Composables, but to drive your own UI framework
- Composables, using a canvas to give you Compose UI/Compose Material support
- A “combo play”, where you offer your own UI composables but also support the canvas
These non-Material Compose targets demonstrate that the first option is viable and is not necessarily all that difficult. It is arcane — there are only a few people who know how to pull this off. But, given enough interest, the arcane can be codified, documented, and supported.
It will be interesting to see where else Compose goes and who might adopt it for some never-seen-before platform.