Re-land: fixYogaFlexBasisFitContentInMainAxis#56064
Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Closed
Re-land: fixYogaFlexBasisFitContentInMainAxis#56064sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Conversation
sammy-SC
added a commit
to sammy-SC/yoga
that referenced
this pull request
Mar 11, 2026
Summary: X-link: facebook/react-native#56064 Re-land of D94658492 with fixes, which was reverted in D95669495. ## Context D94658492 added the `fixYogaFlexBasisFitContentInMainAxis` flag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies a `FitContent` constraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily. The fix switches from `FitContent` to `MaxContent` for non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size. ## What went wrong D94658492 modeled the fix as a `YogaErrata` bit (`FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS`). Errata flags are bitmasks, and apps that opt into `ALL` or `CLASSIC` errata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages. ## What changed in this re-land This diff models the fix as a `YogaExperimentalFeature` (`FIX_FLEX_BASIS_FIT_CONTENT`) instead of a `YogaErrata` bit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change. This diff only wires up the RN feature flag infrastructure (flag defaults to `false`). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs. changelog: [internal] Reviewed By: javache Differential Revision: D95852922
sammy-SC
added a commit
to sammy-SC/react-native
that referenced
this pull request
Mar 11, 2026
Summary: X-link: facebook/yoga#1917 Re-land of D94658492 with fixes, which was reverted in D95669495. ## Context D94658492 added the `fixYogaFlexBasisFitContentInMainAxis` flag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies a `FitContent` constraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily. The fix switches from `FitContent` to `MaxContent` for non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size. ## What went wrong D94658492 modeled the fix as a `YogaErrata` bit (`FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS`). Errata flags are bitmasks, and apps that opt into `ALL` or `CLASSIC` errata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages. ## What changed in this re-land This diff models the fix as a `YogaExperimentalFeature` (`FIX_FLEX_BASIS_FIT_CONTENT`) instead of a `YogaErrata` bit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change. This diff only wires up the RN feature flag infrastructure (flag defaults to `false`). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs. changelog: [internal] Reviewed By: javache Differential Revision: D95852922
dc3d8ea to
f29702f
Compare
Summary: X-link: facebook/yoga#1917 Re-land of D94658492 with fixes, which was reverted in D95669495. ## Context D94658492 added the `fixYogaFlexBasisFitContentInMainAxis` flag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies a `FitContent` constraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily. The fix switches from `FitContent` to `MaxContent` for non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size. ## What went wrong D94658492 modeled the fix as a `YogaErrata` bit (`FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS`). Errata flags are bitmasks, and apps that opt into `ALL` or `CLASSIC` errata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages. ## What changed in this re-land This diff models the fix as a `YogaExperimentalFeature` (`FIX_FLEX_BASIS_FIT_CONTENT`) instead of a `YogaErrata` bit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change. This diff only wires up the RN feature flag infrastructure (flag defaults to `false`). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs. changelog: [internal] Reviewed By: javache, NickGerleman Differential Revision: D95852922
sammy-SC
added a commit
to sammy-SC/yoga
that referenced
this pull request
Mar 12, 2026
Summary: X-link: facebook/react-native#56064 Re-land of D94658492 with fixes, which was reverted in D95669495. ## Context D94658492 added the `fixYogaFlexBasisFitContentInMainAxis` flag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies a `FitContent` constraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily. The fix switches from `FitContent` to `MaxContent` for non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size. ## What went wrong D94658492 modeled the fix as a `YogaErrata` bit (`FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS`). Errata flags are bitmasks, and apps that opt into `ALL` or `CLASSIC` errata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages. ## What changed in this re-land This diff models the fix as a `YogaExperimentalFeature` (`FIX_FLEX_BASIS_FIT_CONTENT`) instead of a `YogaErrata` bit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change. This diff only wires up the RN feature flag infrastructure (flag defaults to `false`). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs. changelog: [internal] Reviewed By: javache, NickGerleman Differential Revision: D95852922
f29702f to
a594050
Compare
meta-codesync bot
pushed a commit
to facebook/yoga
that referenced
this pull request
Mar 12, 2026
Summary: X-link: facebook/react-native#56064 Pull Request resolved: #1917 Re-land of D94658492 with fixes, which was reverted in D95669495. ## Context D94658492 added the `fixYogaFlexBasisFitContentInMainAxis` flag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies a `FitContent` constraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily. The fix switches from `FitContent` to `MaxContent` for non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size. ## What went wrong D94658492 modeled the fix as a `YogaErrata` bit (`FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS`). Errata flags are bitmasks, and apps that opt into `ALL` or `CLASSIC` errata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages. ## What changed in this re-land This diff models the fix as a `YogaExperimentalFeature` (`FIX_FLEX_BASIS_FIT_CONTENT`) instead of a `YogaErrata` bit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change. This diff only wires up the RN feature flag infrastructure (flag defaults to `false`). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs. changelog: [internal] Reviewed By: javache, NickGerleman Differential Revision: D95852922 fbshipit-source-id: e2b1aa7a5d8f340011123679f721c62396b5caa5
|
This pull request has been merged in ebb2fee. |
Collaborator
|
This pull request was successfully merged by @sammy-SC in ebb2fee When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: facebook/yoga#1917
Re-land of D94658492 with fixes, which was reverted in D95669495.
Context
D94658492 added the
fixYogaFlexBasisFitContentInMainAxisflag to avoid unnecessary re-measurement cascades in Yoga. When Yoga computes flex basis for container children, the legacy behavior applies aFitContentconstraint in the main axis, bounding the child's measurement by the parent's available space. This creates a dependency between the child's flex basis and the parent's content-determined size — when one sibling changes size, all siblings get re-measured and their shadow nodes get cloned unnecessarily.The fix switches from
FitContenttoMaxContentfor non-measure container children under auto-height parents, making each child's flex basis independent of the parent's size.What went wrong
D94658492 modeled the fix as a
YogaErratabit (FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS). Errata flags are bitmasks, and apps that opt intoALLorCLASSICerrata (like IGVR and Airwave) inadvertently picked up the new behavior without explicitly enabling the feature flag, causing breakages.What changed in this re-land
This diff models the fix as a
YogaExperimentalFeature(FIX_FLEX_BASIS_FIT_CONTENT) instead of aYogaErratabit. Experimental features are individually opt-in, so existing apps won't accidentally pick up the change.This diff only wires up the RN feature flag infrastructure (flag defaults to
false). The iOS MobileConfig override and the Yoga layout logic will be landed in follow-up diffs.changelog: [internal]
Reviewed By: javache
Differential Revision: D95852922