Skip to content

Commit 15dbd91

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Back out "Fix: Install Fabric UIManager before main bundle execution"
Summary: Original commit changeset: 4491d6de1109 Original Phabricator Diff: D39493654 (447be62) changelog: [internal] Reviewed By: javache Differential Revision: D39727129 fbshipit-source-id: 412a7fc5e4bf8db26cde7d420e71cf1f314cdc93
1 parent 22940e4 commit 15dbd91

File tree

6 files changed

+3
-22
lines changed

6 files changed

+3
-22
lines changed

React/Fabric/RCTSurfacePresenter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
2828
@interface RCTSurfacePresenter : NSObject
2929

3030
- (instancetype)initWithContextContainer:(facebook::react::ContextContainer::Shared)contextContainer
31-
runtimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor
32-
bindingsInstallExecutor:(facebook::react::RuntimeExecutor)bindingsInstallExecutor;
31+
runtimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor;
3332

3433
@property (nonatomic) facebook::react::ContextContainer::Shared contextContainer;
3534
@property (nonatomic) facebook::react::RuntimeExecutor runtimeExecutor;

React/Fabric/RCTSurfacePresenter.mm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,17 @@ @implementation RCTSurfacePresenter {
7979
RCTScheduler *_Nullable _scheduler; // Thread-safe. Pointer is protected by `_schedulerAccessMutex`.
8080
ContextContainer::Shared _contextContainer; // Protected by `_schedulerLifeCycleMutex`.
8181
RuntimeExecutor _runtimeExecutor; // Protected by `_schedulerLifeCycleMutex`.
82-
RuntimeExecutor _bindingsInstallExecutor; // Only used for installing bindings.
8382

8483
butter::shared_mutex _observerListMutex;
8584
std::vector<__weak id<RCTSurfacePresenterObserver>> _observers; // Protected by `_observerListMutex`.
8685
}
8786

8887
- (instancetype)initWithContextContainer:(ContextContainer::Shared)contextContainer
8988
runtimeExecutor:(RuntimeExecutor)runtimeExecutor
90-
bindingsInstallExecutor:(RuntimeExecutor)bindingsInstallExecutor
9189
{
9290
if (self = [super init]) {
9391
assert(contextContainer && "RuntimeExecutor must be not null.");
9492
_runtimeExecutor = runtimeExecutor;
95-
_bindingsInstallExecutor = bindingsInstallExecutor;
9693
_contextContainer = contextContainer;
9794

9895
_surfaceRegistry = [RCTSurfaceRegistry new];
@@ -298,7 +295,6 @@ - (RCTScheduler *)_createScheduler
298295
}
299296

300297
toolbox.runtimeExecutor = runtimeExecutor;
301-
toolbox.bindingsInstallExecutor = _bindingsInstallExecutor;
302298

303299
toolbox.mainRunLoopObserverFactory = [](RunLoopObserver::Activity activities,
304300
RunLoopObserver::WeakOwner const &owner) {

React/Fabric/RCTSurfacePresenterBridgeAdapter.mm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge contextContainer:(ContextCont
8989
{
9090
if (self = [super init]) {
9191
contextContainer->update(*RCTContextContainerFromBridge(bridge));
92-
auto runtimeExecuter = RCTRuntimeExecutorFromBridge(bridge);
9392
_surfacePresenter = [[RCTSurfacePresenter alloc] initWithContextContainer:contextContainer
94-
runtimeExecutor:runtimeExecuter
95-
bindingsInstallExecutor:runtimeExecuter];
93+
runtimeExecutor:RCTRuntimeExecutorFromBridge(bridge)];
9694

9795
_bridge = bridge;
9896
_batchedBridge = [_bridge batchedBridge] ?: _bridge;

ReactAndroid/src/main/jni/react/fabric/Binding.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,7 @@ void Binding::installFabricUIManager(
468468
auto toolbox = SchedulerToolbox{};
469469
toolbox.contextContainer = contextContainer;
470470
toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction;
471-
472-
// TODO: (T130208323) runtimeExecutor should execute lambdas after
473-
// main bundle eval, and bindingsInstallExecutor should execute before.
474-
toolbox.bindingsInstallExecutor = runtimeExecutor;
475471
toolbox.runtimeExecutor = runtimeExecutor;
476-
477472
toolbox.synchronousEventBeatFactory = synchronousBeatFactory;
478473
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
479474

ReactCommon/react/renderer/scheduler/Scheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Scheduler::Scheduler(
9595
uiManager->setDelegate(this);
9696
uiManager->setComponentDescriptorRegistry(componentDescriptorRegistry_);
9797

98-
schedulerToolbox.bindingsInstallExecutor([uiManager](jsi::Runtime &runtime) {
98+
runtimeExecutor_([uiManager](jsi::Runtime &runtime) {
9999
UIManagerBinding::createAndInstallIfNeeded(runtime, uiManager);
100100
});
101101

ReactCommon/react/renderer/scheduler/SchedulerToolbox.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ struct SchedulerToolbox final {
4040

4141
/*
4242
* Represents running JavaScript VM and associated execution queue.
43-
* Can execute lambdas before main bundle has loaded.
44-
*/
45-
RuntimeExecutor bindingsInstallExecutor;
46-
47-
/*
48-
* Represents running JavaScript VM and associated execution queue.
49-
* Only executes lambdas after main bundle has loaded.
5043
*/
5144
RuntimeExecutor runtimeExecutor;
5245

0 commit comments

Comments
 (0)