From f664ee0a9d2ffcc780659009909d7293bc520f8e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 27 Apr 2023 10:18:29 -0700 Subject: [PATCH 1/2] Deprecate Java YogaConfig.setUseLegacyStretchBehaviour() Summary: Now that our own usages are removed, mark this as deprecated to encourage users to move to the errata API. The same will be done to variants of this function on other platforms before releasing, and the functions will be removed after releasing. Differential Revision: D45300343 fbshipit-source-id: 68182a4d737664eeea33f148248bdd9314d5f9c1 --- java/com/facebook/yoga/YogaConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/com/facebook/yoga/YogaConfig.java b/java/com/facebook/yoga/YogaConfig.java index 87928f02..93131359 100644 --- a/java/com/facebook/yoga/YogaConfig.java +++ b/java/com/facebook/yoga/YogaConfig.java @@ -22,7 +22,13 @@ public abstract class YogaConfig { * Yoga previously had an error where containers would take the maximum space possible instead of the minimum * like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch; * Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour. + * + * @deprecated "setUseLegacyStretchBehaviour" will be removed in the next release. Usage should be replaced with + * "setErrata(YogaErrata.ALL)" to opt out of all future breaking conformance fixes, or + * "setErrata(YogaErrata.STRETCH_FLEX_BASIS)" to opt out of the specific conformance fix previously disabled by + * "UseLegacyStretchBehaviour". */ + @Deprecated public abstract void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour); public abstract void setErrata(YogaErrata errata); -- 2.50.1.windows.1 From dae7d8e09ea2f715362b09ef4972314cb742fbf9 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 27 Apr 2023 10:19:01 -0700 Subject: [PATCH 2/2] Move YogaKit to YGErrataClassic (#1261) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1261 YogaKit integrates Yoga with UIKit as a higher level framework. It does not expose config setting to users. We set YGErrataClassic for now to prioritize compatibility instead of conformance (YogaKit is relatively used in fbsource as well). I'm also tempted to remove the usage of ExperimentalWebFlexBasis since last I heard rozelle thought it was generally broken, but I am a bit afraid to if it has been enabled so long, and is used in many cases in Meta. Reviewed By: yungsters Differential Revision: D45298803 fbshipit-source-id: f4911b5d99cbff3605de01a0b03166db042f9d98 --- YogaKit/Source/YGLayout.m | 1 + 1 file changed, 1 insertion(+) diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 1627a74f..638a81da 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -175,6 +175,7 @@ static YGConfigRef globalConfig; globalConfig = YGConfigNew(); YGConfigSetExperimentalFeatureEnabled( globalConfig, YGExperimentalFeatureWebFlexBasis, true); + YGConfigSetErrata(globalConfig, YGErrataClassic); YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale); } -- 2.50.1.windows.1