Commit Graph

2610 Commits

Author SHA1 Message Date
Mateo Guzmán
c90aecbdfe Migrate LayoutPassReason to Kotlin (#1836)
Summary:
Migrate com.facebook.yoga.LayoutPassReason to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1836

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: rshest

Differential Revision: D79897685

Pulled By: cortinico

fbshipit-source-id: 87d2e4b95fbdbfe48d84019e9ffb50deb9286d8c
2025-08-12 09:10:30 -07:00
Mateo Guzmán
c54215fd77 Migrate YogaNodeFactory to Kotlin (#1832)
Summary:
Migrate com.facebook.yoga.YogaNodeFactory to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1832

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: zielinskimz

Differential Revision: D79897733

Pulled By: cortinico

fbshipit-source-id: 3ea4f5635eb8c910719c13d3087356b96b6f0746
2025-08-12 08:57:43 -07:00
Mateo Guzmán
cf50bc9adf Migrate YogaMeasureOutput to Kotlin (#1842)
Summary:
Migrate com.facebook.yoga.YogaMeasureOutput to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1842

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: rshest

Differential Revision: D79897681

Pulled By: cortinico

fbshipit-source-id: 63280b6aed9bbeeb1e71458a1793c9647dcf0726
2025-08-12 07:55:41 -07:00
Mateo Guzmán
d1037226c0 Migrate YogaMeasureFunction to Kotlin (#1835)
Summary:
Migrate com.facebook.yoga.YogaMeasureFunction to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1835

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: mdvacca

Differential Revision: D79897728

Pulled By: cortinico

fbshipit-source-id: 959ae976622838147685cf6088674dce25f5cc99
2025-08-12 07:40:31 -07:00
Mateo Guzmán
714d4b2ebe Migrate YogaStyleInputs to Kotlin (#1830)
Summary:
Migrate com.facebook.yoga.YogaStyleInputs to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1830

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: rshest

Differential Revision: D79897662

Pulled By: cortinico

fbshipit-source-id: a4063a8c0f608050162cd3707834040e35f9ebf7
2025-08-12 03:34:21 -07:00
Mateo Guzmán
d4b5220e6c Migrate YogaBaselineFunction to Kotlin (#1831)
Summary:
Migrate com.facebook.yoga.YogaBaselineFunction to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1831

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: joevilches, mdvacca

Differential Revision: D79897676

Pulled By: cortinico

fbshipit-source-id: 2f175bf60a871c4635d1575faec1096f9c970f48
2025-08-11 10:51:55 -07:00
Mateo Guzmán
da5ba7f7c6 Migrate YogaLogger to Kotlin (#1834)
Summary:
Migrate com.facebook.yoga.YogaLogger to Kotlin.

Pull Request resolved: https://github.com/facebook/yoga/pull/1834

Test Plan:
RN
```sh
yarn android
yarn test-android
```

Yoga
```sh
./gradlew :yoga:assembleDebug
```

Reviewed By: rshest

Differential Revision: D79897742

Pulled By: cortinico

fbshipit-source-id: 79b926a7abadce9038fc55ad0f608e92bc77a55a
2025-08-11 08:47:34 -07:00
Mateo Guzmán
8bf7a34d02 Initial Kotlin setup and migrate YogaConstants (#1829)
Summary:
X-link: https://github.com/facebook/react-native/pull/53133

# Changelog:
[Internal] -

As part of the ongoing effort to migrate the React Native codebase to Kotlin, this PR introduces the initial setup required for Kotlin support in Yoga.

- Added initial basic Kotlin configuration to the project.
- Migrated `YogaConstants` as an initial file to try out the first migration steps.

Pull Request resolved: https://github.com/facebook/yoga/pull/1829

Test Plan:
- Tested the migrated class directly against facebook/react-native, see the PR [here](https://github.com/facebook/react-native/pull/52998).
- Run: `./gradlew :yoga:assembleDebug` & `./gradlew :yoga:compileDebugSources`

I am not able to run the Java tests in this repo (even before the initial Kotlin setup) – not sure if I am missing something there but any pointers are welcome – it seems like there is some missing configuration. Currently trying with `./gradlew :yoga:test`

Reviewed By: cortinico

Differential Revision: D79545992

Pulled By: rshest

fbshipit-source-id: 8257ff53e6b6f2436980be98b6c94e1ac526b207
2025-08-07 08:17:56 -07:00
Dmitry Polukhin
82671c0132 Disable modernize-avoid-c-arrays in xplat/yoga/tests
Reviewed By: JuanBesa, rshest

Differential Revision: D79247609

fbshipit-source-id: 529ba950ab200c46493152b81dece6bd76f6fdbd
2025-07-30 03:39:00 -07:00
Alexey Medvedev
9f2a9476e5 Make yoga/Yoga.h an umbrell header (#1828)
Summary:
X-link: https://github.com/facebook/react-native/pull/52817

Pull Request resolved: https://github.com/facebook/yoga/pull/1828

X-link: https://github.com/facebook/litho/pull/1070

This diff makes the Yoga/Yoga.h header an umbrella header, which means that it includes all of Yoga's public headers. The code changes in each file include adding the IWYU pragma export to each header file, which is a way to tell the compiler to export the header file's symbols to other files that include it. This is necessary for the header file to be used as an umbrella header.

Changelog:
[General][Added] - Code quality fixes

Reviewed By: corporateshark

Differential Revision: D78692457

fbshipit-source-id: 7fcd53d2a6f268fa4377dbd5bd6ba6eebc94b5f8
2025-07-24 16:51:13 -07:00
Jakub Piasecki
c7c85621fc Fix display: contents nodes not being cloned with the wrong owner (#1826)
Summary:
X-link: https://github.com/facebook/react-native/pull/52530

This PR fixes two issues with `display: contents` implementation:
1. When a node with `display: contents` set is a leaf, it won't be cloned after the initial tree is built. The added test case covers this scenario.
2. It was possible for the subtree of `display: contents` nodes not to be cloned during layout. I don't have a minimal reproduction for this one, unfortunately. It was discovered in the Expensify app: https://github.com/Expensify/App/issues/65268, along with a consistent reproduction. In that specific case, it seems to be heavily tied to `react-native-onyx`, which is a state management library.

Changelog: [GENERAL][FIXED] - Fixed nodes with `display: contents` set being cloned with the wrong owner

Pull Request resolved: https://github.com/facebook/yoga/pull/1826

Reviewed By: adityasharat, NickGerleman

Differential Revision: D78084270

Pulled By: j-piasecki

fbshipit-source-id: eb81f6d7dcd1665974d07261ba693e2abea239bb
2025-07-11 02:16:35 -07:00
Nolan O'Brien
73980a3cf8 Fix exhaustive switches
Summary:
X-link: https://github.com/facebook/react-native/pull/52379

Changelog: [General][Fixed] - Add `default:` case to avoid warnings/errors for targets that compile with `-Wswitch-enum` and `-Wswitch-default` enabled

Reviewed By: aary, yungsters, astreet

Differential Revision: D77051152

fbshipit-source-id: 100b10f97cb3a5d73f1e3dcaf1b284baf6a43982
2025-07-02 14:21:18 -07:00
Nick Gerleman
4b5ca50117 Reland Fix possible invalid measurements when width or height is zero pixels (#1823)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1823

X-link: https://github.com/facebook/react-native/pull/52348

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76851589

fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f
2025-06-30 20:46:39 -07:00
FBLite Revert Bot
30291398f3 Revert D76793705: Fix possible invalid measurements when width or height is zero pixels
Differential Revision:
D76793705

Original commit changeset: ea4c00e68891

Original Phabricator Diff: D76793705

fbshipit-source-id: 95d6b66ab08e073da9fb07fd4094a7e30e2f453b
2025-06-17 14:33:32 -07:00
Nick Gerleman
27d632c697 Fix possible invalid measurements when width or height is zero pixels (#1820)
Summary:
X-link: https://github.com/facebook/react-native/pull/52073

Pull Request resolved: https://github.com/facebook/yoga/pull/1820

Fixes https://github.com/facebook/yoga/issues/1819

Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.

This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.

We can fix this, by only allowing if both axis are this fixed case, instead of just one.

This bug has existed for about a decade (going back to at least D3312496).

Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels

Reviewed By: yungsters

Differential Revision: D76793705

fbshipit-source-id: ea4c00e688912a58c08801e4a14ddf1b293a5d86
2025-06-17 12:15:55 -07:00
Nicola Corti
117fa494f7 Migrate from OSSRH to Central Portal (#1816)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1816

This migrates Yoga to publish to Central Portal rather than OSSRC

Reviewed By: NickGerleman

Differential Revision: D76436235

fbshipit-source-id: ddaaa95472054aa2b09399b5cc8d821dae51234f
2025-06-11 16:12:06 -07:00
Nicola Corti
073c136117 Remove unnecessary gradle-enterprise.gradle.kts from Yoga (#1817)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1817

This file is not really necessary. As we don't have a Gradle Enterprise instance anymore, let's just remove it and inline it.

Reviewed By: mdvacca

Differential Revision: D76436236

fbshipit-source-id: 27fcc48574905415b147f67dd4a8f57dffbeda3e
2025-06-11 11:46:34 -07:00
Nick Gerleman
1232761571 YGPersistentNodeCloningTest (#1813)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1813

This adds a unit test to Yoga, which emulates the model of "persistent Yoga nodes" and cloning used by React Fabric, including the private (but relied on) Yoga APIs.

It models the over-invalidation exposed in D75287261, which reproduces (due to Yoga incorrectly measuring flex-basis under fit-content, and that constraint changing when sibling changes) but this test for now sets a definite height on A, to show that we only clone what is neccesary, when measure constraints do not have to change.

Having a minimal version of Fabric's model in Yoga unit tests should make some of these interesting interactions a bit easier to debug.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D75572762

fbshipit-source-id: cda8b3fdd6e538a55dd100494518688c864bd233
2025-06-02 19:32:45 -07:00
Nick Gerleman
c935fd5e10 Resubmit: Expose Unsnapped Dimensions (#1811)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1811

X-link: https://github.com/facebook/react-native/pull/51298

## Resubmit

This was backed out due to being up the stack from another change that was backed out, but should be safe by itself.

## Original

We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons.

We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts.

This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug).

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D74673119

fbshipit-source-id: 06d2eb21e28b76458ec88f4dfcaec809707d0390
2025-05-13 18:21:04 -07:00
Yannick Loriot
624325302c Revert D74292949: Expose Unsnapped Dimensions
Differential Revision:
D74292949

Original commit changeset: 05011c66a9a9

Original Phabricator Diff: D74292949

fbshipit-source-id: c6ca51c7b882950d54b6a43e206973774db40429
2025-05-09 01:45:16 -07:00
Nick Gerleman
37a94a86de Expose Unsnapped Dimensions (#1809)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1809

X-link: https://github.com/facebook/react-native/pull/51181

We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons.

We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts.

This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74292949

fbshipit-source-id: 05011c66a9a9480544313eb1dfe2c46bf7742bac
2025-05-08 17:45:16 -07:00
Santhosh Kumar
4abc1a7d5f Fix documentation of 'alignContent' property configured with spaces (#1808)
Summary:
The documentation shall be corrected to specify in which axis the spaces are distributed when flex container is configured 'alignContent' property.

Pull Request resolved: https://github.com/facebook/yoga/pull/1808

Reviewed By: joevilches

Differential Revision: D74347272

Pulled By: philIip

fbshipit-source-id: 1b05840028bca774c9d4a68562bcf537d5a72500
2025-05-07 14:40:02 -07:00
Yurii Nakonechnyi
51e6095005 LayoutData - added explicit default fields values initialization (#1802)
Summary:
X-link: https://github.com/facebook/react-native/pull/50227

Explicit defaults add 'strictness' and take the guesswork out of what's going on in places like this:

6455a848a7/yoga/algorithm/CalculateLayout.cpp (L2345)

Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/yoga/pull/1802

Reviewed By: javache

Differential Revision: D71687310

Pulled By: NickGerleman

fbshipit-source-id: f11d18aa68ce7ccd17fb1d5af0e729e8c0711cf9
2025-03-24 12:23:46 -07:00
Yurii Nakonechnyi
79cef614ce fatalWithMessage() - added warning suppression: unused 'message' argument (#1803)
Summary:
X-link: https://github.com/facebook/react-native/pull/50148

## Changelog:

[Internal] - suppression: unused 'message' argument

Pull Request resolved: https://github.com/facebook/yoga/pull/1803

Reviewed By: NickGerleman

Differential Revision: D71492528

Pulled By: lunaleaps

fbshipit-source-id: 6fc7a665066351d15e09f0b6c82ed1fe3f688a94
2025-03-19 19:06:50 -07:00
Rob Hogan
6455a848a7 Update GHA actions/upload-artifact to v4, unbreak CI (#1799)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1799

Pull Request resolved: https://github.com/facebook/yoga/pull/1800

`actions/upload-artifact@v3` is deprecated and will no longer execute, causing CI to fail - eg:

https://github.com/facebook/yoga/actions/runs/13789185831/job/38564343959

See https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ for context

Reviewed By: NickGerleman

Differential Revision: D70986391

fbshipit-source-id: 66cec50bb485e89c0948c752ba7dc2a4f42617d6
2025-03-11 13:40:51 -07:00
Nicola Corti
1b7d2c8d48 Enable RTTI to fix exception pointer issue on React Native (#1791)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1791

Disabling RTTI for Yoga is causing std::exception to don't work properly in OSS.
Fixes: https://github.com/facebook/react-native/issues/48027

Not sure why we originally disabled RTTI for Yoga, but we have it enable for the whole
React Native build so it probably makes sense to have it enabled for Yoga as well.

Changelog:
[Internal] [Changed] - Enable RTTI to fix exception pointer issue on React Native

bypass-github-export-checks

Reviewed By: javache, NickGerleman

Differential Revision: D70386744

fbshipit-source-id: 36e3a1ddb38346d31979d5c1b77d6e9796d6a855
2025-03-04 04:51:38 -08:00
Nicola Corti
3aa594c1f9 Gradle to 8.13 (#1790)
Summary:
X-link: https://github.com/facebook/react-native/pull/49689

Pull Request resolved: https://github.com/facebook/yoga/pull/1790

X-link: https://github.com/facebook/react-native/pull/49703

I'm bumping Gradle to the latest minor.
https://docs.gradle.org/8.13/release-notes.html

I'm also changing the distribution from `all` to `bin` as
this reduces the download time of the distribution.

Changelog:
[Android] [Changed] - Gradle to 8.13

Reviewed By: NickGerleman

Differential Revision: D70239710

fbshipit-source-id: 89808242a93344f540bfe82f4178cf6db72597d1
2025-02-27 03:13:26 -08:00
Mihaela Ogrezeanu
c2ae39167e Update yoga aar targets (#1786)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1786

Follow up on comments from D68152410

- Removes minsdk version from manifest
- Update to MIT licence
- Rename targets that don't export existing libs

I've looked into using yoga_java_library and adding a param to pass what libs to exclude, but ultimately provided_deps does what we need and it simpler to maintain; we still need to add the different targets because the aar needs to depend on :jni-server and not :jni.

Reviewed By: NickGerleman

Differential Revision: D69455682

fbshipit-source-id: aa08bc030495d13da9545ec368ab63a7a946dad0
2025-02-12 02:28:59 -08:00
Mihaela Ogrezeanu
49ee855f99 Add aar BUCK targets to export Litho libraries as aars (#1782)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1782

This adds fb_native.android_aar targets for resources that are needed by Litho at runtime and cannot be exported as jars.
- resource modules referenced by Litho
- Yoga library. Some dependencies required by Yoga neded to be added as "provided_deps" so they don't get exported with the aar

Reviewed By: astreet

Differential Revision: D68152410

fbshipit-source-id: 7dc2ffa0b60a4ca160a011d16d2dc5ab91f608a6
2025-01-24 07:57:56 -08:00
Nick Gerleman
b12e0a2a15 Fix CI after GHA Update to Ubuntu 24.04 (#1781)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1781

This new image removed preinstalled libc++, and the ability to install old version of Clang Format we were installing.

This manually installs libc++ when setting up Clang jobs, and fully removes the clang-format validation job, since it wasn't correctly running before, and it's probably more a pain to ask people to run this than to just run Arcanist when importing a change.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68455129

fbshipit-source-id: b5767be832b2b5d46db7e60e18b66823819ba15a
2025-01-21 13:34:22 -08:00
Ruslan Shestopalyuk
9591210a7a Add more unit tests for rounding values to pixel grid (#1776)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1776

# Changelog:
[Internal] -

I was looking into some profiling results and noticed that Yoga has some quirky custom logic when it comes to rounding to the pixel grid, especially for the values that are halfway through.

There are already unit tests in place, but those cases weren't covered, so I am adding these extra corner cases here, to make sure they are covered in case that the actual rounding function may get modified (which it might make sense to, as it's currently can be more expensive than it could have been in some scenarios).

Reviewed By: christophpurrer

Differential Revision: D67712673

fbshipit-source-id: da1b7339a8939ced8d91f15441bc7d1f8af768c8
2024-12-30 12:38:48 -08:00
Ruslan Shestopalyuk
91997d6cd3 Avoid calling fmod twice in roundLayoutResultsToPixelGrid (#1775)
Summary:
X-link: https://github.com/facebook/litho/pull/1036

Pull Request resolved: https://github.com/facebook/yoga/pull/1775

X-link: https://github.com/facebook/react-native/pull/48404

## Changelog:
[Internal] -

This popped up when profiling some heavy UI performance, calling `fmod` operation in Yoga's `roundLayoutResultsToPixelGrid` in `PixelGrid.cpp` can be expensive, furthermore it turns out that some of the calls were redundant.

This replaces the duplicate calls to fmod with an equivalent single round operation, which for e.g. clang compiler on Windows brings the code in question from ~50 instructions (including 4 call instructions to the fmod function) down to ~30 instructions (without any external calls), and the layout operation being **~1% more efficient** for the particular benchmark I was looking into.

Reviewed By: christophpurrer

Differential Revision: D67689065

fbshipit-source-id: 2a074a1cb81bd7f7a3c414050b9ddda2ba90180f
2024-12-30 12:38:48 -08:00
Joe Vilches
909e4bea6e Fix test util to measure text properly based on flex direction (#1768)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1768

Depending on the flex direction text will either be capped to the measured size or to the longest word, so I added that functionality

Reviewed By: mlord93

Differential Revision: D67106199

fbshipit-source-id: 0b4691768809004043a847f3fc5f7b94e92f1575
2024-12-12 11:11:49 -08:00
Nicola Corti
13f4adbbcd Add 16K support for standalone Yoga (#1766)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1766

While we added support for 16K pages for yoga through React Native,
the standalone version we upload to Maven Central wasn't handled.
This fixes it.

Reviewed By: NickGerleman

Differential Revision: D66975933

fbshipit-source-id: 36a8404e2f2a60a44b9a39e478b23d1829bc542e
2024-12-10 09:34:38 -08:00
heoblitz
ae2d06d0f5 Update YGNodeStyleGetGap to return YGValue (#1753)
Summary:
X-link: https://github.com/facebook/react-native/pull/47973

Gap can be styled using both `points` and `percentages`, but YGNodeStyleGetGap currently returns a float value.

To maintain alignment with the `padding` and `margin` functionalities and allow it to be handled in bridging code, this function has been updated to return YGValue.

Pull Request resolved: https://github.com/facebook/yoga/pull/1753

Reviewed By: joevilches

Differential Revision: D66513236

Pulled By: NickGerleman

fbshipit-source-id: b7110855c037f20780f031f22a945bde4446687d
2024-12-09 13:38:05 -08:00
Joe Vilches
5478812db3 Use crossAxisOwnerSize instead of ownerHeight in cross axis bound call (#1763)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1763

X-link: https://github.com/facebook/react-native/pull/48080

Small bug that I noticed while doing intrinsic sizing. We have the ownerHeight as the axis size despite bounding the length of the cross axis. This should therefore be the crossAxisOwnerSize, which might be the width in some cases

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66736539

fbshipit-source-id: 528fc438b3327cd6f7890ea0ba408e4ce7b0f02c
2024-12-06 15:34:06 -08:00
Joe Vilches
050ac8a413 Properly camelcase mainAxisownerSize in FlexLine (#1762)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1762

X-link: https://github.com/facebook/react-native/pull/48077

OCD strikes again. Grepped this time to make sure we didn't miss any cases for this specific param name

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66715777

fbshipit-source-id: 3e881a15b3b2836a4a55b11d7ec621541b92a05d
2024-12-03 19:16:56 -08:00
Nick Gerleman
733ba24064 Add Yoga 3.2 Release notes (#1761)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1761

Whips up some release notes for what is new since Yoga 3.1.

https://github.com/facebook/yoga/compare/v3.1.0...v3.2.0

The relevant packages have already been published.

Reviewed By: joevilches

Differential Revision: D66679637

fbshipit-source-id: dd94e2a52f2bdc80541c331d1fb39de82669cc7a
2024-12-02 17:39:41 -08:00
Joe Vilches
e177477144 Add text based intrinsic sizing tests (#1759)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1759

We just have block based tests right now. Intrinsic sizing is commonly used with text so lets add a few there.

Reviewed By: NickGerleman

Differential Revision: D66662940

fbshipit-source-id: f8b91419c89d22d79a91d3bd8c7da70429c827fb
2024-12-02 17:29:49 -08:00
Joe Vilches
76ffdbc25d Back out "Back out "[yoga][gentest][intrinsic sizing] Gentest and initial tests for intrinsic sizing"" (#1758)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1758

Original commit changeset: 52d6cc754cb9

Original Phabricator Diff: D66332308

Reviewed By: NickGerleman

Differential Revision: D66662663

fbshipit-source-id: fb3a0d10ec0f0149aeee510148f26ada8eff7e47
2024-12-02 17:29:49 -08:00
Joe Vilches
f99e657acd Back out "Back out "[yoga][intrinsic sizing] Update public API for intrinsic sizing setters""
Summary:
Original commit changeset: 793f77dad021

Original Phabricator Diff: D66332309

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66662661

fbshipit-source-id: 22ed3ac9492f0a563c041ce4cb5fba4b65b53211
2024-12-02 17:29:49 -08:00
Joe Vilches
a9246bc7db Back out "Back out "[yoga][intrinsic sizing] Modify private apis to set, store, and get intrinsic sizing keywords"" (#1756)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1756

X-link: https://github.com/facebook/react-native/pull/48049

Changelog: [Internal]

Original commit changeset: 1d596964e0c8

Original Phabricator Diff: D66332307

Reviewed By: NickGerleman

Differential Revision: D66662662

fbshipit-source-id: 4f9ac2b1557b848f519dcd728d7097b52f1190b3
2024-12-02 17:29:49 -08:00
Joe Vilches
be72b8e8aa Align order of params between calculateLayoutInternal and calculateLayoutImpl (#1755)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1755

X-link: https://github.com/facebook/react-native/pull/47975

I've been working with callsites here and its annoying if you switch these that you need to move these params around too. Let's just make them the same order

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66519836

fbshipit-source-id: 2e98e671270a053c6e62372e2003f1ca67774ec9
2024-11-26 22:48:24 -08:00
Joe Vilches
b876f596d9 Camel case LengthValue in Node.cpp (#1754)
Summary:
X-link: https://github.com/facebook/react-native/pull/47971

Pull Request resolved: https://github.com/facebook/yoga/pull/1754

This was annoying me

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66510734

fbshipit-source-id: d1b952f2e82e7018b16dc0c572d9b98aec18c0e5
2024-11-26 15:23:08 -08:00
Joe Vilches
be00354b71 Back out "Modify private apis to set, store, and get intrinsic sizing keywords" (#1750)
Summary:
X-link: https://github.com/facebook/react-native/pull/47895

Pull Request resolved: https://github.com/facebook/yoga/pull/1750

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332307

fbshipit-source-id: 1d596964e0c893091c541988506e8b80fa6d1957
2024-11-25 00:40:03 -08:00
Joe Vilches
0c995496c8 Back out "Update public API for intrinsic sizing setters" (#1752)
Summary:
X-link: https://github.com/facebook/react-native/pull/47896

Pull Request resolved: https://github.com/facebook/yoga/pull/1752

These APIs were only added so that we could do TDD as we work on intrinsic sizing functionality. As of right now they do nothing. We are aiming on publishing a new version of Yoga soon so for the time being we are going to back these out so as not to confuse anyone with this new functionality. Ideally we get to a point where we have some temporary experimental header to stage these in but this is a bit time sensitive so just backing out for now

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D66332309

fbshipit-source-id: 793f77dad021fa5e57b52c36ae954307636bcbf0
2024-11-25 00:40:03 -08:00
Joe Vilches
c12e732fab Back out "Gentest and initial tests for intrinsic sizing" (#1751)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1751

Original commit changeset: 1e3e7214fab0

Original Phabricator Diff: D64145117

Reviewed By: NickGerleman

Differential Revision: D66332308

fbshipit-source-id: 52d6cc754cb931e851e444bac2c946907a098235
2024-11-25 00:40:03 -08:00
Eric Rozell
0b25796676 Update docusaurus to 3.6.0 (#1749)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1749

Resolves a few NPM security vulnerabilities in webpack and cookie dependencies.

Reviewed By: NickGerleman

Differential Revision: D66299077

fbshipit-source-id: 805eff24486ab120bc5658c0c5d0de1e4db81ba0
2024-11-21 11:09:17 -08:00
Jakub Piasecki
262f868ce0 Fix the nodes' owners not being updated when display: contents is used (#1743)
Summary:
X-link: https://github.com/facebook/react-native/pull/47733

In https://github.com/facebook/yoga/pull/1729 I moved the cleanup of `display: contents` nodes to happen before all the early returns, but that change also made it be called **before** `cloneChildrenIfNeeded`. It actually needs to be called after `cloneChildrenIfNeeded` to make sure that children of `display: contents` nodes are properly owned.

It also needs to be called in every short-path, so it's being called in four places in this PR. Please let me know whether it's ok or not.

Pull Request resolved: https://github.com/facebook/yoga/pull/1743

Reviewed By: NickGerleman

Differential Revision: D65953902

Pulled By: zeyap

fbshipit-source-id: 0b18a5651f19c23564f5b3aa2a50833426e9ca5f
2024-11-20 20:01:50 -08:00
phuccvx12
77c9987012 Fix: Correct Layout Behavior for Combined align-content and align-items (#1742)
Summary:
X-link: https://github.com/facebook/react-native/pull/47732

This pull request addresses the issue where combining align-content and align-items properties resulted in incorrect layout behavior in Yoga version 3.1.0, as reported in [Issue https://github.com/facebook/yoga/issues/1739](https://github.com/facebook/yoga/issues/1739).

# Changes Made:

Alignment Logic Update: Modified the alignment calculations to ensure that the combination of align-content and align-items properties produces the expected layout, consistent with CSS Flexbox standards and previous Yoga versions.

Test Cases Added: Introduced new test cases to cover scenarios involving various combinations of align-content and align-items properties to prevent future regressions.

# Testing:

All existing tests pass successfully.

New test cases confirm that the layout behaves as expected when align-content and align-items are used together.

# Impact:

This fix ensures that layouts using both align-content and align-items properties render correctly, aligning with the behavior observed in Yoga version 1.19.0 and standard web browsers.

Pull Request resolved: https://github.com/facebook/yoga/pull/1742

Reviewed By: joevilches

Differential Revision: D65953882

Pulled By: zeyap

fbshipit-source-id: 7e12a21b1d442b35c3f3536cad32dc4b82130d15
2024-11-20 19:59:42 -08:00