Skip to content

Commit 3574f94

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Introduce again com/facebook/react/turbomodule/core/interfaces/TurboModule.kt (facebook#41412)
Summary: The PR facebook#39682 moved all TurboModule classes into the folder com/facebook/react/internal/turbomodule/core/interfaces/TurboModule. The reasoning is TurboModule classes are internal implementation of RN and they shouldn't be part of the public API. Later we realized that com.facebook.react.internal.turbomodule.core.interfaces.TurboModule interface is actually being used by OSS developers too implement the TurboReactPackage.getReactModuleInfoProvider() method: https://reactnative.dev/docs/next/the-new-architecture/pillars-turbomodules#updating-the-calculatorpackagejava In this diff I'm re-introducing the com.facebook.react.turbomodule.core.interfaces.TurboModule interface jus for backward compatibility. Since the plan is to delete the TurboReactPackage.getReactModuleInfoProvider method in the next few months, the plan is: - Iterate on the experiments to remove TurboReactPackage.getReactModuleInfoProvider method - Once TurboReactPackage.getReactModuleInfoProvider method is ready to be deleted, there's no need to expose TurboModule interface anymore, so we will delete 'com.facebook.react.turbomodule.core.interfaces.TurboModule' and 'TurboReactPackage.getReactModuleInfoProvider' method - com.facebook.react.internal.turbomodule.core.interfaces.TurboModule will still remain in the codebase, but this will be an internal API changelog: [Android][Changed] Fix backward compatibility breakage Reviewed By: fkgozali Differential Revision: D51168413
1 parent 0479beb commit 3574f94

File tree

1 file changed

+19
-0
lines changed
  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react.turbomodule.core.interfaces
9+
10+
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
11+
12+
/**
13+
* This interface was introduced for backward compatibility purposes. This interface will be
14+
* deprecated as part of the deprecation and removal of ReactModuleInfoProvider in the near future.
15+
*
16+
* See description of https://github.com/facebook/react-native/pull/41412 for more context.
17+
*/
18+
@DeprecatedInNewArchitecture
19+
interface TurboModule : com.facebook.react.internal.turbomodule.core.interfaces.TurboModule {}

0 commit comments

Comments
 (0)