Create MC to verify impact of eager initialization of fabric classes

Summary:
This diff creates a MC to verify impact of eager initialization of fabric classes, the purpose is to remove this code, but before doing that I would like to verify what's the impact.

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D28223943

fbshipit-source-id: 6f7c4701fb730fe1c0629ec13ead592ff619373f
This commit is contained in:
David Vacca 2021-05-05 13:05:20 -07:00 коммит произвёл Facebook GitHub Bot
Родитель c6b8625664
Коммит 7fe6bc1150
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -61,6 +61,9 @@ public class ReactFeatureFlags {
/** Feature flag to configure eager initialization of Fabric */
public static boolean eagerInitializeFabric = false;
/** Feature flag to configure eager initialization classes of Fabric */
public static boolean eagerInitializeFabricClasses = false;
/** Enables Static ViewConfig in RN Android native code. */
public static boolean enableExperimentalStaticViewConfigs = false;

Просмотреть файл

@ -15,6 +15,7 @@ import com.facebook.react.bridge.JSIModuleProvider;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.bridge.queue.MessageQueueThread;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.fabric.events.EventBeatManager;
import com.facebook.react.fabric.events.EventEmitterWrapper;
import com.facebook.react.fabric.events.FabricEventEmitter;
@ -63,7 +64,9 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.registerBinding");
final Binding binding = new Binding();
// TODO T31905686: remove this call
loadClasses();
if (ReactFeatureFlags.eagerInitializeFabricClasses) {
loadClasses();
}
MessageQueueThread jsMessageQueueThread =
mReactApplicationContext
.getCatalystInstance()