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

caelum19

10/19/2020, 4:13 PM
Hey, sorry if this has been asked before, but is there plans for some easier way to share Composables? Creating a project just for that Composable and submitting it to jitpack, and then sticking it on your github for anyone lucky enough to stumble upon it isn't ideal. Now that Composables are so reusable and detached, something like a Composable marketplace for easier sharing, discovery, using and updating would be really cool
Perhaps an AS plugin that modifies the build.gradle? Or something more detached from Android and Gradle
v

Vinay Gaba

10/19/2020, 4:34 PM
something like a Composable marketplace for easier sharing, discovery
This is something that I’ve been working on and will be launching in a couple days. It’s not doing everything that you listed but covers the discoverability aspect. Here’s a work in progress version with mock data. Still needs cleaning up but as an MVP this is close - https://jetpackcompose.app/wip
🔥 2
😮 8
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 4:38 PM
I was just thinking about that this weekend too lol. It would be neat to be able to share code as a gist with something like kscript annotations for dependencies, and then bring in that gist as a maven dep.
v

Vinay Gaba

10/19/2020, 4:40 PM
Yeah something along the lines of “Lightweight Jitpack” would be super useful. Not just for Compose but for any piece of code that doesn’t deserve to be a library but still is useful.
3
c

caelum19

10/19/2020, 5:19 PM
Is there a case of a reusable Composable that needs dependencies other than Compose?
v

Vinay Gaba

10/19/2020, 5:28 PM
I was just thinking that maybe we should constraint it to Compose so that those dependencies can be pre-added to whatever tool is built. I think that is a totally reasonable thing to do!
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 5:28 PM
There are multiple Compose dependencies – not all “mini-libraries” might need Material, for example.
v

Vinay Gaba

10/19/2020, 5:31 PM
true! I haven’t used kscript annotations for dependencies so I’m not sure how far we can take it but if those allow me to explicitly add compose dependencies then maybe we don’t need anything pre-added.
Also I just realized we are basically talking about
npm for Compose
😄
a

Ash

10/19/2020, 5:32 PM
It will also be an amazing learning tool as people can find what they are looking for and see how it was built ...
c

caelum19

10/19/2020, 5:32 PM
yeah I was trying to make an npm pun earlier but couldn't think of one 😛
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 5:33 PM
My bad, they’re not annotations, they’re comments: https://www.kotlinresources.com/library/kscript/#script-configuration
c

caelum19

10/19/2020, 5:33 PM
it has both, I suppose comments would be more convenient?
v

Vinay Gaba

10/19/2020, 5:33 PM
I thought you were talking about this which also looked nice - https://github.com/holgerbrandl/kscript-annotations
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 5:34 PM
would be neat to be able to use kscript to run compose android apps… kinda like SwfitUI’s single-function apps
2
oh, that’s probably what i was thinking of. I thought i’d seen annotations for that at some point. I would normally think annotations are better, because code completion/type safety, but if you’re editing code in a gist, you don’t get auto-completion anyway so idk
1
c

caelum19

10/19/2020, 5:35 PM
JetBrain's Kotlin Script work allows for Kotlin to be interpreted instantly, which could be quite nice as well
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 5:37 PM
Does it work with compiler plugins?
c

caelum19

10/19/2020, 6:03 PM
Boy trying to find that out with Google Search is quite a rabbit hole... I'm just gonna try and see
z

Zach Klippenstein (he/him) [MOD]

10/19/2020, 6:06 PM
In particular, IR-based plugins.
👍 1