mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add option to use RuntimeScheduler in TurboModules
Summary: changelog: [internal] Reviewed By: RSNara Differential Revision: D31145372 fbshipit-source-id: b1d9473d5006d055d1116f71f65899293fb85c56
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3516090174
commit
ea3e244668
@@ -1368,10 +1368,6 @@ public class ReactInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (ReactFeatureFlags.enableRuntimeScheduler) {
|
||||
catalystInstance.installRuntimeScheduler();
|
||||
}
|
||||
|
||||
if (mJSIModulePackage != null) {
|
||||
catalystInstance.addJSIModules(
|
||||
mJSIModulePackage.getJSIModules(
|
||||
|
||||
@@ -113,8 +113,6 @@ public interface CatalystInstance
|
||||
|
||||
RuntimeScheduler getRuntimeScheduler();
|
||||
|
||||
void installRuntimeScheduler();
|
||||
|
||||
void addJSIModules(List<JSIModuleSpec> jsiModules);
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
// C++ parts
|
||||
private final HybridData mHybridData;
|
||||
|
||||
private static native HybridData initHybrid();
|
||||
private static native HybridData initHybrid(
|
||||
boolean enableRuntimeScheduler, boolean enableRuntimeSchedulerInTurboModule);
|
||||
|
||||
public native CallInvokerHolderImpl getJSCallInvokerHolder();
|
||||
|
||||
@@ -123,7 +124,15 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createCatalystInstanceImpl");
|
||||
|
||||
mHybridData = initHybrid();
|
||||
if (ReactFeatureFlags.enableRuntimeSchedulerInTurboModule
|
||||
&& !ReactFeatureFlags.enableRuntimeScheduler) {
|
||||
Assertions.assertUnreachable();
|
||||
}
|
||||
|
||||
mHybridData =
|
||||
initHybrid(
|
||||
ReactFeatureFlags.enableRuntimeScheduler,
|
||||
ReactFeatureFlags.enableRuntimeSchedulerInTurboModule);
|
||||
|
||||
mReactQueueConfiguration =
|
||||
ReactQueueConfigurationImpl.create(
|
||||
@@ -560,8 +569,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
|
||||
public native RuntimeScheduler getRuntimeScheduler();
|
||||
|
||||
public native void installRuntimeScheduler();
|
||||
|
||||
@Override
|
||||
public void addJSIModules(List<JSIModuleSpec> jsiModules) {
|
||||
mJSIModuleRegistry.registerModules(jsiModules);
|
||||
|
||||
@@ -72,6 +72,8 @@ public class ReactFeatureFlags {
|
||||
|
||||
public static boolean enableRuntimeScheduler = false;
|
||||
|
||||
public static boolean enableRuntimeSchedulerInTurboModule = false;
|
||||
|
||||
/** Enables a more aggressive cleanup during destruction of ReactContext */
|
||||
public static boolean enableReactContextCleanupFix = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user