-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate ReactClippingViewGroup
to Kotlin
#49413
base: main
Are you sure you want to change the base?
Migrate ReactClippingViewGroup
to Kotlin
#49413
Conversation
@get:Deprecated("Use removeClippedSubviews property instead", ReplaceWith("removeClippedSubviews")) | ||
@Suppress("INAPPLICABLE_JVM_NAME") | ||
@get:JvmName("getRemoveClippedSubviews") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels wrong. Why do we need all of this? Specifically the ReplaceWith
won't work as you're replacing with the same string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see it now. I was overlooking it, added these annotations for backwards compatibility based on other examples in the codebase when trying to fix some issues post-migration for ReactHorizontalScrollContainerLegacyView in old arch but just double checked and indeed are not needed. Thanks for pointing this out
override var removeClippedSubviews: Boolean = false | ||
set(value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably an indicator of a breaking change. We should check how often ReactClippingViewGroup
is implemented in OSS. If the number is relevant this will have to be marked as [BREAKING] rather than internal.
If there are no relevant usages on the other hand, we can make this class [INTERNAL]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see some usages in OSS (ref), so it would be a breaking change indeed.
Now, my memory started getting back to why I added the backwards compatibility annotations: seems like we can prevent this from being a breaking change by adding the following (tested by reverting the changes in ReactHorizontalScrollContainerLegacyView):
@Suppress("INAPPLICABLE_JVM_NAME")
@set:JvmName("setRemoveClippedSubviews")
public var removeClippedSubviews: Boolean
But in the other hand, I don't see any other cases where we have done this in the codebase. Do we prefer to have it as a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we need to look only at Kotlin usages here
I believe the latter as just forks, so we can consider this actually [INTERNAL]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, understood. Seems good then, thank you for double checking!
Summary:
Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin
Changelog:
[INTERNAL] - Migrate com.facebook.react.uimanager.ReactClippingViewGroup to Kotlin
Test Plan: