-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Move all ReactSpan
subclasses to a separate folder
#42594
Conversation
Base commit: 5f75e9b |
@mdvacca Could you review this? |
@mdvacca There were already quite a few |
Unfortunately this is a breakage of compatibility, could you analyze the usage of these classes by Open Source third party libraries in github search? cc @cortinico |
@mdvacca It's a great point! I agree that we should be careful here. I actually gave a thought in the context of this PR, and I concluded that there's no reasonable reason to use our But I'll search for usages anyway! Thanks for the tip. |
@cubuspl42 here some usages: Most of the usages are copies of our classes (easily spottable if the filepath is com/facebook/react). @mdvacca could we move this to |
Moving anything to I had to revert all moving to It would be great to figure this out. |
Using Kotlin |
mmm how is |
Using the |
I assumed we'd create a cycle between |
Ah yeah that can be the case. Still if so, we'll have the cycle anyway between As a last resort we could also use |
I'll try it. Have you considered adding some annotation for React-internal APIs? Sure, it's not as bullet-proof as the Also, it makes it possible to annotate methods inside an otherwise public class. |
Yes we do already have some: react-native/packages/react-native/ReactAndroid/gradle.properties Lines 25 to 26 in b8778ab
We've been discussing with @mdvacca to actually add an |
I don't think that they match my use-case, though.
Interesting! A remaining question is whether this would be a replacement or a supplement to the |
It's going to be a supplement as we intend to have |
9febbe1
to
06dd2de
Compare
06dd2de
to
4466776
Compare
@cortinico Could you take a look now? If the checks succeed, does it mean Buck accepted this code? |
Nope till we import it. Let me look into it |
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@@ -5,7 +5,7 @@ | |||
* LICENSE file in the root directory of this source tree. | |||
*/ | |||
|
|||
package com.facebook.react.views.text; | |||
package com.facebook.react.views.text.internal.span; |
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 problematic as ReactTextInlineImageShadowNode
(which is public) has this method:
public abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode {
/**
* Build a {@link TextInlineImageSpan} from this node. This will be added to the TextView in place
* of this node.
*/
public abstract TextInlineImageSpan buildInlineImageSpan();
}
so we'll be returning an .internal
object from a public class.
We probably should move also ReactTextInlineImageShadowNode
to .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.
Done
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.
@cubuspl42 can we make sure the CI is green?
bdb1d0e
to
4750ab7
Compare
4750ab7
to
55579bc
Compare
@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
I'll drive this forward as there are various failures internally which needs to be handled. |
@cortinico merged this pull request in d4c3311. |
Summary:
Move all
ReactSpan
subclasses to a separate folder.This is a minor improvement in the context of my multi-PR work on react-native-community/discussions-and-proposals#695.
I'm adding a new span class later, which was the direct motivation for this change.
Changelog:
[INTERNAL] [CHANGE] - Move all
ReactSpan
subclasses to a separate folderTest Plan: