Skip to content

Re-land: fixYogaFlexBasisFitContentInMainAxis#56064

Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D95852922
Closed

Re-land: fixYogaFlexBasisFitContentInMainAxis#56064
sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC:export-D95852922

Conversation

@sammy-SC
Copy link
Contributor

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 11, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 11, 2026

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95852922.

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
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
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
@meta-codesync meta-codesync bot closed this in ebb2fee Mar 12, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 12, 2026

This pull request has been merged in ebb2fee.

@facebook-github-tools facebook-github-tools bot added the Merged This PR has been merged. label Mar 12, 2026
@react-native-bot
Copy link
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants