forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kotlinify functional interfaces in react.bridge (facebook#44546)
Summary: Pull Request resolved: facebook#44546 # Changelog: [Internal] - This is the first chunk of moving all of the interfaces to Kotlin inside `react.bridge`, covering the small-ish (functional/SAM and such) interfaces. Differential Revision: D57253634
- Loading branch information
1 parent
d94c4c4
commit 6cb2d2c
Showing
9 changed files
with
82 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMethod.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMethod.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.bridge | ||
/** | ||
* Annotation which is used to mark methods that are exposed to React Native. | ||
* | ||
* This applies to derived classes of [BaseJavaModule], which will generate a list of exported | ||
* methods by searching for those which are annotated with this annotation and adding a JS callback | ||
* for each. | ||
*/ | ||
@Retention(AnnotationRetention.RUNTIME) | ||
public annotation class ReactMethod( | ||
/** | ||
* Whether the method can be called from JS synchronously **on the JS thread**, possibly | ||
* returning a result. | ||
* | ||
* WARNING: in the vast majority of cases, you should leave this to false which allows your | ||
* native module methods to be called asynchronously: calling methods synchronously can have | ||
* strong performance penalties and introduce threading-related bugs to your native modules. | ||
* | ||
* In order to support remote debugging, both the method args and return type must be | ||
* serializable to JSON: this means that we only support the same args as [ReactMethod], and the | ||
* hook can only be void or return JSON values (e.g. bool, number, String, [ ], or | ||
* [WritableArray]). Calling these methods when running under the websocket executor is | ||
* currently not supported. | ||
*/ | ||
public val isBlockingSynchronousMethod: Boolean = false | ||
) |
17 changes: 0 additions & 17 deletions
17
...eact-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
.../react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.bridge | ||
|
||
import com.facebook.proguard.annotations.DoNotStripAny | ||
|
||
@DoNotStripAny | ||
@Deprecated("Use {@link TurboModule} to identify generated specs") | ||
public interface ReactModuleWithSpec |