Skip to content

Commit 79d3cb7

Browse files
mateoguzmanafacebook-github-bot
authored andcommitted
Make EventEmitterWrapper internal (#51003)
Summary: This class can be internalized as part of the initiative to reduce the public API surface. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+NOT+user%3Acortinico+NOT+repo%3AMaxdev18%2Fpowersync_app+NOT+repo%3Acarter-0%2Finstagram-decompiled+NOT+repo%3Am0mosenpai%2Finstadamn+NOT+repo%3AA-Star100%2FA-Star100-AUG2-2024+NOT+repo%3Alclnrd%2Fdetox-scrollview-reproductible+NOT+repo%3ADionisisChytiris%2FWorldWiseTrivia_Main+NOT+repo%3Apast3l%2Fhi2+NOT+repo%3AoneDotpy%2FCaribouQuest+NOT+repo%3Abejayoharen%2Fdailytodo+NOT+repo%3Amolangning%2Freversing-discord+NOT+repo%3AScottPrzy%2Freact-native+NOT+repo%3Agabrieldonadel%2Freact-native-visionos+NOT+repo%3AGabriel2308%2FTestes-Soft+NOT+repo%3Adawnzs03%2FflakyBuild+NOT+repo%3Acga2351%2Fcode+NOT+repo%3Astreeg%2Ftcc+NOT+repo%3Asoftware-mansion-labs%2Freact-native-swiftui+NOT+repo%3Apkcsecurity%2Fdecompiled-lightbulb+com.facebook.react.fabric.events.EventEmitterWrapper). ## Changelog: [INTERNAL] - Make com.facebook.react.fabric.events.EventEmitterWrapper internal Pull Request resolved: #51003 Test Plan: ```bash yarn test-android yarn android ``` Reviewed By: NickGerleman Differential Revision: D73888667 Pulled By: arushikesarwani94 fbshipit-source-id: 2119775a5630e76a46924d7db3afd8d5ab6f082b
1 parent e43c5db commit 79d3cb7

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,13 +2397,6 @@ public final class com/facebook/react/fabric/events/EventBeatManager : com/faceb
23972397
public fun onBatchEventDispatched ()V
23982398
}
23992399

2400-
public final class com/facebook/react/fabric/events/EventEmitterWrapper : com/facebook/jni/HybridClassBase {
2401-
public final fun destroy ()V
2402-
public final fun dispatch (Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;I)V
2403-
public final fun dispatchEventSynchronously (Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
2404-
public final fun dispatchUnique (Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
2405-
}
2406-
24072400
public final class com/facebook/react/fabric/events/FabricEventEmitter : com/facebook/react/uimanager/events/RCTModernEventEmitter {
24082401
public fun <init> (Lcom/facebook/react/fabric/FabricUIManager;)V
24092402
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/events/EventEmitterWrapper.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import com.facebook.react.uimanager.events.EventCategoryDef
2222
*/
2323
@DoNotStripAny
2424
@SuppressLint("MissingNativeLoadLibrary")
25-
public class EventEmitterWrapper private constructor() : HybridClassBase() {
25+
internal class EventEmitterWrapper private constructor() : HybridClassBase() {
2626
private external fun dispatchEvent(
2727
eventName: String,
2828
params: NativeMap?,
@@ -40,19 +40,15 @@ public class EventEmitterWrapper private constructor() : HybridClassBase() {
4040
* @param params [WritableMap] payload of the event
4141
*/
4242
@Synchronized
43-
public fun dispatch(
44-
eventName: String,
45-
params: WritableMap?,
46-
@EventCategoryDef eventCategory: Int
47-
) {
43+
fun dispatch(eventName: String, params: WritableMap?, @EventCategoryDef eventCategory: Int) {
4844
if (!isValid) {
4945
return
5046
}
5147
dispatchEvent(eventName, params as NativeMap?, eventCategory)
5248
}
5349

5450
@Synchronized
55-
public fun dispatchEventSynchronously(eventName: String, params: WritableMap?) {
51+
fun dispatchEventSynchronously(eventName: String, params: WritableMap?) {
5652
if (!isValid) {
5753
return
5854
}
@@ -68,15 +64,15 @@ public class EventEmitterWrapper private constructor() : HybridClassBase() {
6864
* @param params [WritableMap] payload of the event
6965
*/
7066
@Synchronized
71-
public fun dispatchUnique(eventName: String, params: WritableMap?) {
67+
fun dispatchUnique(eventName: String, params: WritableMap?) {
7268
if (!isValid) {
7369
return
7470
}
7571
dispatchUniqueEvent(eventName, params as NativeMap?)
7672
}
7773

7874
@Synchronized
79-
public fun destroy() {
75+
fun destroy() {
8076
if (isValid) {
8177
resetNative()
8278
}

0 commit comments

Comments
 (0)