Skip to content

Commit

Permalink
Revert D43500868: Expose UnstableReactLegacyComponentDescriptor insid…
Browse files Browse the repository at this point in the history
…e react/renderer/components/legacyviewmanagerinterop

Differential Revision:
D43500868 (071f6d2)

Original commit changeset: acfcd89efc42

Original Phabricator Diff: D43500868 (071f6d2)

fbshipit-source-id: bb354015b2dcc812491b0219c6dd4d9c6321dc0b
  • Loading branch information
Simeng Pang authored and facebook-github-bot committed Mar 2, 2023
1 parent 071f6d2 commit 851c8c6
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 189 deletions.
8 changes: 0 additions & 8 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa
"rrc_view",
new Pair("../ReactCommon/react/renderer/components/view/", "react/renderer/components/view/")
),
new PrefabPreprocessingEntry(
"rrc_legacyviewmanagerinterop",
new Pair("../ReactCommon/react/renderer/components/legacyviewmanagerinterop/", "react/renderer/components/legacyviewmanagerinterop/")
),
new PrefabPreprocessingEntry(
"jsi",
new Pair("../ReactCommon/jsi/", "")
Expand Down Expand Up @@ -489,7 +485,6 @@ android {
"rrc_image",
"rrc_root",
"rrc_view",
"rrc_legacyviewmanagerinterop",
"jsi",
"glog",
"fabricjni",
Expand Down Expand Up @@ -591,9 +586,6 @@ android {
rrc_view {
headers(new File(prefabHeadersDir, "rrc_view").absolutePath)
}
rrc_legacyviewmanagerinterop {
headers(new File(prefabHeadersDir, "rrc_legacyviewmanagerinterop").absolutePath)
}
jsi {
headers(new File(prefabHeadersDir, "jsi").absolutePath)
}
Expand Down
2 changes: 0 additions & 2 deletions ReactAndroid/cmake-utils/ReactNative-application.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ add_library(folly_runtime ALIAS ReactAndroid::folly_runtime)
add_library(react_nativemodule_core ALIAS ReactAndroid::react_nativemodule_core)
add_library(react_render_imagemanager ALIAS ReactAndroid::react_render_imagemanager)
add_library(rrc_image ALIAS ReactAndroid::rrc_image)
add_library(rrc_legacyviewmanagerinterop ALIAS ReactAndroid::rrc_legacyviewmanagerinterop)

find_package(fbjni REQUIRED CONFIG)
add_library(fbjni ALIAS fbjni::fbjni)
Expand All @@ -92,7 +91,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
react_render_mapbuffer # prefab ready
rrc_image # prefab ready
rrc_view # prefab ready
rrc_legacyviewmanagerinterop # prefab ready
runtimeexecutor # prefab ready
turbomodulejsijni # prefab ready
yoga) # prefab ready
Expand Down
1 change: 0 additions & 1 deletion ReactAndroid/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ add_react_common_subdir(react/renderer/components/textinput)
add_react_common_subdir(react/renderer/components/progressbar)
add_react_common_subdir(react/renderer/components/root)
add_react_common_subdir(react/renderer/components/image)
add_react_common_subdir(react/renderer/components/legacyviewmanagerinterop)
add_react_common_subdir(react/renderer/componentregistry/native)
add_react_common_subdir(react/renderer/components/text)
add_react_common_subdir(react/renderer/components/unimplementedview)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

24 changes: 7 additions & 17 deletions packages/rn-tester/NativeComponentExample/js/MyNativeView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

import * as React from 'react';
import {useRef, useState} from 'react';
import {View, Button, Text} from 'react-native';
import {View, Button} from 'react-native';
import RNTMyNativeView, {
Commands as RNTMyNativeViewCommands,
} from './MyNativeViewNativeComponent';
import RNTMyLegacyNativeView from './MyLegacyViewNativeComponent';
import type {MyNativeViewType} from './MyNativeViewNativeComponent';

const colors = [
Expand All @@ -30,27 +29,18 @@ const colors = [
export default function MyNativeView(props: {}): React.Node {
const ref = useRef<React.ElementRef<MyNativeViewType> | null>(null);
const [opacity, setOpacity] = useState(1.0);
const [color, setColor] = useState('#000000');
return (
<View style={{flex: 1}}>
<Text style={{color: 'red'}}>Fabric View</Text>
<RNTMyNativeView ref={ref} style={{flex: 1}} opacity={opacity} />
<Text style={{color: 'red'}}>Legacy View</Text>
<RNTMyLegacyNativeView
style={{flex: 1}}
opacity={opacity}
color={color}
/>
<Button
title="Change Background"
onPress={() => {
let newColor = colors[Math.floor(Math.random() * 5)];
setColor(newColor);
RNTMyNativeViewCommands.callNativeMethodToChangeBackgroundColor(
// $FlowFixMe[incompatible-call]
ref.current,
newColor,
);
if (ref.current) {
RNTMyNativeViewCommands.callNativeMethodToChangeBackgroundColor(
ref.current,
colors[Math.floor(Math.random() * 5)],
);
}
}}
/>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
import com.facebook.react.module.model.ReactModuleInfo;
import com.facebook.react.module.model.ReactModuleInfoProvider;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.uiapp.component.MyLegacyViewManager;
import com.facebook.react.uiapp.component.MyNativeViewManager;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.views.text.ReactFontManager;
import com.facebook.soloader.SoLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -108,10 +106,7 @@ public List<NativeModule> createNativeModules(
@Override
public List<ViewManager> createViewManagers(
@NonNull ReactApplicationContext reactContext) {
List<ViewManager> viewManagers = new ArrayList<>();
viewManagers.add(new MyNativeViewManager());
viewManagers.add(new MyLegacyViewManager(reactContext));
return viewManagers;
return Collections.singletonList(new MyNativeViewManager());
}
});
}
Expand Down

This file was deleted.

6 changes: 0 additions & 6 deletions packages/rn-tester/android/app/src/main/jni/OnLoad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,15 @@
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/AppSpecs/ComponentDescriptors.h>
#include <react/renderer/components/legacyviewmanagerinterop/UnstableLegacyViewManagerInteropComponentDescriptor.h>
#include <rncore.h>

namespace facebook {
namespace react {

extern const char RNTMyNativeViewName[] = "RNTMyLegacyNativeView";

void registerComponents(
std::shared_ptr<ComponentDescriptorProviderRegistry const> registry) {
registry->add(concreteComponentDescriptorProvider<
RNTMyNativeViewComponentDescriptor>());
registry->add(concreteComponentDescriptorProvider<
UnstableLegacyViewManagerInteropComponentDescriptor<
RNTMyNativeViewName>>());
}

std::shared_ptr<TurboModule> cxxModuleProvider(
Expand Down

0 comments on commit 851c8c6

Please sign in to comment.