Restructured dev workflow docs
Summary: This diff unifies setup and workflow information that was scattered a bit around into one cohesive 'Development workflow' subsection in the 'creating plugins' section of Flipper. Reviewed By: nikoant Differential Revision: D25612288 fbshipit-source-id: 5fa7f2d000fb7ab3e1b5c5a4fc8cc1f209252f41
This commit is contained in:
committed by
Facebook GitHub Bot
parent
19ea20511c
commit
69dae5c8e5
46
docs/extending/loading-custom-plugins.mdx
Normal file
46
docs/extending/loading-custom-plugins.mdx
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
id: loading-custom-plugins
|
||||
title: Dynamically Loading Plugins
|
||||
---
|
||||
|
||||
import {FbInternalOnly, OssOnly} from 'internaldocs-fb-helpers';
|
||||
|
||||
<FbInternalOnly>
|
||||
|
||||
<div class="warning">
|
||||
|
||||
Inside Facebook, plugins sources are stored and loaded from `~/fbsource/xplat/sonar/desktop/plugins`,
|
||||
in which case no further configuration is needed.
|
||||
|
||||
If your team uses Flipper plugins that are stored outside `fbsource`, please follow your team specific instructions.
|
||||
|
||||
</div>
|
||||
|
||||
</FbInternalOnly>
|
||||
|
||||
Flipper loads and runs plugins it finds in a configurable location. The paths searched are specified in `~/.flipper/config.json`. These paths, `pluginPaths`, should contain one folder for each of the plugins it stores. An example config setting and plugin file structure is shown below:
|
||||
|
||||
`~/.flipper/config.json`:
|
||||
```
|
||||
{
|
||||
...,
|
||||
"pluginPaths": ["~/flipper-plugins"]
|
||||
}
|
||||
```
|
||||
Plugin File example structure:
|
||||
```
|
||||
~ flipper-plugins/
|
||||
my-plugin/
|
||||
package.json
|
||||
src/index.tsx
|
||||
dist/bundle.js
|
||||
```
|
||||
|
||||
<OssOnly>
|
||||
|
||||
Note: when using `npx flipper-pkg init` for scaffolding, as explained in the [tutorial](../tutorial/intro) or on the next page, the path should be configured automatically for you in most cases.
|
||||
|
||||
</OssOnly>
|
||||
|
||||
Typically, the above setup is only needed if you are developing plugins.
|
||||
To consume plugins, it is recommended to use one of the existing [distribution mechanisms](plugin-distribution) instead.
|
||||
Reference in New Issue
Block a user