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

Michal Bacik

10/31/2019, 8:19 PM
What is the official name of these
@Composable
functions (or result that they create on UI tree)? Widget, node, component or else?
l

Luca Nicoletti

10/31/2019, 8:26 PM
ComponentNode
?
j

jim

10/31/2019, 8:26 PM
I've been calling them "composables" (short for composable functions). I've also seen the terms "widget" and "component" used.
Node is probably more often used to describe the emittables (leaf nodes of a call tree) lower down in the Compose tech stack, so I personally/internally probably wouldn't use that word to describe the composables that users would see/use.
l

Luca Nicoletti

10/31/2019, 8:29 PM
I was addressing the
result that they create on UI tree
part 😛
m

Michal Bacik

10/31/2019, 8:29 PM
I preffer Widget. But creators should decide, also for sake of future documentation.
j

jim

10/31/2019, 8:29 PM
Haha, well, in that case,
emittable
or
node
is perfectly reasonable 🙂
@Michal Bacik Well, I frequently use widget in conversation, so yeah, that's a fine word too.
👌 1
l

Luca Nicoletti

10/31/2019, 8:33 PM
Someone here in the channel (🧌 ) doesn’t like more than 1 way to address things, so, first thing first: set a name and make it const val
🤔 1
m

Michal Bacik

10/31/2019, 8:34 PM
@Luca Nicoletti Absolutely agree. We all know what
View
is, so it should be crystal clear what single item is in Compose UI.
l

Luca Nicoletti

10/31/2019, 8:35 PM
If you refer to the code, then
Emittable
and its implementations are what you’re looking for
I was trolling 🧌, I’m fine with being able to address to them with different names
p

Pablichjenkov

10/31/2019, 8:44 PM
May I ask what is emitted in this case? is it drawing commands to the GPU?
m

Michal Bacik

10/31/2019, 8:50 PM
@Luca Nicoletti I don't mean how actual implementation class is named, we don't ever meet
Emittable
. We're given
@Composable
annotation, that's all that is common for these "widgets".
@Pablichjenkov I'm not sure if these widgets are directly using GPU. They get chance to draw to Canvas, actually clipped rectangle on it. The Canvas is as big as the activity window. Or not?
j

jim

10/31/2019, 9:36 PM
@Pablichjenkov Compose bottoms out at Emittables, which are base nodes in the given view system. For example, Compose will bottom out when it hits an AndroidView (like a WebView or ViewGroup) in the hierarchy. It will also bottom out when it hits a
LayoutNode
(which is a
ComponentNode
) that ComposeUI uses to determine positioning and clipping information.
l

Leland Richardson [G]

10/31/2019, 9:49 PM
compose UI’s emittables are
ComponentNode
and its subclasses
and fwiw, i’ve been trying to use “composable” or “composable function” when describing composable functions
“component” is also a term i find myself using a lot, mostly due to its relation to “react component” and i think it’s a reasonable vernacular depending on who you’re talking to
👌 1
p

Pablichjenkov

10/31/2019, 9:55 PM
ComponentNode
🤔 interesting. Thank you all. Is there any documentation about how the measurement and layout of these Nodes work yet? Just for general culture.
l

Leland Richardson [G]

10/31/2019, 9:59 PM
check out Layout.kt and corresponding documentation on DAC
👍 1
p

Pablichjenkov

10/31/2019, 10:02 PM
Thanks one more time
f

Fudge

10/31/2019, 10:35 PM
Someone here in the channel (🧌 ) doesn’t like more than 1 way to address things, so, first thing first: set a name and make it const val
It’s nice to know my principles are holding up. There should be an agreed way to address it. Widget is for Flutter , Component is for react, composable has too many syllables, so there isn’t a best answer I can suggest though.
If you would press me against a wall I would say component
p

Pablichjenkov

10/31/2019, 10:43 PM
But then it will remind you of React.
Emittable
sounds very streamish. Still open in the air 😸
l

Leland Richardson [G]

10/31/2019, 11:07 PM
i am loving the snark that is emerging out of this slack channel lol
❤️ 1
Emittable is a specific term that is distinct from composable functions
it means the elements of the actual tree that compose builds
and a @Composable function is not one of those elements, so Emittable isn’t up for grabs here
p

Pablichjenkov

10/31/2019, 11:56 PM
Composable
fair enough.
r

romainguy

11/01/2019, 3:41 AM
@jim @Leland Richardson [G] Widget is already too overloaded on Android
l

Luca Nicoletti

11/01/2019, 8:36 AM
View
🧌
m

Michal Bacik

11/01/2019, 8:44 AM
Compo
🙂
2 Views