Files
flipper/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h
Eloy Durán c393ee9421 Entirely control Flipper being enabled through Podfile (#1086)
Summary:
Currently user’s are being told to add a definition of the `FB_SONARKIT_ENABLED` macro and examples, including those in stock React Native templates, set this for the user by making use of a `post_install` hook in the user’s `Podfile`. This leads to confusion, fragile code [when a user’s project dir structure deviates from vanilla], and is ultimately not necessary as CocoaPods already has dedicated mechanisms to:

* specify build settings (through the `xcconfig` property);
* and selectively include certain pods only in certain build configurations (e.g. debug).

Finally, this PR also includes a commit [to fix the current builds](https://github.com/facebook/flipper/pull/1086/files#r418526812).

## Changelog

> Entirely control Flipper being enabled through inclusion in Podfile and optionally limiting to certain build configurations using the `:configuration` directive.
Pull Request resolved: https://github.com/facebook/flipper/pull/1086

Test Plan: I have built and ran the Sample application, as well as used this version of Flipper with a new RN app built from `master`.

Reviewed By: passy

Differential Revision: D21381828

Pulled By: priteshrnandgaonkar

fbshipit-source-id: edf6dae28eb02336a49e8230654d6186360ea8d6
2020-05-05 03:11:45 -07:00

58 lines
1.8 KiB
Objective-C

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <Foundation/Foundation.h>
#import <ComponentKit/CKComponentLayout.h>
#import <ComponentKit/CKFlexboxComponent.h>
#import <ComponentKit/CKOptional.h>
#import <RenderCore/CKVariant.h>
#import <vector>
@protocol CKInspectableView;
@class SKComponentLayoutWrapper;
@class SKComponentMountedView;
// CK::Variant does not support Objective-C types unless they are boxed:
struct SKLeafViewChild {
UIView* view;
};
struct SKMountedViewChild {
SKComponentMountedView* view;
};
/**
The children of a SKComponentLayoutWrapper may be:
- A single leaf view, which may have UIView children of its own.
- A single non-leaf view, if the component created a view; its children will be
the component's child components.
- An array of SKComponentLayoutWrappers, if the component did not create a
view.
*/
using SKComponentLayoutWrapperChildren = CK::Variant<
SKLeafViewChild,
SKMountedViewChild,
std::vector<SKComponentLayoutWrapper*>>;
@interface SKComponentLayoutWrapper : NSObject
@property(nonatomic, weak, readonly) CKComponent* component;
@property(nonatomic, readonly) NSString* identifier;
@property(nonatomic, readonly) CGSize size;
@property(nonatomic, readonly) CGPoint position;
@property(nonatomic, readonly) SKComponentLayoutWrapperChildren children;
@property(nonatomic, weak, readonly) id<CKInspectableView> rootNode;
/** CK::none for components that are not the child of a CKFlexboxComponent. */
@property(nonatomic, readonly) CK::Optional<CKFlexboxComponentChild>
flexboxChild;
+ (instancetype)newFromRoot:(id<CKInspectableView>)root
parentKey:(NSString*)parentKey;
@end