-
Notifications
You must be signed in to change notification settings - Fork 24k
/
Binding.cpp
620 lines (513 loc) · 20.1 KB
/
Binding.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Binding.h"
#include "AsyncEventBeat.h"
#include "CppComponentRegistry.h"
#include "EventEmitterWrapper.h"
#include "JBackgroundExecutor.h"
#include "ReactNativeConfigHolder.h"
#include "StateWrapperImpl.h"
#include <cfenv>
#include <cmath>
#include <fbjni/fbjni.h>
#include <jsi/JSIDynamic.h>
#include <jsi/jsi.h>
#include <react/renderer/animations/LayoutAnimationDriver.h>
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#include <react/renderer/components/scrollview/ScrollViewProps.h>
#include <react/renderer/core/CoreFeatures.h>
#include <react/renderer/core/EventBeat.h>
#include <react/renderer/core/EventEmitter.h>
#include <react/renderer/core/conversions.h>
#include <react/renderer/debug/SystraceSection.h>
#include <react/renderer/scheduler/Scheduler.h>
#include <react/renderer/scheduler/SchedulerDelegate.h>
#include <react/renderer/scheduler/SchedulerToolbox.h>
#include <react/renderer/uimanager/primitives.h>
#include <react/utils/ContextContainer.h>
// Included to set BaseTextProps config; can be deleted later.
#include <react/renderer/components/text/BaseTextProps.h>
#include <glog/logging.h>
using namespace facebook::jni;
using namespace facebook::jsi;
namespace facebook {
namespace react {
jni::local_ref<Binding::jhybriddata> Binding::initHybrid(
jni::alias_ref<jclass>) {
return makeCxxInstance();
}
// Thread-safe getter
std::shared_ptr<Scheduler> Binding::getScheduler() {
std::shared_lock<butter::shared_mutex> lock(installMutex_);
return scheduler_;
}
jni::local_ref<ReadableNativeMap::jhybridobject>
Binding::getInspectorDataForInstance(
jni::alias_ref<EventEmitterWrapper::javaobject> eventEmitterWrapper) {
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::startSurface: scheduler disappeared";
return ReadableNativeMap::newObjectCxxArgs(folly::dynamic::object());
}
EventEmitterWrapper *cEventEmitter = cthis(eventEmitterWrapper);
InspectorData data =
scheduler->getInspectorDataForInstance(*cEventEmitter->eventEmitter);
folly::dynamic result = folly::dynamic::object;
result["fileName"] = data.fileName;
result["lineNumber"] = data.lineNumber;
result["columnNumber"] = data.columnNumber;
result["selectedIndex"] = data.selectedIndex;
result["props"] = data.props;
auto hierarchy = folly::dynamic::array();
for (const auto &hierarchyItem : data.hierarchy) {
hierarchy.push_back(hierarchyItem);
}
result["hierarchy"] = hierarchy;
return ReadableNativeMap::newObjectCxxArgs(result);
}
constexpr static auto ReactFeatureFlagsJavaDescriptor =
"com/facebook/react/config/ReactFeatureFlags";
static bool getFeatureFlagValue(const char *name) {
static const auto reactFeatureFlagsJavaDescriptor =
jni::findClassStatic(ReactFeatureFlagsJavaDescriptor);
const auto field =
reactFeatureFlagsJavaDescriptor->getStaticField<jboolean>(name);
return reactFeatureFlagsJavaDescriptor->getStaticFieldValue(field);
}
void Binding::setPixelDensity(float pointScaleFactor) {
pointScaleFactor_ = pointScaleFactor;
}
void Binding::driveCxxAnimations() {
scheduler_->animationTick();
}
#pragma mark - Surface management
void Binding::startSurface(
jint surfaceId,
jni::alias_ref<jstring> moduleName,
NativeMap *initialProps) {
SystraceSection s("FabricUIManagerBinding::startSurface");
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::startSurface: scheduler disappeared";
return;
}
auto layoutContext = LayoutContext{};
layoutContext.pointScaleFactor = pointScaleFactor_;
auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId};
surfaceHandler.setContextContainer(scheduler->getContextContainer());
surfaceHandler.setProps(initialProps->consume());
surfaceHandler.constraintLayout({}, layoutContext);
scheduler->registerSurface(surfaceHandler);
surfaceHandler.start();
surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate(
animationDriver_);
{
SystraceSection s2("FabricUIManagerBinding::startSurface::surfaceId::lock");
std::unique_lock<butter::shared_mutex> lock(surfaceHandlerRegistryMutex_);
SystraceSection s3("FabricUIManagerBinding::startSurface::surfaceId");
surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler));
}
auto mountingManager =
verifyMountingManager("FabricUIManagerBinding::startSurface");
if (!mountingManager) {
return;
}
mountingManager->onSurfaceStart(surfaceId);
}
void Binding::startSurfaceWithConstraints(
jint surfaceId,
jni::alias_ref<jstring> moduleName,
NativeMap *initialProps,
jfloat minWidth,
jfloat maxWidth,
jfloat minHeight,
jfloat maxHeight,
jfloat offsetX,
jfloat offsetY,
jboolean isRTL,
jboolean doLeftAndRightSwapInRTL) {
SystraceSection s("FabricUIManagerBinding::startSurfaceWithConstraints");
if (enableFabricLogs_) {
LOG(WARNING)
<< "Binding::startSurfaceWithConstraints() was called (address: "
<< this << ", surfaceId: " << surfaceId << ").";
}
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::startSurfaceWithConstraints: scheduler disappeared";
return;
}
auto minimumSize =
Size{minWidth / pointScaleFactor_, minHeight / pointScaleFactor_};
auto maximumSize =
Size{maxWidth / pointScaleFactor_, maxHeight / pointScaleFactor_};
LayoutContext context;
context.viewportOffset =
Point{offsetX / pointScaleFactor_, offsetY / pointScaleFactor_};
context.pointScaleFactor = {pointScaleFactor_};
context.swapLeftAndRightInRTL = doLeftAndRightSwapInRTL;
LayoutConstraints constraints = {};
constraints.minimumSize = minimumSize;
constraints.maximumSize = maximumSize;
constraints.layoutDirection =
isRTL ? LayoutDirection::RightToLeft : LayoutDirection::LeftToRight;
auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId};
surfaceHandler.setContextContainer(scheduler_->getContextContainer());
surfaceHandler.setProps(initialProps->consume());
surfaceHandler.constraintLayout(constraints, context);
scheduler->registerSurface(surfaceHandler);
surfaceHandler.start();
surfaceHandler.getMountingCoordinator()->setMountingOverrideDelegate(
animationDriver_);
{
SystraceSection s2(
"FabricUIManagerBinding::startSurfaceWithConstraints::surfaceId::lock");
std::unique_lock<butter::shared_mutex> lock(surfaceHandlerRegistryMutex_);
SystraceSection s3(
"FabricUIManagerBinding::startSurfaceWithConstraints::surfaceId");
surfaceHandlerRegistry_.emplace(surfaceId, std::move(surfaceHandler));
}
auto mountingManager = verifyMountingManager(
"FabricUIManagerBinding::startSurfaceWithConstraints");
if (!mountingManager) {
return;
}
mountingManager->onSurfaceStart(surfaceId);
}
void Binding::renderTemplateToSurface(jint surfaceId, jstring uiTemplate) {
SystraceSection s("FabricUIManagerBinding::renderTemplateToSurface");
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::renderTemplateToSurface: scheduler disappeared";
return;
}
auto env = Environment::current();
const char *nativeString = env->GetStringUTFChars(uiTemplate, JNI_FALSE);
scheduler->renderTemplateToSurface(surfaceId, nativeString);
env->ReleaseStringUTFChars(uiTemplate, nativeString);
}
void Binding::stopSurface(jint surfaceId) {
SystraceSection s("FabricUIManagerBinding::stopSurface");
if (enableFabricLogs_) {
LOG(WARNING) << "Binding::stopSurface() was called (address: " << this
<< ", surfaceId: " << surfaceId << ").";
}
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::stopSurface: scheduler disappeared";
return;
}
{
std::unique_lock<butter::shared_mutex> lock(surfaceHandlerRegistryMutex_);
auto iterator = surfaceHandlerRegistry_.find(surfaceId);
if (iterator == surfaceHandlerRegistry_.end()) {
LOG(ERROR) << "Binding::stopSurface: Surface with given id is not found";
return;
}
auto surfaceHandler = std::move(iterator->second);
surfaceHandlerRegistry_.erase(iterator);
surfaceHandler.stop();
scheduler->unregisterSurface(surfaceHandler);
}
auto mountingManager =
verifyMountingManager("FabricUIManagerBinding::stopSurface");
if (!mountingManager) {
return;
}
mountingManager->onSurfaceStop(surfaceId);
}
void Binding::registerSurface(SurfaceHandlerBinding *surfaceHandlerBinding) {
auto const &surfaceHandler = surfaceHandlerBinding->getSurfaceHandler();
auto scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::registerSurface: scheduler disappeared";
return;
}
scheduler->registerSurface(surfaceHandler);
auto mountingManager =
verifyMountingManager("FabricUIManagerBinding::registerSurface");
if (!mountingManager) {
return;
}
mountingManager->onSurfaceStart(surfaceHandler.getSurfaceId());
}
void Binding::unregisterSurface(SurfaceHandlerBinding *surfaceHandlerBinding) {
auto const &surfaceHandler = surfaceHandlerBinding->getSurfaceHandler();
auto scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::unregisterSurface: scheduler disappeared";
return;
}
scheduler->unregisterSurface(surfaceHandler);
auto mountingManager =
verifyMountingManager("FabricUIManagerBinding::unregisterSurface");
if (!mountingManager) {
return;
}
mountingManager->onSurfaceStop(surfaceHandler.getSurfaceId());
}
void Binding::setConstraints(
jint surfaceId,
jfloat minWidth,
jfloat maxWidth,
jfloat minHeight,
jfloat maxHeight,
jfloat offsetX,
jfloat offsetY,
jboolean isRTL,
jboolean doLeftAndRightSwapInRTL) {
SystraceSection s("FabricUIManagerBinding::setConstraints");
std::shared_ptr<Scheduler> scheduler = getScheduler();
if (!scheduler) {
LOG(ERROR) << "Binding::setConstraints: scheduler disappeared";
return;
}
auto minimumSize =
Size{minWidth / pointScaleFactor_, minHeight / pointScaleFactor_};
auto maximumSize =
Size{maxWidth / pointScaleFactor_, maxHeight / pointScaleFactor_};
LayoutContext context;
context.viewportOffset =
Point{offsetX / pointScaleFactor_, offsetY / pointScaleFactor_};
context.pointScaleFactor = {pointScaleFactor_};
context.swapLeftAndRightInRTL = doLeftAndRightSwapInRTL;
LayoutConstraints constraints = {};
constraints.minimumSize = minimumSize;
constraints.maximumSize = maximumSize;
constraints.layoutDirection =
isRTL ? LayoutDirection::RightToLeft : LayoutDirection::LeftToRight;
{
std::shared_lock<butter::shared_mutex> lock(surfaceHandlerRegistryMutex_);
auto iterator = surfaceHandlerRegistry_.find(surfaceId);
if (iterator == surfaceHandlerRegistry_.end()) {
LOG(ERROR)
<< "Binding::setConstraints: Surface with given id is not found";
return;
}
auto &surfaceHandler = iterator->second;
surfaceHandler.constraintLayout(constraints, context);
}
}
#pragma mark - Install/uninstall java binding
void Binding::installFabricUIManager(
jni::alias_ref<JRuntimeExecutor::javaobject> runtimeExecutorHolder,
jni::alias_ref<JRuntimeScheduler::javaobject> runtimeSchedulerHolder,
jni::alias_ref<jobject> javaUIManager,
EventBeatManager *eventBeatManager,
ComponentFactory *componentsRegistry,
jni::alias_ref<jobject> reactNativeConfig,
CppComponentRegistry *cppComponentRegistry) {
SystraceSection s("FabricUIManagerBinding::installFabricUIManager");
std::shared_ptr<const ReactNativeConfig> config =
std::make_shared<const ReactNativeConfigHolder>(reactNativeConfig);
enableFabricLogs_ =
config->getBool("react_fabric:enabled_android_fabric_logs");
if (enableFabricLogs_) {
LOG(WARNING) << "Binding::installFabricUIManager() was called (address: "
<< this << ").";
}
// TODO[T135327389]: Investigate why code relying on CppComponentRegistry
// crashing during hot reload restart.
// sharedCppComponentRegistry_ =
// std::shared_ptr<const facebook::react::CppComponentRegistry>(
// cppComponentRegistry ? cppComponentRegistry : nullptr);
// Use std::lock and std::adopt_lock to prevent deadlocks by locking mutexes
// at the same time
std::unique_lock<butter::shared_mutex> lock(installMutex_);
auto globalJavaUiManager = make_global(javaUIManager);
mountingManager_ = std::make_shared<FabricMountingManager>(
config, sharedCppComponentRegistry_, globalJavaUiManager);
ContextContainer::Shared contextContainer =
std::make_shared<ContextContainer>();
auto runtimeExecutor = runtimeExecutorHolder->cthis()->get();
if (runtimeSchedulerHolder) {
auto runtimeScheduler = runtimeSchedulerHolder->cthis()->get().lock();
if (runtimeScheduler) {
runtimeExecutor =
[runtimeScheduler](
std::function<void(jsi::Runtime & runtime)> &&callback) {
runtimeScheduler->scheduleWork(std::move(callback));
};
contextContainer->insert(
"RuntimeScheduler",
std::weak_ptr<RuntimeScheduler>(runtimeScheduler));
}
}
// TODO: T31905686 Create synchronous Event Beat
EventBeat::Factory synchronousBeatFactory =
[eventBeatManager, runtimeExecutor, globalJavaUiManager](
EventBeat::SharedOwnerBox const &ownerBox)
-> std::unique_ptr<EventBeat> {
return std::make_unique<AsyncEventBeat>(
ownerBox, eventBeatManager, runtimeExecutor, globalJavaUiManager);
};
EventBeat::Factory asynchronousBeatFactory =
[eventBeatManager, runtimeExecutor, globalJavaUiManager](
EventBeat::SharedOwnerBox const &ownerBox)
-> std::unique_ptr<EventBeat> {
return std::make_unique<AsyncEventBeat>(
ownerBox, eventBeatManager, runtimeExecutor, globalJavaUiManager);
};
contextContainer->insert("ReactNativeConfig", config);
contextContainer->insert("FabricUIManager", globalJavaUiManager);
// Keep reference to config object and cache some feature flags here
reactNativeConfig_ = config;
contextContainer->insert(
"CalculateTransformedFramesEnabled",
getFeatureFlagValue("calculateTransformedFramesEnabled"));
// Props setter pattern feature
CoreFeatures::enablePropIteratorSetter =
getFeatureFlagValue("enableCppPropsIteratorSetter");
// RemoveDelete mega-op
ShadowViewMutation::PlatformSupportsRemoveDeleteTreeInstruction =
getFeatureFlagValue("enableRemoveDeleteTreeInstruction");
auto toolbox = SchedulerToolbox{};
toolbox.contextContainer = contextContainer;
toolbox.componentRegistryFactory = componentsRegistry->buildRegistryFunction;
// TODO: (T130208323) runtimeExecutor should execute lambdas after
// main bundle eval, and bindingsInstallExecutor should execute before.
toolbox.bridgelessBindingsExecutor = std::nullopt;
toolbox.runtimeExecutor = runtimeExecutor;
toolbox.synchronousEventBeatFactory = synchronousBeatFactory;
toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory;
if (reactNativeConfig_->getBool(
"react_fabric:enable_background_executor_android")) {
backgroundExecutor_ = JBackgroundExecutor::create("fabric_bg");
toolbox.backgroundExecutor = backgroundExecutor_;
}
animationDriver_ = std::make_shared<LayoutAnimationDriver>(
runtimeExecutor, contextContainer, this);
scheduler_ =
std::make_shared<Scheduler>(toolbox, animationDriver_.get(), this);
}
void Binding::uninstallFabricUIManager() {
if (enableFabricLogs_) {
LOG(WARNING) << "Binding::uninstallFabricUIManager() was called (address: "
<< this << ").";
}
std::unique_lock<butter::shared_mutex> lock(installMutex_);
animationDriver_ = nullptr;
scheduler_ = nullptr;
mountingManager_ = nullptr;
reactNativeConfig_ = nullptr;
sharedCppComponentRegistry_ = nullptr;
}
std::shared_ptr<FabricMountingManager> Binding::verifyMountingManager(
std::string const &hint) {
std::shared_lock<butter::shared_mutex> lock(installMutex_);
if (!mountingManager_) {
LOG(ERROR) << hint << " mounting manager disappeared.";
}
return mountingManager_;
}
void Binding::schedulerDidFinishTransaction(
MountingCoordinator::Shared const &mountingCoordinator) {
auto mountingManager =
verifyMountingManager("Binding::schedulerDidFinishTransaction");
if (!mountingManager) {
return;
}
mountingManager->executeMount(mountingCoordinator);
}
void Binding::schedulerDidRequestPreliminaryViewAllocation(
const SurfaceId surfaceId,
const ShadowNode &shadowNode) {
if (!shadowNode.getTraits().check(ShadowNodeTraits::Trait::FormsView)) {
return;
}
preallocateView(surfaceId, shadowNode);
}
void Binding::preallocateView(
SurfaceId surfaceId,
ShadowNode const &shadowNode) {
auto name = std::string(shadowNode.getComponentName());
// Disable preallocation in java for C++ view managers
// RootComponents that are implmented as C++ view managers are still
// preallocated (this could be avoided by using Portals)
if (sharedCppComponentRegistry_ && sharedCppComponentRegistry_.get() &&
sharedCppComponentRegistry_->containsComponentManager(name) &&
!sharedCppComponentRegistry_->isRootComponent(name)) {
return;
}
auto shadowView = ShadowView(shadowNode);
auto mountingManager = verifyMountingManager("Binding::preallocateView");
if (!mountingManager) {
return;
}
mountingManager->preallocateShadowView(surfaceId, shadowView);
}
void Binding::schedulerDidDispatchCommand(
const ShadowView &shadowView,
std::string const &commandName,
folly::dynamic const &args) {
auto mountingManager =
verifyMountingManager("Binding::schedulerDidDispatchCommand");
if (!mountingManager) {
return;
}
mountingManager->dispatchCommand(shadowView, commandName, args);
}
void Binding::schedulerDidSendAccessibilityEvent(
const ShadowView &shadowView,
std::string const &eventType) {
auto mountingManager =
verifyMountingManager("Binding::schedulerDidSendAccessibilityEvent");
if (!mountingManager) {
return;
}
mountingManager->sendAccessibilityEvent(shadowView, eventType);
}
void Binding::schedulerDidSetIsJSResponder(
ShadowView const &shadowView,
bool isJSResponder,
bool blockNativeResponder) {
auto mountingManager =
verifyMountingManager("Binding::schedulerDidSetIsJSResponder");
if (!mountingManager) {
return;
}
mountingManager->setIsJSResponder(
shadowView, isJSResponder, blockNativeResponder);
}
void Binding::onAnimationStarted() {
auto mountingManager = verifyMountingManager("Binding::onAnimationStarted");
if (!mountingManager) {
return;
}
mountingManager->onAnimationStarted();
}
void Binding::onAllAnimationsComplete() {
auto mountingManager = verifyMountingManager("Binding::onAnimationComplete");
if (!mountingManager) {
return;
}
mountingManager->onAllAnimationsComplete();
}
void Binding::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", Binding::initHybrid),
makeNativeMethod(
"installFabricUIManager", Binding::installFabricUIManager),
makeNativeMethod("startSurface", Binding::startSurface),
makeNativeMethod(
"getInspectorDataForInstance", Binding::getInspectorDataForInstance),
makeNativeMethod(
"startSurfaceWithConstraints", Binding::startSurfaceWithConstraints),
makeNativeMethod(
"renderTemplateToSurface", Binding::renderTemplateToSurface),
makeNativeMethod("stopSurface", Binding::stopSurface),
makeNativeMethod("setConstraints", Binding::setConstraints),
makeNativeMethod("setPixelDensity", Binding::setPixelDensity),
makeNativeMethod("driveCxxAnimations", Binding::driveCxxAnimations),
makeNativeMethod(
"uninstallFabricUIManager", Binding::uninstallFabricUIManager),
makeNativeMethod("registerSurface", Binding::registerSurface),
makeNativeMethod("unregisterSurface", Binding::unregisterSurface),
});
}
} // namespace react
} // namespace facebook