Hey, sorry if this has been asked before, but is t...
# compose
c
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
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
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
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
Is there a case of a reusable Composable that needs dependencies other than Compose?
v
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
There are multiple Compose dependencies – not all “mini-libraries” might need Material, for example.
v
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
It will also be an amazing learning tool as people can find what they are looking for and see how it was built ...
c
yeah I was trying to make an npm pun earlier but couldn't think of one 😛
z
My bad, they’re not annotations, they’re comments: https://www.kotlinresources.com/library/kscript/#script-configuration
c
it has both, I suppose comments would be more convenient?
v
I thought you were talking about this which also looked nice - https://github.com/holgerbrandl/kscript-annotations
z
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
JetBrain's Kotlin Script work allows for Kotlin to be interpreted instantly, which could be quite nice as well
z
Does it work with compiler plugins?
c
Boy trying to find that out with Google Search is quite a rabbit hole... I'm just gonna try and see
z
In particular, IR-based plugins.
👍 1