I've thought it would be great if node type emitte...
# compose
l
I've thought it would be great if node type emitted from
@Composable
is defined with the annotation. (I know this can't be adopted as it is a huge breaking change) Now there are a lot of things using Compose runtime; Compose UI, Glance, Some terminal(I do not remember the name), and can be extended freely. If both Compose UI and Glance had
Text
, it would be a lot confusing. 🧵
The code of `ComposeNode`:
Copy code
if (currentComposer.applier !is E) invalidApplier()
This checks type at runtime, I don't think this is a great solution. I initially thought like:
Copy code
annotation class ComposableAnnotation(val nodeType: KClass<*>)
Copy code
@ComposableAnnotation(Any::class) // anything
annotation class Composable
// in compose ui
@ComposableAnnotation(ComposeUiNode::class)
annotation class UiComposable
I know this is weird... Are there better ways?
z
There's a compiler check for this that's in the works, but idk when it's going to be released.
👍 1