Skip to content
Open
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: 2 additions & 0 deletions packages/react-native/React/Views/RCTLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ CGFloat RCTCoreGraphicsFloatFromYogaValue(YGValue value, CGFloat baseFloatValue)
case YGUnitFitContent:
case YGUnitStretch:
return baseFloatValue;
case YGUnitDynamic:
return RCTCoreGraphicsFloatFromYogaFloat(YGUndefined);
}
}

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<<8b571241be0c86847ed265ab665059b2>>
* @generated SignedSource<<3a917b13b408c071a21b2b91e1f9fbb6>>
*/

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

/**
* Enables CSS calc() support for layout (Yoga) style props in Fabric.
*/
@JvmStatic
public fun enableCSSCalc(): Boolean = accessor.enableCSSCalc()

/**
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
*/
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<<856ed167e90b330583c3a6e981927c43>>
* @generated SignedSource<<20981eeda0169d86c09b1568a106827a>>
*/

/**
Expand Down Expand Up @@ -35,6 +35,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableAndroidFontWeightAdjustmentCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCSSCalcCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
Expand Down Expand Up @@ -241,6 +242,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}

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

override fun enableCppPropsIteratorSetter(): Boolean {
var cached = enableCppPropsIteratorSetterCache
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<<2f68282c0b8c1971acdab2f229189d82>>
* @generated SignedSource<<32561f31188d5b47f5bdfe690ab198de>>
*/

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

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

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

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

@DoNotStrip @JvmStatic public external fun enableCustomFocusSearchOnClippedElementsAndroid(): 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<<5f946970ba2e0676b55cc150de4bee01>>
* @generated SignedSource<<bb19895ff858bd547dabb3e0500b4f5b>>
*/

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

override fun enableBridgelessArchitecture(): Boolean = false

override fun enableCSSCalc(): Boolean = false

override fun enableCppPropsIteratorSetter(): Boolean = false

override fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean = true
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<<c7adeebaabd6c647865bb5398b823221>>
* @generated SignedSource<<08aa94f7767a9e3947d88814f7ae0edd>>
*/

/**
Expand Down Expand Up @@ -39,6 +39,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableAndroidFontWeightAdjustmentCache: Boolean? = null
private var enableAndroidTextMeasurementOptimizationsCache: Boolean? = null
private var enableBridgelessArchitectureCache: Boolean? = null
private var enableCSSCalcCache: Boolean? = null
private var enableCppPropsIteratorSetterCache: Boolean? = null
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
Expand Down Expand Up @@ -260,6 +261,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}

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

override fun enableCppPropsIteratorSetter(): Boolean {
var cached = enableCppPropsIteratorSetterCache
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<<c4f37ab0fc935a27bae3b92e86abc243>>
* @generated SignedSource<<1abf44b0b995cb213390879036fc3ce7>>
*/

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

@DoNotStrip public fun enableBridgelessArchitecture(): Boolean

@DoNotStrip public fun enableCSSCalc(): Boolean

@DoNotStrip public fun enableCppPropsIteratorSetter(): Boolean

@DoNotStrip public fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public enum class YogaUnit(public val intValue: Int) {
AUTO(3),
MAX_CONTENT(4),
FIT_CONTENT(5),
STRETCH(6);
STRETCH(6),
DYNAMIC(7);

public fun intValue(): Int = intValue

Expand All @@ -31,6 +32,7 @@ public enum class YogaUnit(public val intValue: Int) {
4 -> MAX_CONTENT
5 -> FIT_CONTENT
6 -> STRETCH
7 -> DYNAMIC
else -> throw IllegalArgumentException("Unknown enum value: $value")
}
}
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<<6719e639a89507a2019fcf1901394152>>
* @generated SignedSource<<455b05f4803f2289d542ef0debaea35b>>
*/

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

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

bool enableCppPropsIteratorSetter() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableCppPropsIteratorSetter");
Expand Down Expand Up @@ -628,6 +634,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture(
return ReactNativeFeatureFlags::enableBridgelessArchitecture();
}

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

bool JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableCppPropsIteratorSetter();
Expand Down Expand Up @@ -1054,6 +1065,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableBridgelessArchitecture",
JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture),
makeNativeMethod(
"enableCSSCalc",
JReactNativeFeatureFlagsCxxInterop::enableCSSCalc),
makeNativeMethod(
"enableCppPropsIteratorSetter",
JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter),
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<<ea2573be7bc2e1444cd9d157ac282f16>>
* @generated SignedSource<<9ca21b0fd2218455c4b694ff9159eda1>>
*/

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

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

static bool enableCppPropsIteratorSetter(
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<<929bf9431ec07ddc39040cfff5b94754>>
* @generated SignedSource<<227025369a508a375cbcb9a9fd7a9acd>>
*/

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

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

bool ReactNativeFeatureFlags::enableCppPropsIteratorSetter() {
return getAccessor().enableCppPropsIteratorSetter();
}
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<<d7532c66f74b2f5e3b1dcd259089f6cd>>
* @generated SignedSource<<204b892e9a4d38942c286fe8a4e3bb88>>
*/

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

/**
* Enables CSS calc() support for layout (Yoga) style props in Fabric.
*/
RN_EXPORT static bool enableCSSCalc();

/**
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
*/
Expand Down
Loading