Remove usage of getShadowNodeClass() on new architecture

Summary:
This diff removes the usage of getShadowNodeClass() on apps that are purely running on the new architecture.

The implications of this change are:
- all shadow node classes will be stripped-out by proguard
- props exposed in shadow Nodes won't be included in the native view configs, this is fine becuase all core components are already using static view configs, props included in LayoutShadow node are covered by: BaseViewConfig.android.js

changelog: [internal] internal

Reviewed By: javache, cortinico, rshest

Differential Revision: D72602551

fbshipit-source-id: caada701f80253830df0085fdbbac47a2aa6d71b
This commit is contained in:
David Vacca authored and Facebook GitHub Bot committed 2025-04-08 15:40:47 -07:00
1 parent b0953360ad
commit 79389191da
2 files changed
+10 -2

No files matched your search

@@ -21,6 +21,7 @@ import com.facebook.react.bridge.ReactSoftExceptionLogger;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
import com.facebook.react.common.build.ReactBuildConfig;
import com.facebook.react.common.mapbuffer.MapBuffer;
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
import com.facebook.react.touch.JSResponderHandler;
@@ -406,6 +407,11 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode>
* Map contains the names (key) and types (value) of the ViewManager's props.
*/
public Map<String, String> getNativeProps() {
if (ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE
&& ReactNativeFeatureFlags.enableBridgelessArchitecture()
&& ReactNativeFeatureFlags.disableShadowNodeOnNewArchitectureAndroid()) {
return ViewManagerPropertyUpdater.getNativeProps(getClass(), null);
}
return ViewManagerPropertyUpdater.getNativeProps(getClass(), getShadowNodeClass());
}
@@ -84,11 +84,13 @@ public object ViewManagerPropertyUpdater {
@JvmStatic
public fun getNativeProps(
viewManagerTopClass: Class<out ViewManager<Nothing, *>>,
shadowNodeTopClass: Class<out Nothing>
shadowNodeTopClass: Class<out Nothing>?
): Map<String, String> {
val props: MutableMap<String, String> = HashMap()
findManagerSetter(viewManagerTopClass).getProperties(props)
findNodeSetter(shadowNodeTopClass).getProperties(props)
if (shadowNodeTopClass != null) {
findNodeSetter(shadowNodeTopClass).getProperties(props)
}
return props
}