Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2672,11 +2672,6 @@ public final class com/facebook/react/fabric/EmptyReactNativeConfig : com/facebo
public fun getString (Ljava/lang/String;)Ljava/lang/String;
}

public final class com/facebook/react/fabric/FabricComponents {
public static final field INSTANCE Lcom/facebook/react/fabric/FabricComponents;
public static final fun getFabricComponentName (Ljava/lang/String;)Ljava/lang/String;
}

public final class com/facebook/react/fabric/FabricSoLoader {
public static final field INSTANCE Lcom/facebook/react/fabric/FabricSoLoader;
public static final fun staticInit ()V
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

package com.facebook.react.fabric.mounting.mountitems

/**
* Utility class for Fabric components, this will be removed
*
* TODO T97384889: remove this class when the component names are unified between JS - Android -
* iOS - C++
*/
/** Utility class for Fabric components, this will be removed */
internal object FabricNameComponentMapping {
private val componentNames: Map<String, String> =
mapOf(
Expand All @@ -23,7 +18,7 @@ internal object FabricNameComponentMapping {
"Slider" to "RCTSlider",
"ModalHostView" to "RCTModalHostView",
"Paragraph" to "RCTText",
"Text" to "RCText",
"Text" to "RCTText",
"RawText" to "RCTRawText",
"ActivityIndicatorView" to "AndroidProgressBar",
"ShimmeringView" to "RKShimmeringView",
Expand All @@ -39,7 +34,6 @@ internal object FabricNameComponentMapping {
/** @return the name of component in the Fabric environment */
@JvmStatic
fun getFabricComponentName(componentName: String): String {
val component = componentNames[componentName]
return component ?: componentName
return componentNames[componentName] ?: componentName
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ enum class NoBreadcrumb {};

namespace facebook::react {

enum class ReparentMode { Flatten, Unflatten };

bool ShadowViewNodePair::operator==(const ShadowViewNodePair& rhs) const {
return this->shadowNode == rhs.shadowNode;
}

bool ShadowViewNodePair::operator!=(const ShadowViewNodePair& rhs) const {
return !(*this == rhs);
}

/*
* Extremely simple and naive implementation of a map.
* The map is simple but it's optimized for particular constraints that we have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,48 @@

namespace facebook::react {

enum class ReparentMode { Flatten, Unflatten };
/*
* Describes pair of a `ShadowView` and a `ShadowNode`.
* This is not exposed to the mounting layer.
*/
struct ShadowViewNodePair final {
using NonOwningList = std::vector<ShadowViewNodePair*>;

ShadowView shadowView;
const ShadowNode* shadowNode;

/**
* The ShadowNode does not form a stacking context, and the native views
* corresponding to its children may be parented to an ancestor.
*/
bool flattened{false};

/**
* Whether this ShadowNode should create a corresponding native view.
*/
bool isConcreteView{true};
Point contextOrigin{0, 0};

size_t mountIndex{0};

/**
* This is nullptr unless `inOtherTree` is set to true.
* We rely on this only for marginal cases. TODO: could we
* rely on this more heavily to simplify the diffing algorithm
* overall?
*/
mutable const ShadowViewNodePair* otherTreePair{nullptr};

/*
* The stored pointer to `ShadowNode` represents an identity of the pair.
*/
bool operator==(const ShadowViewNodePair& rhs) const;
bool operator!=(const ShadowViewNodePair& rhs) const;

bool inOtherTree() const {
return this->otherTreePair != nullptr;
}
};

/**
* During differ, we need to keep some `ShadowViewNodePair`s in memory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,4 @@ std::vector<DebugStringConvertibleObject> getDebugProps(

#endif

bool ShadowViewNodePair::operator==(const ShadowViewNodePair& rhs) const {
return this->shadowNode == rhs.shadowNode;
}

bool ShadowViewNodePair::operator!=(const ShadowViewNodePair& rhs) const {
return !(*this == rhs);
}

} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -57,50 +57,6 @@ std::vector<DebugStringConvertibleObject> getDebugProps(

#endif

/*
* Describes pair of a `ShadowView` and a `ShadowNode`.
* This is not exposed to the mounting layer.
*
*/
struct ShadowViewNodePair final {
using NonOwningList = std::vector<ShadowViewNodePair*>;

ShadowView shadowView;
const ShadowNode* shadowNode;

/**
* The ShadowNode does not form a stacking context, and the native views
* corresponding to its children may be parented to an ancestor.
*/
bool flattened{false};

/**
* Whether this ShadowNode should create a corresponding native view.
*/
bool isConcreteView{true};
Point contextOrigin{0, 0};

size_t mountIndex{0};

/**
* This is nullptr unless `inOtherTree` is set to true.
* We rely on this only for marginal cases. TODO: could we
* rely on this more heavily to simplify the diffing algorithm
* overall?
*/
mutable const ShadowViewNodePair* otherTreePair{nullptr};

/*
* The stored pointer to `ShadowNode` represents an identity of the pair.
*/
bool operator==(const ShadowViewNodePair& rhs) const;
bool operator!=(const ShadowViewNodePair& rhs) const;

bool inOtherTree() const {
return this->otherTreePair != nullptr;
}
};

} // namespace facebook::react

namespace std {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void calculateShadowViewMutationsForNewTree(
ShadowViewMutation::List& mutations,
ViewNodePairScope& scope,
const ShadowView& parentShadowView,
std::vector<ShadowViewNodePair*> newChildPairs) {
ShadowViewNodePair::NonOwningList newChildPairs) {
// Sorting pairs based on `orderIndex` if needed.
reorderInPlaceIfNeeded(newChildPairs);

Expand Down