Skip to content

Conversation

@mateoguzmana
Copy link
Contributor

Migrate com.facebook.yoga.YogaProps to Kotlin.

Test plan:

RN

yarn android
yarn test-android

Yoga

./gradlew :yoga:assembleDebug

@vercel
Copy link

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
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
Contributor

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

@cortinico
Copy link
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
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
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
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)

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

Labels

CLA Signed 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