diff --git a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/ILithoDebugComponentDescriptorExtension.kt b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/ILithoDebugComponentDescriptorExtension.kt deleted file mode 100644 index eede79d04bf..00000000000 --- a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/ILithoDebugComponentDescriptorExtension.kt +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.flipper.plugins.uidebugger.litho - -import com.facebook.inject.statics.BoundSetStatic -import com.facebook.litho.DebugComponent -import kotlinx.serialization.json.JsonObject - -@BoundSetStatic -interface ILithoDebugComponentDescriptorExtension { - fun getExtraTags(node: DebugComponent): Set? - - fun getExtraHiddenAttributes(node: DebugComponent): JsonObject? -} diff --git a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/UIDebuggerLithoSupport.kt b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/UIDebuggerLithoSupport.kt index b43e8de4c12..edfc368ba28 100644 --- a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/UIDebuggerLithoSupport.kt +++ b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/UIDebuggerLithoSupport.kt @@ -10,7 +10,11 @@ package com.facebook.flipper.plugins.uidebugger.litho import com.facebook.flipper.plugins.uidebugger.core.ConnectionListener import com.facebook.flipper.plugins.uidebugger.core.UIDContext import com.facebook.flipper.plugins.uidebugger.descriptors.DescriptorRegister -import com.facebook.flipper.plugins.uidebugger.litho.descriptors.* +import com.facebook.flipper.plugins.uidebugger.litho.descriptors.ComponentTreeDescriptor +import com.facebook.flipper.plugins.uidebugger.litho.descriptors.DebugComponentDescriptor +import com.facebook.flipper.plugins.uidebugger.litho.descriptors.LithoViewDescriptor +import com.facebook.flipper.plugins.uidebugger.litho.descriptors.MatrixDrawableDescriptor +import com.facebook.flipper.plugins.uidebugger.litho.descriptors.TextDrawableDescriptor import com.facebook.flipper.plugins.uidebugger.model.FrameworkEvent import com.facebook.flipper.plugins.uidebugger.model.FrameworkEventMetadata import com.facebook.litho.ComponentTree @@ -137,9 +141,12 @@ object UIDebuggerLithoSupport { event.attributeOrNull(attributeName)?.let { attributes[attributeName] = it.toString() } } + lateinit var DebugComponentDescritpor: DebugComponentDescriptor + private fun addDescriptors(register: DescriptorRegister) { register.register(LithoView::class.java, LithoViewDescriptor) - register.register(DebugComponent::class.java, DebugComponentDescriptor(register)) + DebugComponentDescritpor = DebugComponentDescriptor(register) + register.register(DebugComponent::class.java, DebugComponentDescritpor) register.register(TextDrawable::class.java, TextDrawableDescriptor) register.register(MatrixDrawable::class.java, MatrixDrawableDescriptor) register.register(ComponentTree::class.java, ComponentTreeDescriptor(register)) diff --git a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/descriptors/DebugComponentDescriptor.kt b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/descriptors/DebugComponentDescriptor.kt index 9b47585f749..2aa0234b054 100644 --- a/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/descriptors/DebugComponentDescriptor.kt +++ b/android/plugins/litho/src/main/java/com/facebook/flipper/plugins/uidebugger/litho/descriptors/DebugComponentDescriptor.kt @@ -16,7 +16,6 @@ import com.facebook.flipper.plugins.uidebugger.descriptors.Id import com.facebook.flipper.plugins.uidebugger.descriptors.MetadataRegister import com.facebook.flipper.plugins.uidebugger.descriptors.NodeDescriptor import com.facebook.flipper.plugins.uidebugger.descriptors.OffsetChild -import com.facebook.flipper.plugins.uidebugger.litho.ILithoDebugComponentDescriptorExtensionStatic import com.facebook.flipper.plugins.uidebugger.litho.LithoMountableTag import com.facebook.flipper.plugins.uidebugger.litho.LithoTag import com.facebook.flipper.plugins.uidebugger.litho.descriptors.props.ComponentDataExtractor @@ -250,14 +249,6 @@ class DebugComponentDescriptor(val register: DescriptorRegister) : NodeDescripto override fun getTags(node: DebugComponent): Set { val tags: MutableSet = mutableSetOf(LithoTag) - - for (id in ILithoDebugComponentDescriptorExtensionStatic.getKeys()) { - val extraTags = ILithoDebugComponentDescriptorExtensionStatic.getExtraTags(id, node) - if (extraTags != null) { - tags.addAll(extraTags) - } - } - if (node.component.mountType != Component.MountType.NONE) { tags.add(LithoMountableTag) } @@ -312,21 +303,7 @@ class DebugComponentDescriptor(val register: DescriptorRegister) : NodeDescripto return mountingData } - private fun mergeJsonObjects(obj1: JsonObject, obj2: JsonObject): JsonObject { - return JsonObject(obj1.toMap() + obj2.toMap()) - } - - override fun getHiddenAttributes(node: DebugComponent): JsonObject? { - var hiddenAttributes = JsonObject(mapOf()) - for (id in ILithoDebugComponentDescriptorExtensionStatic.getKeys()) { - val extraHiddenAttributes = - ILithoDebugComponentDescriptorExtensionStatic.getExtraHiddenAttributes(id, node) - if (extraHiddenAttributes != null) { - hiddenAttributes = mergeJsonObjects(hiddenAttributes, extraHiddenAttributes) - } - } - return hiddenAttributes - } + override fun getHiddenAttributes(node: DebugComponent): JsonObject? = null class OverrideData( val metadataPath: List,