Add bloks integration infra + Layout result wrapper

Summary:
This adds the base infra for the UIDebugger bloks integration as well as an implementation for the Layout result wrapper for bloks. When theUIDebugger is connected we wrap the original layout result with a debug varient that delegates all methods to the original layout result but also provides access to the bloks model.

This allows the UIDebugger to inspect the Layout result and bloks model together

Reviewed By: pasqualeanatriello

Differential Revision: D43444444

fbshipit-source-id: ac531a0c7491c05db1d6f7671e3ab09c73c213b9
This commit is contained in:
Luke De Feo
2023-05-03 07:51:29 -07:00
committed by Facebook GitHub Bot
parent 42320e1c09
commit 98b94d62cf

View File

@@ -31,6 +31,8 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
@Throws(Exception::class) @Throws(Exception::class)
override fun onConnect(connection: FlipperConnection) { override fun onConnect(connection: FlipperConnection) {
isConnected = true
Log.i(LogTag, "Connected") Log.i(LogTag, "Connected")
this.context.connectionRef.connection = connection this.context.connectionRef.connection = connection
this.context.bitmapPool.makeReady() this.context.bitmapPool.makeReady()
@@ -54,6 +56,7 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
@Throws(Exception::class) @Throws(Exception::class)
override fun onDisconnect() { override fun onDisconnect() {
isConnected = false
this.context.connectionRef.connection = null this.context.connectionRef.connection = null
Log.i(LogTag, "Disconnected") Log.i(LogTag, "Disconnected")
@@ -66,4 +69,9 @@ class UIDebuggerFlipperPlugin(val context: UIDContext) : FlipperPlugin {
override fun runInBackground(): Boolean { override fun runInBackground(): Boolean {
return false return false
} }
companion object {
var isConnected: Boolean = false
private set
}
} }