Move plugin docs to plugin folders
Summary: Moved plugin documentation and related assets to plugin folders, fixed links and configured redirects where required. Now these docs are used for both showing docs in Flipper and generating Flipper docs website. Reviewed By: passy Differential Revision: D29465567 fbshipit-source-id: 3ec4240b215b0d5baea5154f64266a9ba7ead3a5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4ad7a70ee3
commit
039d3a4a08
8
desktop/plugins/public/leak_canary/docs/overview.mdx
Normal file
8
desktop/plugins/public/leak_canary/docs/overview.mdx
Normal file
@@ -0,0 +1,8 @@
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
|
||||
The LeakCanary plugin provides developers with Flipper support for [LeakCanary](https://github.com/square/leakcanary), an open source memory leak detection library.
|
||||
|
||||
Leaks detected by LeakCanary will appear automatically in Flipper. Each leak will display a hierarchy of objects, beginning from the garbage collector root and ending at the leaked class.
|
||||
Selecting any object in this list will display contents of the object's various fields.
|
||||
|
||||
Note: this plugin is only available for Android.
|
||||
43
desktop/plugins/public/leak_canary/docs/setup.mdx
Normal file
43
desktop/plugins/public/leak_canary/docs/setup.mdx
Normal file
@@ -0,0 +1,43 @@
|
||||
Ensure that you already have an explicit dependency in your application's
|
||||
`build.gradle` including the plugin dependency, e.g.
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
debugImplementation 'com.facebook.flipper:flipper-leakcanary2-plugin:0.95.0'
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
|
||||
}
|
||||
```
|
||||
|
||||
Update your the `onCreate` method in you `Application` to add the LeakCanary2 plugin to Flipper and the Flipper listener to LeakCanary
|
||||
|
||||
```kt
|
||||
import com.facebook.flipper.plugins.leakcanary2.FlipperLeakListener
|
||||
import com.facebook.flipper.plugins.leakcanary2.LeakCanary2FlipperPlugin
|
||||
|
||||
...
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
setupFlipper()
|
||||
|
||||
/*
|
||||
set the flipper listener in leak canary config
|
||||
*/
|
||||
LeakCanary.config = LeakCanary.config.copy(
|
||||
onHeapAnalyzedListener = FlipperLeakListener()
|
||||
)
|
||||
|
||||
SoLoader.init(this, false)
|
||||
|
||||
if (BuildConfig.DEBUG && FlipperUtils.shouldEnableFlipper(this)) {
|
||||
val client = AndroidFlipperClient.getInstance(this)
|
||||
/*
|
||||
add leak canary plugin to flipper
|
||||
*/
|
||||
client.addPlugin(LeakCanary2FlipperPlugin())
|
||||
client.start()
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
That's it!
|
||||
Reference in New Issue
Block a user