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:
committed by
Facebook Github Bot
parent
7821b6b5a9
commit
ed93c98313
@@ -37,11 +37,11 @@
|
|||||||
|
|
||||||
- (void)setUp {
|
- (void)setUp {
|
||||||
[super setUp];
|
[super setUp];
|
||||||
|
|
||||||
if (!_registeredSubdescriptors) {
|
if (!_registeredSubdescriptors) {
|
||||||
_registeredSubdescriptors = [NSArray new];
|
_registeredSubdescriptors = [NSArray new];
|
||||||
}
|
}
|
||||||
|
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
dispatch_once(&onceToken, ^{
|
dispatch_once(&onceToken, ^{
|
||||||
[self initEnumMaps];
|
[self initEnumMaps];
|
||||||
@@ -93,27 +93,27 @@
|
|||||||
|
|
||||||
- (NSArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *)dataForNode:(SKComponentLayoutWrapper *)node {
|
- (NSArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *)dataForNode:(SKComponentLayoutWrapper *)node {
|
||||||
NSMutableArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *data = [NSMutableArray new];
|
NSMutableArray<SKNamed<NSDictionary<NSString *, NSObject *> *> *> *data = [NSMutableArray new];
|
||||||
|
|
||||||
if (node.isFlexboxChild) {
|
if (node.isFlexboxChild) {
|
||||||
[data addObject: [SKNamed newWithName:@"Layout" withValue:[self propsForFlexboxChild:node.flexboxChild]]];
|
[data addObject: [SKNamed newWithName:@"Layout" withValue:[self propsForFlexboxChild:node.flexboxChild]]];
|
||||||
}
|
}
|
||||||
NSMutableDictionary<NSString *, NSObject *> *extraData = [[NSMutableDictionary alloc] init];
|
NSMutableDictionary<NSString *, NSObject *> *extraData = [[NSMutableDictionary alloc] init];
|
||||||
|
|
||||||
for (SKSubDescriptor *s in _registeredSubdescriptors) {
|
for (SKSubDescriptor *s in _registeredSubdescriptors) {
|
||||||
[extraData setObject:[s getDataForNode:node] forKey:[s getName]];
|
[extraData setObject:[s getDataForNode:node] forKey:[s getName]];
|
||||||
}
|
}
|
||||||
if (extraData.count > 0) {
|
if (extraData.count > 0) {
|
||||||
[data addObject: [SKNamed newWithName:@"Extra Sections" withValue:extraData]];
|
[data addObject: [SKNamed newWithName:@"Extra Sections" withValue:extraData]];
|
||||||
}
|
}
|
||||||
|
|
||||||
[data addObjectsFromArray:[node.component sonar_getData]];
|
[data addObjectsFromArray:[node.component sonar_getData]];
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)addSubDescriptors:(nonnull NSArray<SKSubDescriptor *>*)subDescriptors{
|
- (void)addSubDescriptors:(nonnull NSArray<SKSubDescriptor *>*)subDescriptors{
|
||||||
_registeredSubdescriptors = subDescriptors;
|
// _registeredSubdescriptors = subDescriptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSDictionary<NSString *, NSObject *> *)propsForFlexboxChild:(CKFlexboxComponentChild)child {
|
- (NSDictionary<NSString *, NSObject *> *)propsForFlexboxChild:(CKFlexboxComponentChild)child {
|
||||||
return @{
|
return @{
|
||||||
@"spacingBefore": SKObject(@(child.spacingBefore)),
|
@"spacingBefore": SKObject(@(child.spacingBefore)),
|
||||||
|
|||||||
Reference in New Issue
Block a user