Disable subdescriptors to fix layout plugin

Summary:
Bug report here: https://fb.facebook.com/groups/230455004101832/permalink/519062535241076/

This has broken layout plugin when NT components are used.
Removing the subdescriptors as a quick fix. At the moment, this means removing the new NT features.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13103790

fbshipit-source-id: 57c10a0a07507aaba0cd7a20d1b548470203f2f6
This commit is contained in:
John Knox
2018-11-16 11:31:06 -08:00
committed by Facebook Github Bot
parent 7821b6b5a9
commit ed93c98313

View File

@@ -37,11 +37,11 @@
- (void)setUp {
[super setUp];
if (!_registeredSubdescriptors) {
_registeredSubdescriptors = [NSArray new];
}
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self initEnumMaps];
@@ -93,27 +93,27 @@
- (NSArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *)dataForNode:(SKComponentLayoutWrapper *)node {
NSMutableArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *data = [NSMutableArray new];
if (node.isFlexboxChild) {
[data addObject: [SKNamed newWithName:@"Layout" withValue:[self propsForFlexboxChild:node.flexboxChild]]];
}
NSMutableDictionary<NSString *, NSObject *> *extraData = [[NSMutableDictionary alloc] init];
for (SKSubDescriptor *s in _registeredSubdescriptors) {
[extraData setObject:[s getDataForNode:node] forKey:[s getName]];
}
if (extraData.count > 0) {
[data addObject: [SKNamed newWithName:@"Extra Sections" withValue:extraData]];
}
[data addObjectsFromArray:[node.component sonar_getData]];
return data;
}
- (void)addSubDescriptors:(nonnull NSArray<SKSubDescriptor *>*)subDescriptors{
_registeredSubdescriptors = subDescriptors;
// _registeredSubdescriptors = subDescriptors;
}
- (NSDictionary<NSString *, NSObject *> *)propsForFlexboxChild:(CKFlexboxComponentChild)child {
return @{
@"spacingBefore": SKObject(@(child.spacingBefore)),