mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Clean up RuntimeExecutor experiment and remove jsContext param
Summary: Cleaning up the test for switching to the shared RuntimeExecutor, and removing the jsContext arg from Fabric's Android APIs entirely. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D22026752 fbshipit-source-id: df70faa70eaa2a04717ae89e8ad3216dfd486a35
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ab56ed7d96
commit
eddf90f756
@@ -11,7 +11,6 @@ import android.annotation.SuppressLint;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||
import com.facebook.react.bridge.NativeMap;
|
||||
import com.facebook.react.bridge.RuntimeExecutor;
|
||||
import com.facebook.react.bridge.queue.MessageQueueThread;
|
||||
@@ -35,7 +34,6 @@ public class Binding {
|
||||
}
|
||||
|
||||
private native void installFabricUIManager(
|
||||
long jsContextNativePointer,
|
||||
RuntimeExecutor runtimeExecutor,
|
||||
Object uiManager,
|
||||
EventBeatManager eventBeatManager,
|
||||
@@ -76,7 +74,6 @@ public class Binding {
|
||||
|
||||
// TODO (T67721598) Remove the jsContext param once we've migrated to using RuntimeExecutor
|
||||
public void register(
|
||||
@NonNull JavaScriptContextHolder jsContext,
|
||||
@NonNull RuntimeExecutor runtimeExecutor,
|
||||
@NonNull FabricUIManager fabricUIManager,
|
||||
@NonNull EventBeatManager eventBeatManager,
|
||||
@@ -85,7 +82,6 @@ public class Binding {
|
||||
@NonNull ReactNativeConfig reactNativeConfig) {
|
||||
fabricUIManager.setBinding(this);
|
||||
installFabricUIManager(
|
||||
jsContext.get(),
|
||||
runtimeExecutor,
|
||||
fabricUIManager,
|
||||
eventBeatManager,
|
||||
|
||||
@@ -10,7 +10,6 @@ package com.facebook.react.fabric;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.bridge.JSIModuleProvider;
|
||||
import com.facebook.react.bridge.JavaScriptContextHolder;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.UIManager;
|
||||
import com.facebook.react.bridge.queue.MessageQueueThread;
|
||||
@@ -42,18 +41,15 @@ import com.facebook.systrace.Systrace;
|
||||
|
||||
public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
|
||||
@NonNull private final JavaScriptContextHolder mJSContext;
|
||||
@NonNull private final ReactApplicationContext mReactApplicationContext;
|
||||
@NonNull private final ComponentFactoryDelegate mComponentFactoryDelegate;
|
||||
@NonNull private final ReactNativeConfig mConfig;
|
||||
|
||||
public FabricJSIModuleProvider(
|
||||
@NonNull ReactApplicationContext reactApplicationContext,
|
||||
@NonNull JavaScriptContextHolder jsContext,
|
||||
@NonNull ComponentFactoryDelegate componentFactoryDelegate,
|
||||
@NonNull ReactNativeConfig config) {
|
||||
mReactApplicationContext = reactApplicationContext;
|
||||
mJSContext = jsContext;
|
||||
mComponentFactoryDelegate = componentFactoryDelegate;
|
||||
mConfig = config;
|
||||
}
|
||||
@@ -74,7 +70,6 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
.getJSQueueThread();
|
||||
|
||||
binding.register(
|
||||
mJSContext,
|
||||
mReactApplicationContext.getCatalystInstance().getRuntimeExecutor(),
|
||||
uiManager,
|
||||
eventBeatManager,
|
||||
|
||||
@@ -206,7 +206,6 @@ void Binding::setConstraints(
|
||||
}
|
||||
|
||||
void Binding::installFabricUIManager(
|
||||
jlong jsContextNativePointer,
|
||||
jni::alias_ref<JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
||||
jni::alias_ref<jobject> javaUIManager,
|
||||
EventBeatManager *eventBeatManager,
|
||||
@@ -240,24 +239,7 @@ void Binding::installFabricUIManager(
|
||||
|
||||
auto sharedJSMessageQueueThread =
|
||||
std::make_shared<JMessageQueueThread>(jsMessageQueueThread);
|
||||
|
||||
bool useRuntimeExecutor =
|
||||
config->getBool("react_fabric:use_shared_runtime_executor_android");
|
||||
|
||||
RuntimeExecutor runtimeExecutor;
|
||||
if (useRuntimeExecutor) {
|
||||
runtimeExecutor = runtimeExecutorHolder->cthis()->get();
|
||||
} else {
|
||||
Runtime *runtime = (Runtime *)jsContextNativePointer;
|
||||
runtimeExecutor =
|
||||
[runtime, sharedJSMessageQueueThread](
|
||||
std::function<void(facebook::jsi::Runtime & runtime)> &&callback) {
|
||||
sharedJSMessageQueueThread->runOnQueue(
|
||||
[runtime, callback = std::move(callback)]() {
|
||||
callback(*runtime);
|
||||
});
|
||||
};
|
||||
}
|
||||
auto runtimeExecutor = runtimeExecutorHolder->cthis()->get();
|
||||
|
||||
// TODO: T31905686 Create synchronous Event Beat
|
||||
jni::global_ref<jobject> localJavaUIManager = javaUIManager_;
|
||||
|
||||
@@ -53,7 +53,6 @@ class Binding : public jni::HybridClass<Binding>,
|
||||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jclass>);
|
||||
|
||||
void installFabricUIManager(
|
||||
jlong jsContextNativePointer,
|
||||
jni::alias_ref<JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
||||
jni::alias_ref<jobject> javaUIManager,
|
||||
EventBeatManager *eventBeatManager,
|
||||
|
||||
Reference in New Issue
Block a user