Files
react-native/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java
T
Joshua Gross 752e7ab1f9 Experiment to replace Fabric MountItem lists with concurrent queues (re-land)
Summary:
Currently, queuing any sort of MountItem or getting the list of MountItems requires synchronization. Since these can be queued up at any point from the JS thread, there will, in theory, be constant contention between JS and UI thread.

To see if this is true, I'm creating an experiment instead of just switching over to concurrent structures. After seeing results, we can hopefully make a decision and delete the non-concurrent stuff or improve on it somehow.

The original was unlanded in D24973616 (https://github.com/facebook/react-native/commit/26787e2260412d9d2fe831e68a8616505d3cab36) due to a typo, which has been fixed now. The typo was that in Blocking Mode, we queued up all PreMountItems to the concurrent PreMountItems queue.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D24974851

fbshipit-source-id: d081c081bbd0de445bb92408f0ec822056b905a5
2020-11-14 12:19:56 -08:00

95 lines
3.8 KiB
Java

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.config;
/**
* Hi there, traveller! This configuration class is not meant to be used by end-users of RN. It
* contains mainly flags for features that are either under active development and not ready for
* public consumption, or for use in experiments.
*
* <p>These values are safe defaults and should not require manual changes.
*/
public class ReactFeatureFlags {
/**
* Should this application use TurboModules? If yes, then any module that inherits {@link
* com.facebook.react.turbomodule.core.interfaces.TurboModule} will NOT be passed in to C++
* CatalystInstanceImpl
*/
public static volatile boolean useTurboModules = false;
/** Should we dispatch TurboModule methods with promise returns to the NativeModules thread? */
public static volatile boolean enableTurboModulePromiseAsyncDispatch = false;
/** Enable TurboModule JS Codegen. */
public static volatile boolean useTurboModuleJSCodegen = false;
/**
* Enable the fix to validate the TurboReactPackage's module info before resolving a TurboModule.
*/
public static volatile boolean enableTurboModulePackageInfoValidation = false;
/*
* This feature flag enables logs for Fabric
*/
public static boolean enableFabricLogs = false;
/**
* Should this application use a {@link com.facebook.react.uimanager.ViewManagerDelegate} (if
* provided) to update the view properties. If {@code false}, then the generated {@code
* ...$$PropsSetter} class will be used instead.
*/
public static boolean useViewManagerDelegates = false;
/**
* Should this application use a {@link com.facebook.react.uimanager.ViewManagerDelegate} (if
* provided) to execute the view commands. If {@code false}, then {@code receiveCommand} method
* inside view manager will be called instead.
*/
public static boolean useViewManagerDelegatesForCommands = false;
/**
* This react flag enables a custom algorithm for the getChildVisibleRect() method in the classes
* ReactViewGroup, ReactHorizontalScrollView and ReactScrollView.
*
* <p>This new algorithm clip child rects if overflow is set to ViewProps.HIDDEN. More details in
* https://github.com/facebook/react-native/issues/23870 and
* https://github.com/facebook/react-native/pull/26334
*
* <p>The react flag is disabled by default because this is increasing ANRs (T57363204)
*/
public static boolean clipChildRectsIfOverflowIsHidden = false;
/**
* Temporary feature flat to control a fix in the transition to layoutOnlyViews TODO T61185028:
* remove this when bug is fixed
*/
public static boolean enableTransitionLayoutOnlyViewCleanup = false;
/** Feature flag to configure eager initialization of Fabric */
public static boolean eagerInitializeFabric = false;
/** Feature flag to use stopSurface when ReactRootView is unmounted. */
public static boolean enableStopSurfaceOnRootViewUnmount = false;
/** Use experimental SetState retry mechanism in view? */
public static boolean enableExperimentalStateUpdateRetry = false;
/** Enable caching of Spannable objects using equality of ReadableNativeMaps */
public static boolean enableSpannableCacheByReadableNativeMapEquality = true;
/** Disable customDrawOrder in ReactViewGroup under Fabric only. */
public static boolean disableCustomDrawOrderFabric = false;
/** Potential bugfix for crashes caused by mutating the view hierarchy during onDraw. */
public static boolean enableDrawMutationFix = true;
/** Use lock-free data structures for Fabric MountItems. */
public static boolean enableLockFreeMountInstructions = false;
}