Skip to content

Commit c35ff13

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Breaking: Remove "UseLegacyStretchBehaviour" functions (#39372)
Summary: X-link: facebook/yoga#1368 Pull Request resolved: #39372 These were marked as deprecated as part of the public Yoga 2.0 release, and were alredy emitting deprecation warnings. Remove them. Reviewed By: javache Differential Revision: D49131250 fbshipit-source-id: cc1d4e8b179697b9a11a685f4fc4e9d36e1a26a0
1 parent 8581732 commit c35ff13

File tree

6 files changed

+0
-73
lines changed

6 files changed

+0
-73
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ public abstract class YogaConfig {
1818
public abstract void setPrintTreeFlag(boolean enable);
1919

2020
public abstract void setPointScaleFactor(float pixelsInPoint);
21-
/**
22-
* Yoga previously had an error where containers would take the maximum space possible instead of the minimum
23-
* like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch;
24-
* Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.
25-
*
26-
* @deprecated "setUseLegacyStretchBehaviour" will be removed in the next release. Usage should be replaced with
27-
* "setErrata(YogaErrata.ALL)" to opt out of all future breaking conformance fixes, or
28-
* "setErrata(YogaErrata.STRETCH_FLEX_BASIS)" to opt out of the specific conformance fix previously disabled by
29-
* "UseLegacyStretchBehaviour".
30-
*/
31-
@Deprecated
32-
public abstract void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour);
3321

3422
public abstract void setErrata(YogaErrata errata);
3523

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfigJNIBase.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ public void setPointScaleFactor(float pixelsInPoint) {
4343
YogaNative.jni_YGConfigSetPointScaleFactorJNI(mNativePointer, pixelsInPoint);
4444
}
4545

46-
/**
47-
* Yoga previously had an error where containers would take the maximum space possible instead of the minimum
48-
* like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch;
49-
* Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.
50-
*/
51-
public void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour) {
52-
YogaNative.jni_YGConfigSetUseLegacyStretchBehaviourJNI(mNativePointer, useLegacyStretchBehaviour);
53-
}
54-
5546
public void setErrata(YogaErrata errata) {
5647
YogaNative.jni_YGConfigSetErrataJNI(mNativePointer, errata.intValue());
5748
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaNative.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class YogaNative {
2424
static native void jni_YGConfigSetUseWebDefaultsJNI(long nativePointer, boolean useWebDefaults);
2525
static native void jni_YGConfigSetPrintTreeFlagJNI(long nativePointer, boolean enable);
2626
static native void jni_YGConfigSetPointScaleFactorJNI(long nativePointer, float pixelsInPoint);
27-
static native void jni_YGConfigSetUseLegacyStretchBehaviourJNI(long nativePointer, boolean useLegacyStretchBehaviour);
2827
static native void jni_YGConfigSetErrataJNI(long nativePointer, int errata);
2928
static native int jni_YGConfigGetErrataJNI(long nativePointer);
3029
static native void jni_YGConfigSetLoggerJNI(long nativePointer, YogaLogger logger);

packages/react-native/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ static void jni_YGConfigSetPointScaleFactorJNI(
9393
YGConfigSetPointScaleFactor(config, pixelsInPoint);
9494
}
9595

96-
static void jni_YGConfigSetUseLegacyStretchBehaviourJNI(
97-
JNIEnv* /*env*/,
98-
jobject /*obj*/,
99-
jlong nativePointer,
100-
jboolean useLegacyStretchBehaviour) {
101-
const YGConfigRef config = _jlong2YGConfigRef(nativePointer);
102-
#pragma clang diagnostic push
103-
#pragma clang diagnostic ignored "-Wdeprecated"
104-
YGConfigSetUseLegacyStretchBehaviour(config, useLegacyStretchBehaviour);
105-
#pragma clang diagnostic pop
106-
}
107-
10896
static void jni_YGConfigSetErrataJNI(
10997
JNIEnv* /*env*/,
11098
jobject /*obj*/,
@@ -790,9 +778,6 @@ static JNINativeMethod methods[] = {
790778
{"jni_YGConfigSetPointScaleFactorJNI",
791779
"(JF)V",
792780
(void*) jni_YGConfigSetPointScaleFactorJNI},
793-
{"jni_YGConfigSetUseLegacyStretchBehaviourJNI",
794-
"(JZ)V",
795-
(void*) jni_YGConfigSetUseLegacyStretchBehaviourJNI},
796781
{"jni_YGConfigSetErrataJNI", "(JI)V", (void*) jni_YGConfigSetErrataJNI},
797782
{"jni_YGConfigGetErrataJNI", "(J)I", (void*) jni_YGConfigGetErrataJNI},
798783
{"jni_YGConfigSetLoggerJNI",

packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,21 +1017,6 @@ YOGA_EXPORT void YGConfigSetUseWebDefaults(
10171017
resolveRef(config)->setUseWebDefaults(enabled);
10181018
}
10191019

1020-
YOGA_EXPORT bool YGConfigGetUseLegacyStretchBehaviour(
1021-
const YGConfigConstRef config) {
1022-
return resolveRef(config)->hasErrata(YGErrataStretchFlexBasis);
1023-
}
1024-
1025-
YOGA_EXPORT void YGConfigSetUseLegacyStretchBehaviour(
1026-
const YGConfigRef config,
1027-
const bool useLegacyStretchBehaviour) {
1028-
if (useLegacyStretchBehaviour) {
1029-
resolveRef(config)->addErrata(YGErrataStretchFlexBasis);
1030-
} else {
1031-
resolveRef(config)->removeErrata(YGErrataStretchFlexBasis);
1032-
}
1033-
}
1034-
10351020
bool YGConfigGetUseWebDefaults(const YGConfigConstRef config) {
10361021
return resolveRef(config)->useWebDefaults();
10371022
}

packages/react-native/ReactCommon/yoga/yoga/Yoga.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -306,27 +306,6 @@ WIN_EXPORT void YGConfigSetPointScaleFactor(
306306
float pixelsInPoint);
307307
WIN_EXPORT float YGConfigGetPointScaleFactor(YGConfigConstRef config);
308308

309-
// Yoga previously had an error where containers would take the maximum space
310-
// possible instead of the minimum like they are supposed to. In practice this
311-
// resulted in implicit behaviour similar to align-self: stretch; Because this
312-
// was such a long-standing bug we must allow legacy users to switch back to
313-
// this behaviour.
314-
WIN_EXPORT YG_DEPRECATED(
315-
"Please use "
316-
"\"YGConfigGetErrata()\"") bool YGConfigGetUseLegacyStretchBehaviour(YGConfigConstRef
317-
config);
318-
WIN_EXPORT
319-
YG_DEPRECATED(
320-
"\"YGConfigSetUseLegacyStretchBehaviour\" will be removed in the next "
321-
"release. Usage should be replaced with \"YGConfigSetErrata(YGErrataAll)\" "
322-
"to opt out of all future breaking conformance fixes, or "
323-
"\"YGConfigSetErrata(YGErrataStretchFlexBasis)\" to opt out of the "
324-
"specific conformance fix previously disabled by "
325-
"\"UseLegacyStretchBehaviour\".")
326-
void YGConfigSetUseLegacyStretchBehaviour(
327-
YGConfigRef config,
328-
bool useLegacyStretchBehaviour);
329-
330309
// YGConfig
331310
WIN_EXPORT YGConfigRef YGConfigNew(void);
332311
WIN_EXPORT void YGConfigFree(YGConfigRef config);

0 commit comments

Comments
 (0)