From c0982ea1db43bc6c879f85154f20434309a72254 Mon Sep 17 00:00:00 2001 From: Oleksii Dykan Date: Thu, 20 Sep 2018 07:23:16 -0700 Subject: [PATCH] Add stateless component info in Flipper Summary: This diff updates layout plugin in Flipper to show the name of the Stateless component C function Reviewed By: adamjernst Differential Revision: D9907068 fbshipit-source-id: d10b43171383f11aca3c140bbb450db817576052 --- .../CKComponent+Sonar.mm | 2 ++ .../CKStatelessComponent+Sonar.h | 16 +++++++++++ .../CKStatelessComponent+Sonar.mm | 27 +++++++++++++++++++ iOS/Sample/Podfile.lock | 6 ++--- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.h create mode 100644 iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.mm diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKComponent+Sonar.mm b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKComponent+Sonar.mm index b9afe8fa0..acde5a09f 100644 --- a/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKComponent+Sonar.mm +++ b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKComponent+Sonar.mm @@ -17,6 +17,8 @@ #import #import +#import "CKStatelessComponent+Sonar.h" + /** This protocol isn't actually adopted anywhere, it just lets us use the SEL below */ @protocol SonarKitLayoutComponentKitOverrideInformalProtocol - (NSString *)sonar_componentNameOverride; diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.h b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.h new file mode 100644 index 000000000..500481592 --- /dev/null +++ b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. + * + */ +#import +#import + +FB_LINK_REQUIRE(CKStatelessComponent_Sonar) +@interface CKStatelessComponent (Sonar) + +- (NSString *)sonar_componentNameOverride; + +@end diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.mm b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.mm new file mode 100644 index 000000000..51c8a33ca --- /dev/null +++ b/iOS/Plugins/FlipperKitLayoutPlugin/SonarKitLayoutComponentKitSupport/CKStatelessComponent+Sonar.mm @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the LICENSE + * file in the root directory of this source tree. + * + */ +#if FB_SONARKIT_ENABLED + +#import "CKStatelessComponent+Sonar.h" + +#import +#import + +#import "CKComponent+Sonar.h" + +FB_LINKABLE(CKStatelessComponent_Sonar) +@implementation CKStatelessComponent (Sonar) + +- (NSString *)sonar_componentNameOverride +{ + return [self description]; +} + +@end + +#endif diff --git a/iOS/Sample/Podfile.lock b/iOS/Sample/Podfile.lock index d15cd1e3f..938111419 100644 --- a/iOS/Sample/Podfile.lock +++ b/iOS/Sample/Podfile.lock @@ -2,7 +2,7 @@ PODS: - boost-for-react-native (1.63.0) - CocoaAsyncSocket (7.6.3) - CocoaLibEvent (1.0.0) - - ComponentKit (0.23): + - ComponentKit (0.24): - Yoga (~> 1.6) - DoubleConversion (1.1.5) - FlipperKit (0.7.2): @@ -83,9 +83,9 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c CocoaAsyncSocket: eafaa68a7e0ec99ead0a7b35015e0bf25d2c8987 CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f - ComponentKit: bf8b4c4e7448bd15b3a8e5a71174ea7aa6cea98d + ComponentKit: d6efb627aa2b4592cbe029d1e9e604226d39b5d9 DoubleConversion: e22e0762848812a87afd67ffda3998d9ef29170c - FlipperKit: e70400bbc914a7a3d67464a06d98bd5d6261cf4a + FlipperKit: 1f046ef5906178012b14f6be1dfe1d5b0dc3a8d4 Folly: dd92f69322d8535b9df98d7c91e442b0fce2fff2 glog: 1de0bb937dccdc981596d3b5825ebfb765017ded OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e