Rename iOS SonarClient to FlipperClient

Summary: Renamed `SonarClient` to `FlipperClient`

Reviewed By: passy

Differential Revision: D9861749

fbshipit-source-id: 3374e4297e49ac198a235babc92deb9d2dddc268
This commit is contained in:
Pritesh Nandgaonkar
2018-09-18 08:55:16 -07:00
committed by Facebook Github Bot
parent 9d9fa17134
commit a488e34514
9 changed files with 33 additions and 33 deletions

View File

@@ -9,7 +9,7 @@
#import "SonarKitLayoutPlugin.h"
#import <SonarKit/SonarClient.h>
#import <SonarKit/FlipperClient.h>
#import <SonarKit/SonarConnection.h>
#import <SonarKit/SonarResponder.h>
#import <SonarKit/SKMacros.h>

View File

@@ -7,7 +7,7 @@
*/
#import "AppDelegate.h"
#import <SonarKit/SonarClient.h>
#import <SonarKit/FlipperClient.h>
#import <SonarKitLayoutPlugin/SonarKitLayoutPlugin.h>
#import <SonarKitNetworkPlugin/SonarKitNetworkPlugin.h>
#import <SonarKitLayoutComponentKitSupport/SonarKitLayoutComponentKitSupport.h>
@@ -28,14 +28,14 @@
{
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
SonarClient *client = [SonarClient sharedClient];
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[SonarKitLayoutComponentKitSupport setUpWithDescriptorMapper: layoutDescriptorMapper];
[client addPlugin: [[SonarKitLayoutPlugin alloc] initWithRootNode: application
withDescriptorMapper: layoutDescriptorMapper]];
[[SonarClient sharedClient] addPlugin: [[SonarKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[[FlipperClient sharedClient] addPlugin: [[SonarKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryBoard" bundle:nil];

View File

@@ -16,36 +16,36 @@ PODS:
- PeerTalk (0.0.2)
- RSocket (0.10.0):
- Folly
- Sonar (0.7.0):
- Sonar (0.7.1):
- Folly (~> 1.1)
- RSocket (~> 0.10)
- SonarKit (0.7.0):
- SonarKit/Core (= 0.7.0)
- SonarKit/Core (0.7.0):
- SonarKit (0.7.1):
- SonarKit/Core (= 0.7.1)
- SonarKit/Core (0.7.1):
- CocoaAsyncSocket (~> 7.6)
- Folly (~> 1.1)
- OpenSSL-Static (= 1.0.2.c1)
- PeerTalk (~> 0.0.2)
- Sonar (~> 0.7.0)
- Sonar (~> 0.7.1)
- SonarKit/CppBridge
- SonarKit/FBCxxUtils
- SonarKit/FBDefines
- SonarKit/CppBridge (0.7.0)
- SonarKit/FBCxxUtils (0.7.0)
- SonarKit/FBDefines (0.7.0)
- SonarKit/SKIOSNetworkPlugin (0.7.0):
- SonarKit/CppBridge (0.7.1)
- SonarKit/FBCxxUtils (0.7.1)
- SonarKit/FBDefines (0.7.1)
- SonarKit/SKIOSNetworkPlugin (0.7.1):
- SonarKit/Core
- SonarKit/SonarKitNetworkPlugin
- SonarKit/SonarKitLayoutComponentKitSupport (0.7.0):
- SonarKit/SonarKitLayoutComponentKitSupport (0.7.1):
- ComponentKit
- SonarKit/Core
- SonarKit/SonarKitLayoutPlugin
- Yoga (~> 1.9)
- SonarKit/SonarKitLayoutPlugin (0.7.0):
- SonarKit/SonarKitLayoutPlugin (0.7.1):
- SonarKit/Core
- Yoga (~> 1.9)
- YogaKit (~> 1.8)
- SonarKit/SonarKitNetworkPlugin (0.7.0):
- SonarKit/SonarKitNetworkPlugin (0.7.1):
- SonarKit/Core
- Yoga (1.9.0)
- YogaKit (1.9.0):
@@ -90,8 +90,8 @@ SPEC CHECKSUMS:
OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e
PeerTalk: 77481b0a8136f226b90ccf828d6061f70139ffde
RSocket: 4fdb7e562db30a2d4fceddefdc601749ffc9ebe2
Sonar: 3ce26a113ca4cf69e0d784c22ca605708ee657ee
SonarKit: 924c28d0c1d5ef830d79cd71c934b3710daeb767
Sonar: 63e5e5d1f217b691a528b68bb88ddc545dc808d5
SonarKit: f457030ca47e09e714a7eadd64c9d0837c6a6b52
Yoga: aaae8abea68951f60bee05f6277d3eed90bb91bb
YogaKit: d447a9bb808718e6f58e52a2255a8050081a3ead

View File

@@ -12,7 +12,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow()
let client = SonarClient.shared()
let client = FlipperClient.shared()
// Layout and network plugins are currently not supported for Swift apps.
// let layoutDescriptorMapper = SKDescriptorMapper(defaults: ())
// SonarKitLayoutComponentKitSupport.setUp(descriptorMapper: layoutDescriptorMapper)

View File

@@ -64,7 +64,7 @@ Pod::Spec.new do |spec|
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKResponseInfo.h',
'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SonarKitNetworkPlugin.h',
'iOS/FBDefines/FBMacros.h',
'iOS/SonarKit/**/{FlipperStateUpdateListener,SonarClient,SonarPlugin,SonarConnection,FlipperResponder,SKMacros}.h'
'iOS/SonarKit/**/{FlipperStateUpdateListener,FlipperClient,SonarPlugin,SonarConnection,SonarResponder,SKMacros}.h'
header_search_paths = "\"$(PODS_ROOT)/SonarKit/iOS/SonarKit\" \"$(PODS_ROOT)\"/Headers/Private/SonarKit/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/PeerTalkSonar\""
ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
"DEFINES_MODULE" => "YES",

View File

@@ -15,10 +15,10 @@
Represents a connection between the Sonar desktop och client side. Manages the lifecycle of attached
plugin instances.
*/
@interface SonarClient : NSObject
@interface FlipperClient : NSObject
/**
The shared singleton SonarClient instance. It is an error to call this on non-debug builds to avoid leaking data.
The shared singleton FlipperClient instance. It is an error to call this on non-debug builds to avoid leaking data.
*/
+ (instancetype)sharedClient;
@@ -62,7 +62,7 @@ Subscribe a ViewController to state update change notifications
*/
- (void)subscribeForUpdates:(id<FlipperStateUpdateListener>)controller;
// initializers are disabled. You must use `+[SonarClient sharedClient]` instance.
// initializers are disabled. You must use `+[FlipperClient sharedClient]` instance.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

View File

@@ -7,7 +7,7 @@
*/
#if FB_SONARKIT_ENABLED
#import "SonarClient.h"
#import "FlipperClient.h"
#import "SonarCppWrapperPlugin.h"
#import <Sonar/SonarClient.h>
#include <folly/io/async/EventBase.h>
@@ -22,7 +22,7 @@
using WrapperPlugin = facebook::flipper::SonarCppWrapperPlugin;
@implementation SonarClient {
@implementation FlipperClient {
facebook::flipper::SonarClient *_cppClient;
folly::ScopedEventBaseThread sonarThread;
folly::ScopedEventBaseThread connectionThread;
@@ -33,7 +33,7 @@ using WrapperPlugin = facebook::flipper::SonarCppWrapperPlugin;
+ (instancetype)sharedClient
{
static SonarClient *sharedClient = nil;
static FlipperClient *sharedClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedClient = [[self alloc] init];

View File

@@ -1,7 +1,7 @@
#ifdef FB_SONARKIT_ENABLED
#import "FlipperDiagnosticsViewController.h"
#import "SonarClient.h"
#import "FlipperClient.h"
#define STATE_VIEW_HEIGHT 300
@@ -45,7 +45,7 @@ static NSString *const kSKCellIdentifier = @"FlipperDiagnosticStateTableStableCe
self.stateTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, STATE_VIEW_HEIGHT)];
[self.stateTable registerClass:[UITableViewCell class] forCellReuseIdentifier:kSKCellIdentifier];
self.stateTable.rowHeight = 14;
self.tableDataSource = [[StateTableDataSource alloc] initWithElements:[[SonarClient sharedClient] getStateElements]];
self.tableDataSource = [[StateTableDataSource alloc] initWithElements:[[FlipperClient sharedClient] getStateElements]];
self.stateTable.dataSource = self.tableDataSource;
[self updateLogView];
@@ -64,12 +64,12 @@ static NSString *const kSKCellIdentifier = @"FlipperDiagnosticStateTableStableCe
}
- (void)updateStateTable {
self.tableDataSource.elements = [[SonarClient sharedClient] getStateElements];
self.tableDataSource.elements = [[FlipperClient sharedClient] getStateElements];
[self.stateTable reloadData];
}
- (void)updateLogView {
NSString *state = [[SonarClient sharedClient] getState];
NSString *state = [[FlipperClient sharedClient] getState];
self.logLabel.text = state;
[self.logLabel sizeToFit];
self.scrollView.contentSize = self.logLabel.frame.size;
@@ -82,7 +82,7 @@ static NSString *const kSKCellIdentifier = @"FlipperDiagnosticStateTableStableCe
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
id<FlipperStateUpdateListener> weakSelf = self;
[[SonarClient sharedClient] subscribeForUpdates:weakSelf];
[[FlipperClient sharedClient] subscribeForUpdates:weakSelf];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {

View File

@@ -12,9 +12,9 @@
#import <Foundation/Foundation.h>
#import <Sonar/SonarClient.h>
#import <SonarKit/SonarClient.h>
#import <SonarKit/FlipperClient.h>
@interface SonarClient (Testing)
@interface FlipperClient (Testing)
- (instancetype)initWithCppClient:(facebook::flipper::SonarClient *)cppClient;