From eb09f7903b4aceec7a5b88e6a2fa44c025d3ef05 Mon Sep 17 00:00:00 2001 From: udbhav-chugh Date: Thu, 13 Aug 2020 08:00:38 -0700 Subject: [PATCH] Update architecture.mdx and client-plugin-lifecycle.mdx in docs (#1459) Summary: Removed basic grammatical errors in two docs files: architecture.mdx and client-plugin-lifecycle.mdx ## Changelog Update architecture.mdx and client-plugin-lifecycle.mdx docs Pull Request resolved: https://github.com/facebook/flipper/pull/1459 Test Plan: There is only text change in documentation. The code is unchanged. Reviewed By: cekkaewnumchai Differential Revision: D23101962 Pulled By: passy fbshipit-source-id: 24d9233d67a19745696b40ea6c2d3ac2d26231c3 --- docs/extending/architecture.mdx | 8 ++++---- docs/extending/client-plugin-lifecycle.mdx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/extending/architecture.mdx b/docs/extending/architecture.mdx index 019e4aa0c..44afb3f5a 100644 --- a/docs/extending/architecture.mdx +++ b/docs/extending/architecture.mdx @@ -5,18 +5,18 @@ title: Architecture import useBaseUrl from '@docusaurus/useBaseUrl'; -Flipper is built to be a universal pluggable platform for development tools. Currently, Flipper focuses on Android and iOS development but its design does not limit it to these platforms. Another way to think of Flipper is a more general purpose implementation of Chrome DevTools. +Flipper is built to be a universal pluggable platform for development tools. Currently, Flipper focuses on Android and iOS development, but its design does not limit it to these platforms. Another way to think of Flipper is a more general-purpose implementation of Chrome DevTools. ### Overview Flipper consists of a desktop interface built with javascript on top of Electron so that it can be packaged to run on any operating system. This desktop app connects over a [tcp connection](establishing-a-connection) to applications running on simulators and connected devices. An application running on a device or simulator is what we refer to as a client. -The connection is bi-directional allowing the desktop to query information from the client as well as the client to push updates directly to the desktop. +The connection is bi-directional, allowing the desktop to query information from the client as well as the client to push updates directly to the desktop. -By querying data and responding to pushing from the client a Flipper plugin is able to visualize data, debug problems, and change behavior of running applications. Flipper provides the platform to build these tools on top of and does not limit what kind of tools that may be. +By querying data and responding to pushing from the client, a Flipper plugin is able to visualize data, debug problems, and change the behavior of running applications. Flipper provides the platform to build these tools on top of and does not limit what kind of tools that may be. There are two kinds of plugins in Flipper, client plugins and desktop plugins. Client plugins expose information as an API to desktop plugins whose responsibility it is to render this information in an easy-to-digest way. Client plugins are written once for each platform in the platform's native language. Desktop plugins are written only once in JavaScript using React and consume the APIs exposed by the client plugins. ### Architecture - React Native Simplified visualization of Flipper architecture, when used with React Native. -Flipper communication diagram +Flipper communication diagram \ No newline at end of file diff --git a/docs/extending/client-plugin-lifecycle.mdx b/docs/extending/client-plugin-lifecycle.mdx index 3dcb619a6..aaf6c7681 100644 --- a/docs/extending/client-plugin-lifecycle.mdx +++ b/docs/extending/client-plugin-lifecycle.mdx @@ -6,7 +6,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl'; There are two types of client plugin: Regular and Background plugins. We recommend starting off as a regular plugin and switching it to a background plugin if necessary. -For both types of plugin, we recommend starting work after `onConnect` is called, and terminating it after `onDisconnect`, when possible. This prevents wasted computation when Flipper isn't connected. If the plugin needs to keep track of events that occur before it gets connected (such as initial network requests on app startup), you should do so in the plugin constructor (or ideally in a separate class). +For both types of plugin, we recommend starting work after `onConnect` is called and terminating it after `onDisconnect`, when possible. This prevents wasted computation when Flipper isn't connected. If the plugin needs to keep track of events that occur before it gets connected (such as initial network requests on app startup), you should do so in the plugin constructor (or ideally in a separate class). ## Regular Plugin Lifecycle For regular plugins, `onConnect` and `onDisconnect` are triggered when the user opens the plugin in the Flipper UI, and when they switch to another plugin, respectively. @@ -15,7 +15,7 @@ For regular plugins, `onConnect` and `onDisconnect` are triggered when the user ## Background Plugin Lifecycle For background plugins, `onConnect` is called when Flipper first connects, and `onDisconnect` when it disconnects. The user does not need to be viewing the plugin for it to send messages; they will be queued up until the next time the user opens the plugin where they will be processed. -Even for background plugins, `onDisconnect` and `onConnect` may be called on a plugin (e.g. if the user restarts Flipper). Plugins should handle this accordingly by making sure to resend any important data to the reconnected instance. +Even for background plugins, `onDisconnect` and `onConnect` may be called on a plugin (e.g., if the user restarts Flipper). Plugins should handle this accordingly by making sure to resend any important data to the reconnected instance.
Note that a plugin must be enabled by the user for its messages to be queued up.