https://kotlinlang.org logo
#compose
Title
# compose
m

Mehdi Haghgoo

01/07/2021, 1:45 PM
Is there a technical reason Compose is not supported on stable A.S. versions?
s

sindrenm

01/07/2021, 2:00 PM
IIRC, the Compose tooling doesn't pass the requirements of being added to the stable (or beta) releases yet. That's why it keeps getting moved to the next canary when the current canary goes into beta.
j

jim

01/07/2021, 2:01 PM
Correct. No technical reason, just a policy of non-stable features not being shipped in non-stable builds of AndriodStudio.
❤️ 1
s

sindrenm

01/07/2021, 2:01 PM
Was on an episode of Android Developers Backstage recently, but I don't quite remember which one. Might've been the most recent one.
❤️ 1
m

Mehdi Haghgoo

01/07/2021, 2:10 PM
A little confusing. Let's say I am adding almost all Compose requirements (kotlin compiler version and kotlin compiler extension version) to the gradle files, and then it gives me notice that Compose is only supported on Canary versions of the IDE. So, my guess is in addition to gradle changes, the IDE also has to have a clue what Compose is, and currently only Canary ones do.
a

annsofi

01/07/2021, 2:13 PM
the preview is one example of IDE tooling, that only works in the canaries
❤️ 1
j

jim

01/07/2021, 2:25 PM
Yeah, there are a bunch of things that require additional tooling support. Even, for instance, to use capital letters as in the names of your composable functions requires us suppressing the default IDE diagnostic, which is tooling. You'll have a better experience if you use tools that support Compose, and those tools are experimental and thus only available in the canaries. But if you were to use a different IDE (including stable AS), as long as your gradle file is correct, your code will technically still "work", just the IDE might not help you at best and mislead you at worst. Ultimately an IDE is just a text editor that understands/supports the text you're editing.
🙏 1
❤️ 1
s

sindrenm

01/07/2021, 4:06 PM
Hmm … does that also mean that you can use a pre-canary version of the AGP? Because I seem to remember that's not really the case, ot at least that it wasn't the case earlier. It would seem like it worked at first glance, but there were certain things that wouldn't work. Things like the state machine or something, I believe. 🤔
j

jim

01/07/2021, 4:12 PM
Yeah, technically it is possible to configure Compose with the old AGP although it isn't quite as easy as just setting the
composeOptions
block; you need to set the same flags that AGP would have set. (
-Xplugin=
being the main one)
s

sindrenm

01/07/2021, 5:14 PM
Ahh, right. 👍