Directly Trust Text Layout Width (#51206)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51206

When we create a layout from measure constraints, we do some processing of the width, to return a different one, potentially smaller than the layout width, sometimes using line width, and sometimes using the container width.

This logic has gotten spooooky over time, and after a series of changes, and bugfixes, now effectively does nothing!

1. Way back in 2020, yungsters made D21056031 introducing this logic to "shrink wrap" text which is wrapped.
2. "Shrink wrapping" is not how web works when text is wrapped, (though it is how it works when there is explicit newline), and https://github.com/facebook/react-native/pull/47435 later undid this change
3. https://github.com/facebook/react-native/pull/37790 made changes specific to the case of trailing newline, because the logic to "shrink wrap" did not handle correctly.

After D74366936, which changes width used for layout creation to correctly respect `Layout.desiredWidth`, we should be back to multiline layouts, with no paragraph whose lines take up more than container width, being "shrink wrapped", while not doing so when there is wrapping or ellipsization, like current behavior. The desired width also excludes the non-visible trailing whitespace.

It means we can remove all of this logic, while preserving the same behavior. Mismatched measure widths from those used in the intermediate layout may also result in issues for Facsimile (see example in last diff of stack).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D74368513

fbshipit-source-id: df5d7b773ad1888ebca1966ee4020a5c2ce7fd64
This commit is contained in:
Nick Gerleman
2025-05-09 12:52:36 -07:00
committed by Facebook GitHub Bot
parent 3a84d42aa1
commit 71ef049065
21 changed files with 147 additions and 27 deletions
@@ -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<<453f8c0a593b173c197fcf54ed834a1b>>
* @generated SignedSource<<a9968341533b3d6347ee99ce117dc62c>>
*/
/**
@@ -270,6 +270,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun useAlwaysAvailableJSErrorHandling(): Boolean = accessor.useAlwaysAvailableJSErrorHandling()
/**
* Trust the width of a text layout we create, instead of re-deriving it from its contents
*/
@JvmStatic
public fun useAndroidTextLayoutWidthDirectly(): Boolean = accessor.useAndroidTextLayoutWidthDirectly()
/**
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
*/
@@ -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<<a51441451ec25033040ba044ee3371fc>>
* @generated SignedSource<<c0dbb15487fd85e3beff70699ce99882>>
*/
/**
@@ -60,6 +60,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
private var useAndroidTextLayoutWidthDirectlyCache: Boolean? = null
private var useFabricInteropCache: Boolean? = null
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -428,6 +429,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun useAndroidTextLayoutWidthDirectly(): Boolean {
var cached = useAndroidTextLayoutWidthDirectlyCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.useAndroidTextLayoutWidthDirectly()
useAndroidTextLayoutWidthDirectlyCache = cached
}
return cached
}
override fun useFabricInterop(): Boolean {
var cached = useFabricInteropCache
if (cached == null) {
@@ -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<<9d0b02395a08331bca956ea600602a31>>
* @generated SignedSource<<25a09b653b2094cb7b5399a44642cf0e>>
*/
/**
@@ -108,6 +108,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
@DoNotStrip @JvmStatic public external fun useAndroidTextLayoutWidthDirectly(): Boolean
@DoNotStrip @JvmStatic public external fun useFabricInterop(): Boolean
@DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -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<<cf12cdfdfb343e79247379b5549ae92a>>
* @generated SignedSource<<86773a0948ff9dd3b150678f336e6ff4>>
*/
/**
@@ -103,6 +103,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
override fun useAndroidTextLayoutWidthDirectly(): Boolean = true
override fun useFabricInterop(): Boolean = true
override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
@@ -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<<4c81ed8a06c192eb4007219d163650e5>>
* @generated SignedSource<<a6fc25aa098ac76ba77e53c5a1dfec58>>
*/
/**
@@ -64,6 +64,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
private var useAndroidTextLayoutWidthDirectlyCache: Boolean? = null
private var useFabricInteropCache: Boolean? = null
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
@@ -472,6 +473,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun useAndroidTextLayoutWidthDirectly(): Boolean {
var cached = useAndroidTextLayoutWidthDirectlyCache
if (cached == null) {
cached = currentProvider.useAndroidTextLayoutWidthDirectly()
accessedFeatureFlags.add("useAndroidTextLayoutWidthDirectly")
useAndroidTextLayoutWidthDirectlyCache = cached
}
return cached
}
override fun useFabricInterop(): Boolean {
var cached = useFabricInteropCache
if (cached == null) {
@@ -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<<2482f57e0652cfaa4806b5333c50ad9f>>
* @generated SignedSource<<d3ac43cad11c74d7f7ee12e776f99282>>
*/
/**
@@ -103,6 +103,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun useAlwaysAvailableJSErrorHandling(): Boolean
@DoNotStrip public fun useAndroidTextLayoutWidthDirectly(): Boolean
@DoNotStrip public fun useFabricInterop(): Boolean
@DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
@@ -787,6 +787,10 @@ public class TextLayoutManager {
float width,
YogaMeasureMode widthYogaMeasureMode,
int calculatedLineCount) {
if (ReactNativeFeatureFlags.useAndroidTextLayoutWidthDirectly()) {
return layout.getWidth();
}
// Instead of using `layout.getWidth()` (which may yield a significantly larger width for
// text that is wrapping), compute width using the longest line.
float calculatedWidth = 0;
@@ -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<<49dbfe02e06cc5d6b12683ed91ea1d13>>
* @generated SignedSource<<9a8d560adc9345a33b72f760f08628bd>>
*/
/**
@@ -279,6 +279,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool useAndroidTextLayoutWidthDirectly() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useAndroidTextLayoutWidthDirectly");
return method(javaProvider_);
}
bool useFabricInterop() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useFabricInterop");
@@ -525,6 +531,11 @@ bool JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling(
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
}
bool JReactNativeFeatureFlagsCxxInterop::useAndroidTextLayoutWidthDirectly(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useAndroidTextLayoutWidthDirectly();
}
bool JReactNativeFeatureFlagsCxxInterop::useFabricInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::useFabricInterop();
@@ -711,6 +722,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"useAlwaysAvailableJSErrorHandling",
JReactNativeFeatureFlagsCxxInterop::useAlwaysAvailableJSErrorHandling),
makeNativeMethod(
"useAndroidTextLayoutWidthDirectly",
JReactNativeFeatureFlagsCxxInterop::useAndroidTextLayoutWidthDirectly),
makeNativeMethod(
"useFabricInterop",
JReactNativeFeatureFlagsCxxInterop::useFabricInterop),
@@ -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<<ae23312f2dccee934a8a91c05625662a>>
* @generated SignedSource<<656fc82f692a639b7c08f289a7637507>>
*/
/**
@@ -150,6 +150,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool useAlwaysAvailableJSErrorHandling(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useAndroidTextLayoutWidthDirectly(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool useFabricInterop(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -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<<8410561a80edd67b4528181b1f8557fe>>
* @generated SignedSource<<42a15fd8d0ea1cfe23bc3f98627a9090>>
*/
/**
@@ -186,6 +186,10 @@ bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
return getAccessor().useAlwaysAvailableJSErrorHandling();
}
bool ReactNativeFeatureFlags::useAndroidTextLayoutWidthDirectly() {
return getAccessor().useAndroidTextLayoutWidthDirectly();
}
bool ReactNativeFeatureFlags::useFabricInterop() {
return getAccessor().useFabricInterop();
}
@@ -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<<8b135b02d868914f6b3487f09e8955ff>>
* @generated SignedSource<<f14956751ac132ac58fcbd2dd2f331a9>>
*/
/**
@@ -239,6 +239,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool useAlwaysAvailableJSErrorHandling();
/**
* Trust the width of a text layout we create, instead of re-deriving it from its contents
*/
RN_EXPORT static bool useAndroidTextLayoutWidthDirectly();
/**
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
*/
@@ -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<<18cf18662a540ff1bc0f151cd53bcb0d>>
* @generated SignedSource<<8004f0b9ae8b91aae15118fff947263e>>
*/
/**
@@ -749,6 +749,24 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::useAndroidTextLayoutWidthDirectly() {
auto flagValue = useAndroidTextLayoutWidthDirectly_.load();
if (!flagValue.has_value()) {
// This block is not exclusive but it is not necessary.
// If multiple threads try to initialize the feature flag, we would only
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(40, "useAndroidTextLayoutWidthDirectly");
flagValue = currentProvider_->useAndroidTextLayoutWidthDirectly();
useAndroidTextLayoutWidthDirectly_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
auto flagValue = useFabricInterop_.load();
@@ -758,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(40, "useFabricInterop");
markFlagAsAccessed(41, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -776,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(41, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(42, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -794,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(42, "useOptimizedEventBatchingOnAndroid");
markFlagAsAccessed(43, "useOptimizedEventBatchingOnAndroid");
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
useOptimizedEventBatchingOnAndroid_ = flagValue;
@@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(43, "useRawPropsJsiValue");
markFlagAsAccessed(44, "useRawPropsJsiValue");
flagValue = currentProvider_->useRawPropsJsiValue();
useRawPropsJsiValue_ = flagValue;
@@ -830,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(44, "useShadowNodeStateOnClone");
markFlagAsAccessed(45, "useShadowNodeStateOnClone");
flagValue = currentProvider_->useShadowNodeStateOnClone();
useShadowNodeStateOnClone_ = flagValue;
@@ -848,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(45, "useTurboModuleInterop");
markFlagAsAccessed(46, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
@@ -866,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(46, "useTurboModules");
markFlagAsAccessed(47, "useTurboModules");
flagValue = currentProvider_->useTurboModules();
useTurboModules_ = flagValue;
@@ -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<<2736c730fcd0b82717faa0fea527d007>>
* @generated SignedSource<<2ca537faeb7f931631200fb71f5ab78e>>
*/
/**
@@ -72,6 +72,7 @@ class ReactNativeFeatureFlagsAccessor {
bool traceTurboModulePromiseRejectionsOnAndroid();
bool updateRuntimeShadowNodeReferencesOnCommit();
bool useAlwaysAvailableJSErrorHandling();
bool useAndroidTextLayoutWidthDirectly();
bool useFabricInterop();
bool useNativeViewConfigsInBridgelessMode();
bool useOptimizedEventBatchingOnAndroid();
@@ -90,7 +91,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 47> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 48> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> animatedShouldSignalBatch_;
@@ -132,6 +133,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> traceTurboModulePromiseRejectionsOnAndroid_;
std::atomic<std::optional<bool>> updateRuntimeShadowNodeReferencesOnCommit_;
std::atomic<std::optional<bool>> useAlwaysAvailableJSErrorHandling_;
std::atomic<std::optional<bool>> useAndroidTextLayoutWidthDirectly_;
std::atomic<std::optional<bool>> useFabricInterop_;
std::atomic<std::optional<bool>> useNativeViewConfigsInBridgelessMode_;
std::atomic<std::optional<bool>> useOptimizedEventBatchingOnAndroid_;
@@ -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<<ef056e269a4ed514c18ebaed89885661>>
* @generated SignedSource<<f54c5becf4091df57e4e11d1c04698ab>>
*/
/**
@@ -187,6 +187,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool useAndroidTextLayoutWidthDirectly() override {
return true;
}
bool useFabricInterop() override {
return true;
}
@@ -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<<53e92dc49c9d5b93de14cde2fd319e92>>
* @generated SignedSource<<073265fa3290d8277fa48e6c86add604>>
*/
/**
@@ -405,6 +405,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::useAlwaysAvailableJSErrorHandling();
}
bool useAndroidTextLayoutWidthDirectly() override {
auto value = values_["useAndroidTextLayoutWidthDirectly"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::useAndroidTextLayoutWidthDirectly();
}
bool useFabricInterop() override {
auto value = values_["useFabricInterop"];
if (!value.isNull()) {
@@ -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<<7ad3c1ab9913ee5b20d0f6217580a14c>>
* @generated SignedSource<<2bfb83c7435a80068e6de925ccb66a54>>
*/
/**
@@ -65,6 +65,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool traceTurboModulePromiseRejectionsOnAndroid() = 0;
virtual bool updateRuntimeShadowNodeReferencesOnCommit() = 0;
virtual bool useAlwaysAvailableJSErrorHandling() = 0;
virtual bool useAndroidTextLayoutWidthDirectly() = 0;
virtual bool useFabricInterop() = 0;
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
@@ -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<<cf54fabb5023a846cadd14482ea80999>>
* @generated SignedSource<<7ad1233105bb6e6cd20cc8fb895b2d5c>>
*/
/**
@@ -244,6 +244,11 @@ bool NativeReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling(
return ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling();
}
bool NativeReactNativeFeatureFlags::useAndroidTextLayoutWidthDirectly(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useAndroidTextLayoutWidthDirectly();
}
bool NativeReactNativeFeatureFlags::useFabricInterop(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::useFabricInterop();
@@ -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<<4169b34b13c62ab90d7976de908b5f16>>
* @generated SignedSource<<7cc4d81e12995c1ffdf19144cb50492d>>
*/
/**
@@ -117,6 +117,8 @@ class NativeReactNativeFeatureFlags
bool useAlwaysAvailableJSErrorHandling(jsi::Runtime& runtime);
bool useAndroidTextLayoutWidthDirectly(jsi::Runtime& runtime);
bool useFabricInterop(jsi::Runtime& runtime);
bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime);
@@ -467,6 +467,16 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'none',
},
useAndroidTextLayoutWidthDirectly: {
defaultValue: true,
metadata: {
description:
'Trust the width of a text layout we create, instead of re-deriving it from its contents',
expectedReleaseValue: true,
purpose: 'release',
},
ossReleaseStage: 'stable',
},
useFabricInterop: {
defaultValue: true,
metadata: {
@@ -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<<17fa5e03fe52ed129cf731bba6e9869c>>
* @generated SignedSource<<73bd98850713966c32d122c3d3283df9>>
* @flow strict
*/
@@ -87,6 +87,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
traceTurboModulePromiseRejectionsOnAndroid: Getter<boolean>,
updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean>,
useAlwaysAvailableJSErrorHandling: Getter<boolean>,
useAndroidTextLayoutWidthDirectly: Getter<boolean>,
useFabricInterop: Getter<boolean>,
useNativeViewConfigsInBridgelessMode: Getter<boolean>,
useOptimizedEventBatchingOnAndroid: Getter<boolean>,
@@ -325,6 +326,10 @@ export const updateRuntimeShadowNodeReferencesOnCommit: Getter<boolean> = create
* In Bridgeless mode, use the always available javascript error reporting pipeline.
*/
export const useAlwaysAvailableJSErrorHandling: Getter<boolean> = createNativeFlagGetter('useAlwaysAvailableJSErrorHandling', false);
/**
* Trust the width of a text layout we create, instead of re-deriving it from its contents
*/
export const useAndroidTextLayoutWidthDirectly: Getter<boolean> = createNativeFlagGetter('useAndroidTextLayoutWidthDirectly', true);
/**
* Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.
*/
@@ -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<<4bf477efaec82ad8e9e4b1bc17705fd2>>
* @generated SignedSource<<7190cd81a60f3956bb57d647c6ff1dc1>>
* @flow strict
*/
@@ -64,6 +64,7 @@ export interface Spec extends TurboModule {
+traceTurboModulePromiseRejectionsOnAndroid?: () => boolean;
+updateRuntimeShadowNodeReferencesOnCommit?: () => boolean;
+useAlwaysAvailableJSErrorHandling?: () => boolean;
+useAndroidTextLayoutWidthDirectly?: () => boolean;
+useFabricInterop?: () => boolean;
+useNativeViewConfigsInBridgelessMode?: () => boolean;
+useOptimizedEventBatchingOnAndroid?: () => boolean;