Skip to content

Commit d2dc451

Browse files
sherginfacebook-github-bot
authored andcommitted
reactBridgeDidFinishTransaction was finally removed
Summary: We are removing `reactBridgeDidFinishTransaction`. Why? * It is a performance drain. Supporting this requires dispatching main-thread block on every single transaction complete; * It has "too broad" non-conceptual semantic which encouraged using this as a "band-aid solution" for poorly designed components; * It is conceptually incompatible with new approaches that we are trying to implement to optimize the render layer; * It was deprecated for very long time. Reviewed By: mmmulani Differential Revision: D6549729 fbshipit-source-id: 58094aab982c67cec3d7fa3b616c637cb84d697f
1 parent b263560 commit d2dc451

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

React/Modules/RCTUIManager.m

+1-20
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ @implementation RCTUIManager
6868

6969
// Keyed by viewName
7070
NSDictionary *_componentDataByName;
71-
72-
NSMutableSet<id<RCTComponent>> *_bridgeTransactionListeners;
7371
}
7472

7573
@synthesize bridge = _bridge;
@@ -107,7 +105,6 @@ - (void)invalidate
107105
self->_rootViewTags = nil;
108106
self->_shadowViewRegistry = nil;
109107
self->_viewRegistry = nil;
110-
self->_bridgeTransactionListeners = nil;
111108
self->_bridge = nil;
112109

113110
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -145,7 +142,6 @@ - (void)setBridge:(RCTBridge *)bridge
145142
_pendingUIBlocks = [NSMutableArray new];
146143
_rootViewTags = [NSMutableSet new];
147144

148-
_bridgeTransactionListeners = [NSMutableSet new];
149145
_observerCoordinator = [RCTUIManagerObserverCoordinator new];
150146

151147
// Get view managers from bridge
@@ -448,10 +444,6 @@ - (void)_purgeChildren:(NSArray<id<RCTComponent>> *)children
448444
[(id<RCTInvalidating>)subview invalidate];
449445
}
450446
[registry removeObjectForKey:subview.reactTag];
451-
452-
if (registry == (NSMutableDictionary<NSNumber *, id<RCTComponent>> *)self->_viewRegistry) {
453-
[self->_bridgeTransactionListeners removeObject:subview];
454-
}
455447
});
456448
}
457449
}
@@ -996,9 +988,7 @@ - (void)_manageChildren:(NSNumber *)containerTag
996988
if ([view respondsToSelector:@selector(setBackgroundColor:)]) {
997989
((UIView *)view).backgroundColor = backgroundColor;
998990
}
999-
if ([view respondsToSelector:@selector(reactBridgeDidFinishTransaction)]) {
1000-
[uiManager->_bridgeTransactionListeners addObject:view];
1001-
}
991+
1002992
uiManager->_viewRegistry[reactTag] = view;
1003993

1004994
#if RCT_DEV
@@ -1117,15 +1107,6 @@ - (void)_layoutAndMount
11171107
[self _amendPendingUIBlocksWithStylePropagationUpdateForShadowView:rootView];
11181108
}
11191109

1120-
[self addUIBlock:^(RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
1121-
/**
1122-
* TODO(tadeu): Remove it once and for all
1123-
*/
1124-
for (id<RCTComponent> node in uiManager->_bridgeTransactionListeners) {
1125-
[node reactBridgeDidFinishTransaction];
1126-
}
1127-
}];
1128-
11291110
[_observerCoordinator uiManagerWillPerformMounting:self];
11301111

11311112
[self flushUIBlocksWithCompletion:^{

React/Views/RCTComponent.h

-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ typedef void (^RCTBubblingEventBlock)(NSDictionary *body);
5050
*/
5151
- (void)didUpdateReactSubviews;
5252

53-
// TODO: Deprecate this
54-
// This method is called after layout has been performed for all views known
55-
// to the RCTViewManager. It is only called on UIViews, not shadow views.
56-
- (void)reactBridgeDidFinishTransaction;
57-
5853
@end
5954

6055
// TODO: this is kinda dumb - let's come up with a

0 commit comments

Comments
 (0)