Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -1968,10 +1968,8 @@ public class com/facebook/react/config/ReactFeatureFlags {
public static field enableEagerRootViewAttachment Z
public static field enableFabricLogs Z
public static field enableFabricRenderer Z
public static field enableFabricRendererExclusively Z
public static field enableViewRecycling Z
public static field excludeYogaFromRawProps Z
public static field rejectTurboModulePromiseOnNativeError Z
public static field traceTurboModulePromiseRejections Z
public static field unstable_enableTurboModuleSyncVoidMethods Z
public static field unstable_useFabricInterop Z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,4 @@ public class ReactFeatureFlags {
* of Promise rejection and tracing the cause.
*/
public static boolean traceTurboModulePromiseRejections = ReactBuildConfig.DEBUG;

/**
* Enables auto rejecting promises from Turbo Modules method calls. If native error occurs Promise
* in JS will be rejected (The JS error will include native stack)
*/
public static boolean rejectTurboModulePromiseOnNativeError = true;

/*
* When the app is completely migrated to Fabric, set this flag to true to
* disable parts of Paper infrastructure that are not needed anymore but consume
* memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no
* longer work as they won't subscribe to ReactChoreographer for updates.
*/
public static boolean enableFabricRendererExclusively = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<687c29d850df9a857749d06c54cbddb7>>
* @generated SignedSource<<74d986b082e44be1b358d5442f4d133d>>
*/

/**
Expand Down Expand Up @@ -82,6 +82,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableCleanTextInputYogaNode(): Boolean = accessor.enableCleanTextInputYogaNode()

/**
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
*/
@JvmStatic
public fun enableFabricRendererExclusively(): Boolean = accessor.enableFabricRendererExclusively()

/**
* When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<a80c0d6190fe0222bfdd4a39d7116908>>
* @generated SignedSource<<375e752a672912488b52e34f39b5ed8c>>
*/

/**
Expand All @@ -29,6 +29,7 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
private var enableCleanTextInputYogaNodeCache: Boolean? = null
private var enableFabricRendererExclusivelyCache: Boolean? = null
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
private var enableLongTaskAPICache: Boolean? = null
private var enableMicrotasksCache: Boolean? = null
Expand Down Expand Up @@ -135,6 +136,15 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
return cached
}

override fun enableFabricRendererExclusively(): Boolean {
var cached = enableFabricRendererExclusivelyCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableFabricRendererExclusively()
enableFabricRendererExclusivelyCache = cached
}
return cached
}

override fun enableGranularShadowTreeStateReconciliation(): Boolean {
var cached = enableGranularShadowTreeStateReconciliationCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<af43467b1d1c4cd6d1f42a597a791899>>
* @generated SignedSource<<143e35723bffbb6ba5be2cfa4a497f0b>>
*/

/**
Expand Down Expand Up @@ -46,6 +46,8 @@ public object ReactNativeFeatureFlagsCxxInterop {

@DoNotStrip @JvmStatic public external fun enableCleanTextInputYogaNode(): Boolean

@DoNotStrip @JvmStatic public external fun enableFabricRendererExclusively(): Boolean

@DoNotStrip @JvmStatic public external fun enableGranularShadowTreeStateReconciliation(): Boolean

@DoNotStrip @JvmStatic public external fun enableLongTaskAPI(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<8903d3fb0088fcdd9ac3e789299b8b6c>>
* @generated SignedSource<<841edbe102ebbd78040892cf76f79bba>>
*/

/**
Expand Down Expand Up @@ -41,6 +41,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun enableCleanTextInputYogaNode(): Boolean = false

override fun enableFabricRendererExclusively(): Boolean = false

override fun enableGranularShadowTreeStateReconciliation(): Boolean = false

override fun enableLongTaskAPI(): Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<bf73788f1e8314232f880108b8a7c671>>
* @generated SignedSource<<58cd9d65067ed758ecad65ad22737b6c>>
*/

/**
Expand Down Expand Up @@ -33,6 +33,7 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
private var enableCleanTextInputYogaNodeCache: Boolean? = null
private var enableFabricRendererExclusivelyCache: Boolean? = null
private var enableGranularShadowTreeStateReconciliationCache: Boolean? = null
private var enableLongTaskAPICache: Boolean? = null
private var enableMicrotasksCache: Boolean? = null
Expand Down Expand Up @@ -148,6 +149,16 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
return cached
}

override fun enableFabricRendererExclusively(): Boolean {
var cached = enableFabricRendererExclusivelyCache
if (cached == null) {
cached = currentProvider.enableFabricRendererExclusively()
accessedFeatureFlags.add("enableFabricRendererExclusively")
enableFabricRendererExclusivelyCache = cached
}
return cached
}

override fun enableGranularShadowTreeStateReconciliation(): Boolean {
var cached = enableGranularShadowTreeStateReconciliationCache
if (cached == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<0284ff2541a06bfa36bb7049d47cb4d2>>
* @generated SignedSource<<7f753a763c3f4c0bcbdad268e32b21fb>>
*/

/**
Expand Down Expand Up @@ -41,6 +41,8 @@ public interface ReactNativeFeatureFlagsProvider {

@DoNotStrip public fun enableCleanTextInputYogaNode(): Boolean

@DoNotStrip public fun enableFabricRendererExclusively(): Boolean

@DoNotStrip public fun enableGranularShadowTreeStateReconciliation(): Boolean

@DoNotStrip public fun enableLongTaskAPI(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.facebook.react.bridge.SoftAssertions;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
import com.facebook.react.modules.core.ReactChoreographer;
import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
import com.facebook.systrace.Systrace;
Expand Down Expand Up @@ -928,7 +928,7 @@ public void runGuarded() {

/* package */ void resumeFrameCallback() {
mIsDispatchUIFrameCallbackEnqueued = true;
if (!ReactFeatureFlags.enableFabricRendererExclusively) {
if (!ReactNativeFeatureFlags.enableFabricRendererExclusively()) {
ReactChoreographer.getInstance()
.postFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.common.MapBuilder;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
import com.facebook.react.modules.core.ReactChoreographer;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.systrace.Systrace;
Expand Down Expand Up @@ -318,7 +318,7 @@ public void maybePost() {
}

private void post() {
if (!ReactFeatureFlags.enableFabricRendererExclusively) {
if (!ReactNativeFeatureFlags.enableFabricRendererExclusively()) {
ReactChoreographer.getInstance()
.postFrameCallback(
ReactChoreographer.CallbackType.TIMERS_EVENTS, mCurrentFrameCallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<b0e927861b19d02b77609527f6290d07>>
* @generated SignedSource<<d6b1fc3721972fd7f9286bf6140d46e7>>
*/

/**
Expand Down Expand Up @@ -93,6 +93,12 @@ class ReactNativeFeatureFlagsProviderHolder
return method(javaProvider_);
}

bool enableFabricRendererExclusively() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFabricRendererExclusively");
return method(javaProvider_);
}

bool enableGranularShadowTreeStateReconciliation() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableGranularShadowTreeStateReconciliation");
Expand Down Expand Up @@ -286,6 +292,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode(
return ReactNativeFeatureFlags::enableCleanTextInputYogaNode();
}

bool JReactNativeFeatureFlagsCxxInterop::enableFabricRendererExclusively(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableFabricRendererExclusively();
}

bool JReactNativeFeatureFlagsCxxInterop::enableGranularShadowTreeStateReconciliation(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation();
Expand Down Expand Up @@ -450,6 +461,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableCleanTextInputYogaNode",
JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode),
makeNativeMethod(
"enableFabricRendererExclusively",
JReactNativeFeatureFlagsCxxInterop::enableFabricRendererExclusively),
makeNativeMethod(
"enableGranularShadowTreeStateReconciliation",
JReactNativeFeatureFlagsCxxInterop::enableGranularShadowTreeStateReconciliation),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<732d3c3f973e966f958945c566de2870>>
* @generated SignedSource<<e55e568ed63f298253d863935068197a>>
*/

/**
Expand Down Expand Up @@ -57,6 +57,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableCleanTextInputYogaNode(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableFabricRendererExclusively(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

static bool enableGranularShadowTreeStateReconciliation(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<38c8d62457ec2b8c6333131c68dd4935>>
* @generated SignedSource<<ce67d7e79b3aceb449ee3b178f4e425b>>
*/

/**
Expand Down Expand Up @@ -57,6 +57,10 @@ bool ReactNativeFeatureFlags::enableCleanTextInputYogaNode() {
return getAccessor().enableCleanTextInputYogaNode();
}

bool ReactNativeFeatureFlags::enableFabricRendererExclusively() {
return getAccessor().enableFabricRendererExclusively();
}

bool ReactNativeFeatureFlags::enableGranularShadowTreeStateReconciliation() {
return getAccessor().enableGranularShadowTreeStateReconciliation();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<64e825121244867e1ee6b1b8e54158f2>>
* @generated SignedSource<<9a8e9432a444aaa9d997a91a77e17fa9>>
*/

/**
Expand Down Expand Up @@ -82,6 +82,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableCleanTextInputYogaNode();

/**
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
*/
RN_EXPORT static bool enableFabricRendererExclusively();

/**
* When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.
*/
Expand Down
Loading