From 3699a0667a61331317faef81b10b11303c432b32 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Wed, 26 Sep 2018 03:58:20 -0700 Subject: [PATCH] Rename sonar to flipper in the docs Summary: Sonar->Flipper Reviewed By: passy Differential Revision: D10032191 fbshipit-source-id: 5e5230a02e34b9d1c7c355701daef984dc779f35 --- docs/create-plugin.md | 24 ++++++++++++------------ docs/error-handling.md | 2 +- docs/getting-started.md | 16 ++++++++-------- docs/layout-plugin.md | 4 ++-- docs/network-plugin.md | 4 ++-- docs/send-data.md | 4 ++-- docs/testing.md | 10 +++++----- docs/troubleshooting.md | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/create-plugin.md b/docs/create-plugin.md index d877c598e..3d5ac6cb1 100644 --- a/docs/create-plugin.md +++ b/docs/create-plugin.md @@ -34,13 +34,13 @@ public class MyFlipperPlugin implements FlipperPlugin { ### iOS ```objective-c -@interface MySonarPlugin : NSObject +@interface MyFlipperPlugin : NSObject @end -@implementation MySonarPlugin +@implementation MyFlipperPlugin -- (NSString*)identifier { return @"MySonarPlugin"; } -- (void)didConnect:(SonarConnection*)connection {} +- (NSString*)identifier { return @"MyFlipperPlugin"; } +- (void)didConnect:(FlipperConnection*)connection {} - (void)didDisonnect {} @end @@ -49,9 +49,9 @@ public class MyFlipperPlugin implements FlipperPlugin { ### C++ ```c++ -class MySonarPlugin : public SonarPlugin { +class MyFlipperPlugin : public FlipperPlugin { public: - std::string identifier() const override { return "MySonarPlugin"; } + std::string identifier() const override { return "MyFlipperPlugin"; } void didConnect(std::shared_ptr conn) override; void didDisconnect() override; }; @@ -78,14 +78,14 @@ connection.receive("getData", new FlipperReceiver() { ### iOS ```objective-c -@interface MySonarPlugin : NSObject +@interface MyFlipperPlugin : NSObject @end -@implementation MySonarPlugin +@implementation MyFlipperPlugin -- (NSString*)identifier { return @"MySonarPlugin"; } +- (NSString*)identifier { return @"MyFlipperPlugin"; } -- (void)didConnect:(SonarConnection*)connection +- (void)didConnect:(FlipperConnection*)connection { [connection receive:@"getData" withBlock:^(NSDictionary *params, FlipperResponder *responder) { [responder success:@{ @@ -102,7 +102,7 @@ connection.receive("getData", new FlipperReceiver() { ### C++ ```c++ -void MySonarPlugin::didConnect(std::shared_ptr conn) { +void MyFlipperPlugin::didConnect(std::shared_ptr conn) { conn->receive("getData", [](const folly::dynamic ¶ms, std::unique_ptr responder) { dynamic response = folly::dynamic::object("data", getMyData()); @@ -133,7 +133,7 @@ connection.send("MyMessage", ### C++ ```c++ -void MySonarPlugin::didConnect(std::shared_ptr conn) { +void MyFlipperPlugin::didConnect(std::shared_ptr conn) { dynamic message = folly::dynamic::object("message", "hello"); conn->send("getData", message); } diff --git a/docs/error-handling.md b/docs/error-handling.md index ee972ebe1..062107f9a 100644 --- a/docs/error-handling.md +++ b/docs/error-handling.md @@ -25,7 +25,7 @@ Always use `ErrorReportingRunnable` for error handling instead of `try`/`catch` ## C++ -To gracefully handle errors in Flipper we perform all transactions inside of a try block which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer. This includes your own customs implementations of `SonarPlugin::didConnect()` and `FlipperConnection::send()` and `::receive()`! +To gracefully handle errors in Flipper we perform all transactions inside of a try block which catches all exceptions, stopping them from crashing the application and reporting them to the plugin developer. This includes your own customs implementations of `FlipperPlugin::didConnect()` and `FlipperConnection::send()` and `::receive()`! That means you can safely throw exceptions in your plugin code. The exception messages will be sent to the Flipper desktop app. During plugin development the exception messages are surfaced in the Chrome dev console. diff --git a/docs/getting-started.md b/docs/getting-started.md index d81df5da3..960f9956b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -94,14 +94,14 @@ project 'MyApp.xcodeproj' source 'https://github.com/facebook/flipper.git' source 'https://github.com/CocoaPods/Specs' swift_version = "4.1" -sonarkit_version = '0.7.2' +flipperkit_version = '0.7.2' target 'MyApp' do - pod 'SonarKit', '~>'+sonarkit_version + pod 'FlipperKit', '~>'+flipperkit_version # Layout and network plugins are not yet supported for swift projects - pod 'SonarKit/SonarKitLayoutComponentKitSupport', '~>' + sonarkit_version - pod 'SonarKit/SKIOSNetworkPlugin', '~>' + sonarkit_version + pod 'FlipperKit/FlipperKitLayoutComponentKitSupport', '~>' + flipperkit_version + pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version post_install do |installer| @@ -119,16 +119,16 @@ end and install the dependencies by running `pod install`. When you open the Xcode workspace file for your app, you now can import and initialize Flipper in your AppDelegate. ```objective-c -#import +#import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { #if DEBUG - SonarClient *client = [SonarClient sharedClient]; + FlipperClient *client = [FlipperClient sharedClient]; SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; - [client addPlugin:[[SonarKitLayoutPlugin alloc] initWithRootNode: application + [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode: application withDescriptorMapper: layoutDescriptorMapper]]; [client start]; #endif @@ -140,7 +140,7 @@ and install the dependencies by running `pod install`. When you open the Xcode w
- We haven't released the dependency to CocoaPods yet, here is the [issue](https://github.com/facebook/flipper/issues/132) by which you can track. -- If you do not use CocoaPods as a dependency management tool then currently there is no way to integrate SonarKit other than manually including all the dependencies and building it. +- If you do not use CocoaPods as a dependency management tool then currently there is no way to integrate FlipperKit other than manually including all the dependencies and building it. - For Android, Flipper works with both emulators and physical devices connected through USB. However on iOS, we don't yet support physical devices. - The Flipper layout plugin isn't supported in Swift projects since they include C++ dependencies. We're working on supporting it for Swift apps. You can join the discussion on the [issues page](https://github.com/facebook/flipper/issues). diff --git a/docs/layout-plugin.md b/docs/layout-plugin.md index 81105bfcd..8d172ad81 100644 --- a/docs/layout-plugin.md +++ b/docs/layout-plugin.md @@ -64,11 +64,11 @@ dependencies { ### iOS ```objective-c -#import +#import #import SKDescriptorMapper *mapper = [[SKDescriptorMapper alloc] initWithDefaults]; -[client addPlugin:[[SonarKitLayoutPlugin alloc] initWithRootNode:context.application withDescriptorMapper:mapper]] +[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:context.application withDescriptorMapper:mapper]] ``` ## Quick edits diff --git a/docs/network-plugin.md b/docs/network-plugin.md index db8761ded..0eb04a9be 100644 --- a/docs/network-plugin.md +++ b/docs/network-plugin.md @@ -37,9 +37,9 @@ As interceptors can modify the request and response, add the Flipper interceptor ### iOS ```objective-c -#import +#import -[client addPlugin: [SonarKitNetworkPlugin new]] +[client addPlugin: [FlipperKitNetworkPlugin new]] ``` ## Usage diff --git a/docs/send-data.md b/docs/send-data.md index 31b772bf4..ef72dfcda 100644 --- a/docs/send-data.md +++ b/docs/send-data.md @@ -25,8 +25,8 @@ if (client != null) { ### iOS ```objective-c -SonarClient *client = [SonarClient sharedClient]; -MySonarPlugin *myPlugin = [client pluginWithIdentifier:@"MySonarPlugin"]; +FlipperClient *client = [FlipperClient sharedClient]; +MyFlipperPlugin *myPlugin = [client pluginWithIdentifier:@"MyFlipperPlugin"]; [myPlugin sendData:myData]; ``` diff --git a/docs/testing.md b/docs/testing.md index ab1c40e99..39f642fe9 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -50,10 +50,10 @@ public void myTest() { ## C++ -Start by creating your first test file in this directory `MySonarPluginTests.cpp` and import the testing utilities from `//xplat/sonar-client:FlipperTestLib`. These utilities mock out core pieces of the communication channel so that you can test your plugin in isolation. +Start by creating your first test file in this directory `MyFlipperPluginTests.cpp` and import the testing utilities from `xplat//sonar/xplat:FlipperTestLib`. These utilities mock out core pieces of the communication channel so that you can test your plugin in isolation. ``` -#include +#include #include #include @@ -64,7 +64,7 @@ namespace facebook { namespace flipper { namespace test { -TEST(MySonarPluginTests, testDummy) { +TEST(MyFlipperPluginTests, testDummy) { EXPECT_EQ(1 + 1, 2); } @@ -76,12 +76,12 @@ TEST(MySonarPluginTests, testDummy) { Here is a simple test using these mock utilities to create a plugin, send some data, and assert that the result is as expected. ``` -TEST(MySonarPluginTests, testDummy) { +TEST(MyFlipperPluginTests, testDummy) { std::vector successfulResponses; auto responder = std::make_unique(&successfulResponses); auto conn = std::make_shared(); - MySonarPlugin plugin; + MyFlipperPlugin plugin; plugin.didConnect(conn); folly::dynamic message = folly::dynamic::object("param1", "hello"); diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 4b823802f..d5060f0ea 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -42,7 +42,7 @@ adb shell am start -n /com.facebook.flipper.android.diagnostics.Fli This will only work if you added `FlipperDiagnosticActivity` to your `AndroidManifest.xml`. See [getting started](getting-started.html) for help. #### iOS -You'll need to manually add this [ViewController](https://github.com/facebook/flipper/blob/master/iOS/SonarKit/FlipperDiagnosticsViewController.m) to your app to see the in-app diagnostics. +You'll need to manually add this [ViewController](https://github.com/facebook/flipper/blob/master/iOS/FlipperKit/FlipperDiagnosticsViewController.m) to your app to see the in-app diagnostics. ### Known Incompatibilities The following devices are known to be incompatible or face issues with flipper: