mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Deprecate CompositeReactPackage (#39565)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39565 CompositeReactPackage is not used at Meta neither in github public repositories, we are deprecating it in v0.73 with the goal to remove it in v0.74 changelog: [Android][Breaking] Deprecate CompositeReactPackage from RN Android Reviewed By: christophpurrer Differential Revision: D49440130 fbshipit-source-id: 6a9c220f57fd29f7a530db79c4f76ef169744fba
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d95433f824
commit
294c0fa208
+5
@@ -26,7 +26,12 @@ import java.util.Set;
|
||||
/**
|
||||
* {@code CompositeReactPackage} allows to create a single package composed of views and modules
|
||||
* from several other packages.
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated(
|
||||
since = "CompositeReactPackage is deprecated and will be deleted, use ReactPackage instead",
|
||||
forRemoval = true)
|
||||
public class CompositeReactPackage implements ViewManagerOnDemandReactPackage, ReactPackage {
|
||||
|
||||
private final List<ReactPackage> mChildReactPackages = new ArrayList<>();
|
||||
|
||||
+1
-4
@@ -95,11 +95,8 @@ public abstract class LazyReactPackage implements ReactPackage {
|
||||
protected abstract List<ModuleSpec> getNativeModules(ReactApplicationContext reactContext);
|
||||
|
||||
/**
|
||||
* This is only used when a LazyReactPackage is a part of {@link CompositeReactPackage} Once we
|
||||
* deprecate {@link CompositeReactPackage}, this can be removed too
|
||||
*
|
||||
* @param reactContext react application context that can be used to create modules
|
||||
* @return
|
||||
* @return {@link List<NativeModule>} to register
|
||||
*/
|
||||
@Override
|
||||
public final List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
||||
|
||||
+4
@@ -37,6 +37,7 @@ class CompositeReactPackageTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Suppress("DEPRECATION")
|
||||
fun testThatCreateNativeModulesIsCalledOnAllPackages() {
|
||||
// Given
|
||||
val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3)
|
||||
@@ -51,6 +52,7 @@ class CompositeReactPackageTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Suppress("DEPRECATION")
|
||||
fun testThatCreateViewManagersIsCalledOnAllPackages() {
|
||||
// Given
|
||||
val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3)
|
||||
@@ -65,6 +67,7 @@ class CompositeReactPackageTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Suppress("DEPRECATION")
|
||||
fun testThatCompositeReturnsASumOfNativeModules() {
|
||||
// Given
|
||||
val composite = CompositeReactPackage(packageNo1, packageNo2)
|
||||
@@ -95,6 +98,7 @@ class CompositeReactPackageTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Suppress("DEPRECATION")
|
||||
fun testThatCompositeReturnsASumOfViewManagers() {
|
||||
// Given
|
||||
val composite = CompositeReactPackage(packageNo1, packageNo2)
|
||||
|
||||
Reference in New Issue
Block a user