Document how to use Node.js api's

Summary:
* Documented `npx flipper-server`
* Documented how to properly interact with the OS from Flipper plugins

Reviewed By: antonk52

Differential Revision: D33361929

fbshipit-source-id: 3028de2bf77a9ee6d9e521c1a53cff2388c936ea
This commit is contained in:
Michel Weststrate
2022-01-04 09:05:09 -08:00
committed by Facebook GitHub Bot
parent ebc4752077
commit 7efad4201c
6 changed files with 42 additions and 10 deletions

View File

@@ -270,6 +270,15 @@ If you need any dependencies in your plugin, you can install them using `yarn ad
<OssOnly>
<div class="warning">
Flipper plugins should be designed to work inside browsers as well, as Flipper isn't guaranteed to be always running on top of Electron.
For that reason it should be avoided to use Node.js APIs directly (e.g. modules like `fs`, `child_process`, `path`),
or packages that depend on those.
For alternative APIs, see [using Node.js APIs](./node-apis.mdx) in Flipper plugins.
</div>
## Migration to new Plugin Specification
Flipper plugins are defined according to the specification. As with any specification, it is evolving, so new versions of it can be released. Currently Flipper supports plugins defined using version 2 of specification which is described in this page. Previous version of specification is being deprecated, and we encourage all the plugins still using it to migrate.