Move all ReactSpan subclasses to a separate folder#42594
Move all ReactSpan subclasses to a separate folder#42594jakub-trzebiatowski wants to merge 3 commits intofacebook:mainfrom
ReactSpan subclasses to a separate folder#42594Conversation
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. |
| */ | ||
|
|
||
| package com.facebook.react.views.text; | ||
| package com.facebook.react.views.text.internal.span; |
There was a problem hiding this comment.
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
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
ReactSpansubclasses 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
ReactSpansubclasses to a separate folderTest Plan: