Skip to content

Re-land: fixYogaFlexBasisFitContentInMainAxis#1917

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

Re-land: fixYogaFlexBasisFitContentInMainAxis#1917
sammy-SC wants to merge 1 commit into
react:mainfrom
sammy-SC:export-D95852922

Conversation

@sammy-SC

Copy link
Copy Markdown
Contributor

Summary:
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

@vercel

vercel Bot commented Mar 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yoga-website Ready Ready Preview, Comment Mar 12, 2026 4:40pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed label Mar 11, 2026
@meta-codesync

meta-codesync Bot commented Mar 11, 2026

Copy link
Copy Markdown

@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/react-native that referenced this pull request Mar 11, 2026
Summary:
X-link: react/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
sammy-SC added a commit to sammy-SC/yoga that referenced this pull request Mar 11, 2026
Summary:
X-link: react/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: react/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: react/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
sammy-SC added a commit to sammy-SC/react-native that referenced this pull request Mar 12, 2026
Summary:

X-link: react/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
@meta-codesync meta-codesync Bot closed this in dc6d185 Mar 12, 2026
@meta-codesync

meta-codesync Bot commented Mar 12, 2026

Copy link
Copy Markdown

This pull request has been merged in dc6d185.

meta-codesync Bot pushed a commit to react/react-native that referenced this pull request Mar 12, 2026
Summary:
Pull Request resolved: #56064

X-link: react/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

fbshipit-source-id: e2b1aa7a5d8f340011123679f721c62396b5caa5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant