TreeNodes are generated for types that aren't actually components
See original GitHub issueI’m not sure if this is actually a bug so feel free to correct me. I noticed that treehouse is generating TreeNodes for enums even when they’re not supposed to be used like a component in the view hierarchy. Here’s an example from Cash App:
// Enum:
@Node(3)
@Serializable
@SerialName("DialogAction")
data class DialogAction(...) : Action() {
@Node(14)
enum class ButtonStyle {
@Property(1)
STANDARD,
@Property(2)
DESTRUCTIVE,
}
// Generated code:
public interface ButtonStyle<T : Any> : TreeNode<T> {
public override fun apply(diff: PropertyDiff): Unit {
when (val tag = diff.tag) {
else -> throw IllegalArgumentException("Unknown tag $tag")
}
}
}
The generated node also becomes part of the NodeFactory
. Other examples in our project include BoxLayout
, BoxLayoutDirection
, and BoxLayoutItem
which are all inner classes of Box
. Is this expected?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Everything you need to know about tree data structures
A tree is a collection of entities called nodes . Nodes are connected by edges . Each node contains a value or data...
Read more >Primefaces Tree, TreeNode, TreeTable Example Tutorial
Each TreeNode has been created by passing two arguments; encapsulated data object instance and parent reference. Properties of every TreeNode ...
Read more >Tree (data structure) - Wikipedia
In computer science, a tree is a widely used abstract data type that represents a hierarchical tree structure with a set of connected...
Read more >Trees – Hacking with Swift+
Trees. Trees are an extraordinarily simple, extraordinarily useful data type, and in this article we'll make a complete tree data type using Swift...
Read more >Simply Scheme: Introducing Computer Science ch 18: Trees
The components of a tree are called nodes. At the top is the root node of the tree; in the interior of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like it!
I’m moving the parser into its own module. Hold off for now.
@Node
becomes@TypeId
, but I was mulling@EntityId
instead yesterday…