Good news, everyone! After couple of months of wor...
# compose-web
s
Good news, everyone! After couple of months of working on the compiler plugin, compose actually compiles and works in the browser! It is, obviously, only the beginning for the web version, as we don't have any proper API for building the DOM or anything else. Feel free to contribute/create something your own on top, if you want to! 😅 See the original tweet for the announcement and the repo links: https://twitter.com/shikasd_/status/1343350375248760832?s=20
🚀 1
👍 21
K 9
🎉 32
r
Could someone please explain, why Compose for Web needs to be developed as part of Android itself?
d
What do you mean by, as part of Android? It's built separately.
j
Because, among other things, the Compose Compiler had some built-in assumptions about JVM, and unwinding those assumptions required changes to the Compose Compiler. That either means forking (and constantly fighting merge conflicts) or upstreaming (merging into the androidx repository).
r
Is "compose compiler" just a kotlin compiler plugin? Do I understand correctly it's developed by Google as part of Android and Google has no interest in moving it to a separate repo (which would allow extending it easily to other platforms like web/desktop or even ios)?
s
I think the main source of confusion here is aosp being repository with "everything Android", including all Jetpack libraries, which Compose is a part of
☝🏼 3
👍 2
j
@Robert Jaros Yes, Compose is implemented as a Kotlin compiler plugin. We are pretty busy getting Beta and 1.0 out the door and don't have the infrastructure setup to move the compiler code out of AOSP at the moment. I wouldn't be philosophically oppose to moving it, but it takes effort and the ROI is not high as there is a ton of work involved in supporting other platforms. Moving the code out of androidx would NOT facilitate "extending it easily to other platform" in any meaningful way as upstreaming code back into AOSP (compared to some separate repository) is the least of your worries at that point.
r
So just the last question 😉. How far are we from the point, where adding some kind of compose dependency in the common module we will be able to easily develop android, desktop and web targets? 🙂 Months/years/decades? 🙂
o
Building add-ons on top of Compose would be cool, but likely JS story needs serious rework of core code as well. And amazing news, @shikasd , great New Year present!
5
❤️ 5
j
@Robert Jaros The speed is directly proportional to the rate of community contributions 😛, and you can help accelerate it by getting involved and fixing bugs. Andrei has done an incredible job of pioneering the way and being an exemplar open-source contributor, but it is a lot of work for one person to do themselves.
r
Exactly my point, it would be great to have some kind of single project to contribute, which could be forked, built and tested locally, with a list of open issues etc.
👍 1
For now I just know JB is working on something, somewhere, and at the some people other people like Andrei are working on some different code. I don't have the slightest idea how all this relates to each other (if at all).
5
d
@jim sorry I am a bit confused when you say “Moving the code out of androidx would NOT facilitate…” But earlier you said that the compiler code is part of AOSP. Can you clarify better the relationship between Compose and AOSP and AndroidX?
Oh, I think Andrei clarified, saying that Jetpack is actually considered part of AOSP.
👍 3
b
@shikasd great work! Thank you!