Improvement of live editing
Summary: Live editing is now working faster. We had an issue that it took about 5 seconds to see the view changed and 10 seconds to see tha value in the flipper, now it's done immidiately Reviewed By: priteshrnandgaonkar Differential Revision: D16500961 fbshipit-source-id: 742ce628a887bab06c1b883d9710c477af2508e7
This commit is contained in:
committed by
Facebook Github Bot
parent
43a3c33347
commit
00e8f43e37
@@ -148,6 +148,18 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- (void)populateAllNodesFromNode:(nonnull NSString *)identifier inArray:(nonnull NSMutableArray<NSDictionary *> *)mutableArray {
|
||||
NSDictionary *nodeDict = [self getNode:identifier];
|
||||
if (nodeDict == nil) {
|
||||
return;
|
||||
}
|
||||
[mutableArray addObject:nodeDict];
|
||||
NSArray *children = nodeDict[@"children"];
|
||||
for (NSString *childIdentifier in children) {
|
||||
[self populateAllNodesFromNode:childIdentifier inArray:mutableArray];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onCallGetAllNodesWithResponder:(nonnull id<FlipperResponder>)responder {
|
||||
NSMutableArray<NSDictionary*> *allNodes = @[].mutableCopy;
|
||||
NSString *identifier = [self trackObject: _rootNode];
|
||||
@@ -216,11 +228,11 @@
|
||||
const auto identifierForInvalidation = [descriptor identifierForInvalidation:node];
|
||||
id nodeForInvalidation = [_trackedObjects objectForKey:identifierForInvalidation];
|
||||
SKNodeDescriptor *descriptorForInvalidation = [_descriptorMapper descriptorForClass:[nodeForInvalidation class]];
|
||||
NSMutableArray *children = [self getChildrenForNode:nodeForInvalidation withDescriptor:descriptorForInvalidation];
|
||||
updateDataForPath(value);
|
||||
[connection send: @"invalidate" withParams: @{
|
||||
@"nodes": @[@{@"id": [descriptorForInvalidation identifierForNode: nodeForInvalidation], @"children": children}]
|
||||
}];
|
||||
|
||||
NSMutableArray *nodesForInvalidation = [NSMutableArray new];
|
||||
[self populateAllNodesFromNode:[descriptorForInvalidation identifierForNode:nodeForInvalidation] inArray:nodesForInvalidation];
|
||||
[connection send: @"invalidateWithData" withParams: @{@"nodes": nodesForInvalidation}];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user