From cdb72db5a94f94eb6b1ca249392e3b540bc7e353 Mon Sep 17 00:00:00 2001 From: Harold Martin Date: Thu, 3 Feb 2022 01:36:25 -0800 Subject: [PATCH] Fix LeakCanary plugin UI, Upgrade LC dependency and make it compile only (#3367) Summary: **Currently, the Leak Canary plugins is broken, see this screenshot (unable to expand):** Screen Shot 2022-01-29 at 2 06 33 PM **This fix repairs and improves the UI:** Screen Shot 2022-01-29 at 2 06 03 PM ## Changelog - Fixes UI to enable showing leak trace - Upgrades LackCanary dependency from 2.6 to 2.8.1 - Makes Kotlin and LC `compileOnly` dependencies in order to prevent conflict for the users - Updates documentation Pull Request resolved: https://github.com/facebook/flipper/pull/3367 Test Plan: See demo at https://github.com/hbmartin/leakcanary/tree/flipper-demo/leakcanary-android-sample **Static Docs Preview: flipper** |[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D33915179/V3/flipper/)| |**Modified Pages**| Reviewed By: passy Differential Revision: D33915179 Pulled By: cekkaewnumchai fbshipit-source-id: 9698dba23ab475c8cd84e4c222dfc41712b05a1e --- android/plugins/leakcanary2/build.gradle | 4 ++-- build.gradle | 2 +- desktop/plugins/public/leak_canary/docs/setup.mdx | 3 +-- desktop/plugins/public/leak_canary/index.tsx | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index 1b6926a65..bfc6c47a2 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -20,9 +20,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION" + compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION" implementation project(':android') - implementation deps.leakcanary2 + compileOnly deps.leakcanary2 compileOnly deps.jsr305 } } diff --git a/build.gradle b/build.gradle index d59d8bcf8..2714187c7 100644 --- a/build.gradle +++ b/build.gradle @@ -96,7 +96,7 @@ ext.deps = [ mockito : 'org.mockito:mockito-core:4.3.1', okhttp3 : 'com.squareup.okhttp3:okhttp:4.9.3', leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.6.3', - leakcanary2 : 'com.squareup.leakcanary:leakcanary-android:2.6', + leakcanary2 : 'com.squareup.leakcanary:leakcanary-android:2.8.1', protobuf : 'com.google.protobuf:protobuf-java:3.19.4', testCore : 'androidx.test:core:1.4.0', testRules : 'androidx.test:rules:1.4.0', diff --git a/desktop/plugins/public/leak_canary/docs/setup.mdx b/desktop/plugins/public/leak_canary/docs/setup.mdx index 7c57545ea..358c05ae9 100644 --- a/desktop/plugins/public/leak_canary/docs/setup.mdx +++ b/desktop/plugins/public/leak_canary/docs/setup.mdx @@ -4,7 +4,7 @@ Ensure that you already have an explicit dependency in your application's ```groovy dependencies { debugImplementation 'com.facebook.flipper:flipper-leakcanary2-plugin:0.132.0' - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6' + debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1' } ``` @@ -18,7 +18,6 @@ import com.facebook.flipper.plugins.leakcanary2.LeakCanary2FlipperPlugin override fun onCreate() { super.onCreate() - setupFlipper() /* set the flipper listener in leak canary config diff --git a/desktop/plugins/public/leak_canary/index.tsx b/desktop/plugins/public/leak_canary/index.tsx index 61999f67e..625de49e8 100644 --- a/desktop/plugins/public/leak_canary/index.tsx +++ b/desktop/plugins/public/leak_canary/index.tsx @@ -232,10 +232,10 @@ export default class LeakCanary extends FlipperPlugin< return ( { @@ -249,6 +249,7 @@ export default class LeakCanary extends FlipperPlugin< searchResults={null} root={leak.root} elements={elements} + scrollable={false} /> );