microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.33k stars 1.14k forks source link

Upstream Yoga Measurement Patches #3994

Closed NickGerleman closed 2 weeks ago

NickGerleman commented 4 years ago

We patched Yoga to change measurement behavior with https://github.com/microsoft/react-native/pull/100. This requires us to maintain a separate copy of Yoga in react-native-windows. We should upstream our patch into facebook/react-native.

@acoates-ms was of the opinion we may want to put the change behind a preprocessor definition we would enable in RNW to avoid changing iOS/Android behavior.

woehrl01 commented 4 years ago

@NickGerleman Hi, I just stumbled over that open issue. As I heavily contributed to https://github.com/facebook/yoga a few years ago, my recommendation would be to use YGExperimentalFeature* + YGConfigSetExperimentalFeatureEnabled for that, as it doesn't require a preprocessor. We actually added that behavior exactly for those cases.

You simply extend the sequence in YGEnum.h + adding the logic around that. You could then enable that behavior only for affected (sub-)trees.

marlenecota commented 10 months ago

It looks like https://github.com/microsoft/react-native-macos/pull/100 patch was accidentally deleted in the 9/20/23 Integration (#12165). Yoga.cpp has since been deleted, so if this change is still needed, we will need to fork CalculateLayout.cpp.