Skip to content

Commit

Permalink
Deprecate CompositeReactPackage (#39565)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 1, 2023
1 parent d95433f commit 294c0fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
/**
* {@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<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ public void remove() {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CompositeReactPackageTest {
}

@Test
@Suppress("DEPRECATION")
fun testThatCreateNativeModulesIsCalledOnAllPackages() {
// Given
val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3)
Expand All @@ -51,6 +52,7 @@ class CompositeReactPackageTest {
}

@Test
@Suppress("DEPRECATION")
fun testThatCreateViewManagersIsCalledOnAllPackages() {
// Given
val composite = CompositeReactPackage(packageNo1, packageNo2, packageNo3)
Expand All @@ -65,6 +67,7 @@ class CompositeReactPackageTest {
}

@Test
@Suppress("DEPRECATION")
fun testThatCompositeReturnsASumOfNativeModules() {
// Given
val composite = CompositeReactPackage(packageNo1, packageNo2)
Expand Down Expand Up @@ -95,6 +98,7 @@ class CompositeReactPackageTest {
}

@Test
@Suppress("DEPRECATION")
fun testThatCompositeReturnsASumOfViewManagers() {
// Given
val composite = CompositeReactPackage(packageNo1, packageNo2)
Expand Down

0 comments on commit 294c0fa

Please sign in to comment.