Skip to content

Migrate YogaProps to Kotlin#1844

Closed
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:feat/yoga-props
Closed

Migrate YogaProps to Kotlin#1844
mateoguzmana wants to merge 3 commits into
facebook:mainfrom
mateoguzmana:feat/yoga-props

Conversation

@mateoguzmana
Copy link
Copy Markdown
Contributor

Migrate com.facebook.yoga.YogaProps to Kotlin.

Test plan:

RN

yarn android
yarn test-android

Yoga

./gradlew :yoga:assembleDebug

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
yoga-website Ready Preview Comment Aug 15, 2025 4:55am

@meta-cla meta-cla Bot added the CLA Signed label Aug 7, 2025
@mateoguzmana mateoguzmana marked this pull request as ready for review August 8, 2025 06:43
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 8, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D79897771.

1 similar comment
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this in D79897771.

@cortinico
Copy link
Copy Markdown
Contributor

This is breaking a bunch of stuff internally because is made in a breaking manner.

Here an example of what breaks.
Source is from Litho: https://github.com/facebook/litho/blob/55e28e58930a53133620fd32406ec8c3a9116c0c/litho-core/src/main/java/com/facebook/litho/DebugLayoutNode.kt#L4

./DebugLayoutNode.kt:71:34: error: unresolved reference: styleDirection
    get() = result.getYogaNode().styleDirection
                                 ^^^^^^^^^^^^^^
./DebugLayoutNode.kt:74:34: error: unresolved reference: flexDirection
    get() = result.getYogaNode().flexDirection
                                 ^^^^^^^^^^^^^
./DebugLayoutNode.kt:77:34: error: unresolved reference: justifyContent
    get() = result.getYogaNode().justifyContent
                                 ^^^^^^^^^^^^^^
./DebugLayoutNode.kt:80:34: error: unresolved reference: alignItems
    get() = result.getYogaNode().alignItems
                                 ^^^^^^^^^^
./DebugLayoutNode.kt:83:34: error: unresolved reference: alignSelf
    get() = result.getYogaNode().alignSelf
                                 ^^^^^^^^^
./DebugLayoutNode.kt:86:34: error: unresolved reference: alignContent
    get() = result.getYogaNode().alignContent
                                 ^^^^^^^^^^^^
./DebugLayoutNode.kt:89:34: error: unresolved reference: positionType
    get() = result.getYogaNode().positionType
                                 ^^^^^^^^^^^^
./DebugLayoutNode.kt:92:34: error: unresolved reference: flexGrow
    get() = result.getYogaNode().flexGrow
                                 ^^^^^^^^
./DebugLayoutNode.kt:95:34: error: unresolved reference: flexShrink
    get() = result.getYogaNode().flexShrink
                                 ^^^^^^^^^^
./DebugLayoutNode.kt:98:34: error: unresolved reference: flexBasis
    get() = result.getYogaNode().flexBasis
                                 ^^^^^^^^^
./DebugLayoutNode.kt:101:34: error: unresolved reference: width
    get() = result.getYogaNode().width
                                 ^^^^^
./DebugLayoutNode.kt:104:34: error: unresolved reference: minWidth
    get() = result.getYogaNode().minWidth
                                 ^^^^^^^^
./DebugLayoutNode.kt:107:34: error: unresolved reference: maxWidth
    get() = result.getYogaNode().maxWidth
                                 ^^^^^^^^
./DebugLayoutNode.kt:110:34: error: unresolved reference: height
    get() = result.getYogaNode().height
                                 ^^^^^^
./DebugLayoutNode.kt:113:34: error: unresolved reference: minHeight
    get() = result.getYogaNode().minHeight
                                 ^^^^^^^^^
./DebugLayoutNode.kt:116:34: error: unresolved reference: maxHeight
    get() = result.getYogaNode().maxHeight
                                 ^^^^^^^^^
./DebugLayoutNode.kt:119:34: error: unresolved reference: aspectRatio
    get() = result.getYogaNode().aspectRatio
                                 ^^^^^^^^^^^
./LithoYogaLayoutFunction.kt:91:44: error: unresolved reference: width
    if (YogaConstants.isUndefined(yogaRoot.width.value)) {
                                           ^^^^^
./LithoYogaLayoutFunction.kt:99:44: error: unresolved reference: height
    if (YogaConstants.isUndefined(yogaRoot.height.value)) {
                                           ^^^^^^
./LithoYogaLayoutFunction.kt:292:69: error: unresolved reference: width
    if (layoutResult.layoutOutput.widthFromStyle.compareTo(yogaNode.width.value) != 0) {
                                                                    ^^^^^
./LithoYogaLayoutFunction.kt:295:70: error: unresolved reference: height
    if (layoutResult.layoutOutput.heightFromStyle.compareTo(yogaNode.height.value) != 0) {
                                                                     ^^^^^^
./LithoYogaLayoutFunction.kt:301:11: error: unresolved reference: minWidth
      if (minWidth != targetValue) {
          ^^^^^^^^
./LithoYogaLayoutFunction.kt:304:11: error: unresolved reference: minHeight
      if (minHeight != targetValue) {
          ^^^^^^^^^
./LithoYogaLayoutFunction.kt:921:31: error: unresolved reference: flexDirection
    flexDirection?.let { node.flexDirection = it }
                              ^^^^^^^^^^^^^
./LithoYogaLayoutFunction.kt:922:32: error: unresolved reference: justifyContent
    justifyContent?.let { node.justifyContent = it }
                               ^^^^^^^^^^^^^^
./LithoYogaLayoutFunction.kt:923:30: error: unresolved reference: alignContent
    alignContent?.let { node.alignContent = it }
                             ^^^^^^^^^^^^
./LithoYogaLayoutFunction.kt:924:28: error: unresolved reference: alignItems
    alignItems?.let { node.alignItems = it }
                           ^^^^^^^^^^
./YogaLayoutProps.kt:105:10: error: unresolved reference: alignSelf
    node.alignSelf = alignSelf
         ^^^^^^^^^
./YogaLayoutProps.kt:113:10: error: unresolved reference: flexGrow
    node.flexGrow = flexGrow
         ^^^^^^^^
./YogaLayoutProps.kt:117:10: error: unresolved reference: flexShrink
    node.flexShrink = flexShrink
         ^^^^^^^^^^
./YogaLayoutProps.kt:129:10: error: unresolved reference: aspectRatio
    node.aspectRatio = aspectRatio
         ^^^^^^^^^^^
./YogaLayoutProps.kt:133:10: error: unresolved reference: positionType
    node.positionType = positionType
         ^^^^^^^^^^^^
./YogaLayoutProps.kt:185:10: error: unresolved reference: flexDirection
    node.flexDirection = direction
         ^^^^^^^^^^^^^
./YogaLayoutProps.kt:193:10: error: unresolved reference: justifyContent
    node.justifyContent = justify
         ^^^^^^^^^^^^^^
./YogaLayoutProps.kt:197:10: error: unresolved reference: alignItems
    node.alignItems = align
         ^^^^^^^^^^

Can you update this to use val so that it doesn't break with Litho?

Copy link
Copy Markdown
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment

@mateoguzmana
Copy link
Copy Markdown
Contributor Author

Thanks! Could you please take a second pass? I updated the possible getters to vals in 19b96f5.

@mateoguzmana mateoguzmana requested a review from cortinico August 15, 2025 05:07
@cortinico
Copy link
Copy Markdown
Contributor

Landing this will be a bit more complicated that I thought. Leave it to me, I'll take care of it (we might have to resort to land the original version)

cortinico pushed a commit to cortinico/react-native that referenced this pull request Feb 5, 2026
Summary:
Pull Request resolved: facebook#55349

Migrate com.facebook.yoga.YogaProps to Kotlin.

X-link: facebook/yoga#1844

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

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

Reviewed By: rshest

Differential Revision: D79897771

Pulled By: cortinico
@meta-codesync meta-codesync Bot closed this in 32ec5d5 Feb 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 5, 2026

@cortinico merged this pull request in 32ec5d5.

meta-codesync Bot pushed a commit to facebook/react-native that referenced this pull request Feb 5, 2026
Summary:
Pull Request resolved: #55349

Migrate com.facebook.yoga.YogaProps to Kotlin.

X-link: facebook/yoga#1844

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

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

Reviewed By: rshest

Differential Revision: D79897771

Pulled By: cortinico

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

Labels

CLA Signed Merged Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants