mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Delete eager initialization of Fabric classes
Summary: I run an experiment and I verified that eager initialization of fabric classes is neutral and it's showing a regression in "marketplace:interface:metrics" See: https://www.internalfb.com/intern/qe2/react_fabric_marketplace_home_android_universe/react_fabric_marketplace_home_eager_init_v1/analysis?control=test_no_eager_init&test=test_eager_init_classes This diff removed the optimization and it cleans up the code changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D28815647 fbshipit-source-id: 2c9fe3875b1797d9a7def61e5ab97c2df2a462dd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2f477b1844
commit
286fac5ad0
@@ -47,9 +47,6 @@ 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,27 +15,11 @@ 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.common.mapbuffer.ReadableMapBuffer;
|
||||
import com.facebook.react.common.mapbuffer.ReadableMapBufferSoLoader;
|
||||
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;
|
||||
import com.facebook.react.fabric.mounting.LayoutMetricsConversions;
|
||||
import com.facebook.react.fabric.mounting.MountItemDispatcher;
|
||||
import com.facebook.react.fabric.mounting.MountingManager;
|
||||
import com.facebook.react.fabric.mounting.SurfaceMountingManager;
|
||||
import com.facebook.react.fabric.mounting.mountitems.DispatchCommandMountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.DispatchIntCommandMountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.DispatchStringCommandMountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.MountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.PreAllocateViewMountItem;
|
||||
import com.facebook.react.fabric.mounting.mountitems.SendAccessibilityEvent;
|
||||
import com.facebook.react.uimanager.StateWrapper;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.ViewManagerRegistry;
|
||||
import com.facebook.react.uimanager.events.BatchEventDispatchedListener;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
import com.facebook.systrace.Systrace;
|
||||
|
||||
@@ -65,10 +49,6 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
Systrace.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.registerBinding");
|
||||
final Binding binding = new Binding();
|
||||
// TODO T31905686: remove this call
|
||||
if (ReactFeatureFlags.eagerInitializeFabricClasses) {
|
||||
loadClasses();
|
||||
}
|
||||
if (ReactFeatureFlags.enableEagerInitializeMapBufferSoFile) {
|
||||
ReadableMapBufferSoLoader.staticInit();
|
||||
}
|
||||
@@ -112,37 +92,4 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
return fabricUIManager;
|
||||
}
|
||||
|
||||
// TODO T31905686: eager load Fabric classes, this is temporary and it will be removed
|
||||
// in the near future
|
||||
private static void loadClasses() {
|
||||
EventBeatManager.class.getClass();
|
||||
EventEmitterWrapper.class.getClass();
|
||||
FabricEventEmitter.class.getClass();
|
||||
DispatchCommandMountItem.class.getClass();
|
||||
DispatchIntCommandMountItem.class.getClass();
|
||||
DispatchStringCommandMountItem.class.getClass();
|
||||
IntBufferBatchMountItem.class.getClass();
|
||||
MountItem.class.getClass();
|
||||
PreAllocateViewMountItem.class.getClass();
|
||||
SendAccessibilityEvent.class.getClass();
|
||||
LayoutMetricsConversions.class.getClass();
|
||||
MountingManager.class.getClass();
|
||||
MountItemDispatcher.class.getClass();
|
||||
SurfaceMountingManager.class.getClass();
|
||||
Binding.class.getClass();
|
||||
ComponentFactory.class.getClass();
|
||||
CoreComponentsRegistry.class.getClass();
|
||||
FabricComponents.class.getClass();
|
||||
FabricSoLoader.class.getClass();
|
||||
FabricUIManager.class.getClass();
|
||||
GuardedFrameCallback.class.getClass();
|
||||
StateWrapper.class.getClass();
|
||||
StateWrapperImpl.class.getClass();
|
||||
SurfaceHandler.class.getClass();
|
||||
SurfaceHandlerBinding.class.getClass();
|
||||
BatchEventDispatchedListener.class.getClass();
|
||||
ReactNativeConfig.class.getClass();
|
||||
ReadableMapBuffer.class.getClass();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user