mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Annotate Interop Event APIs (#50927)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50927 Annotate Interop Event APIs changelog: [internal] internal Reviewed By: shwanton Differential Revision: D73407612 fbshipit-source-id: 90cd6d888b3d72c09e3eb4c5142cc50da65d9b4c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7e4ec7d8d3
commit
906474a709
+2
-2
@@ -8,7 +8,7 @@
|
||||
package com.facebook.react.bridge.interop
|
||||
|
||||
import com.facebook.react.bridge.JavaScriptModule
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags.enableFabricRenderer
|
||||
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags.useFabricInterop
|
||||
@@ -21,7 +21,7 @@ import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatur
|
||||
* Currently we only support a `RCTEventEmitter` re-implementation, being `InteropEventEmitter` but
|
||||
* this class can support other re-implementation in the future.
|
||||
*/
|
||||
@LegacyArchitecture
|
||||
@InteropLegacyArchitecture
|
||||
internal class InteropModuleRegistry {
|
||||
|
||||
private val supportedModules = mutableMapOf<Class<*>, Any?>()
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
package com.facebook.react.internal.interop
|
||||
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.react.uimanager.events.Event
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.facebook.react.uimanager.events.Event
|
||||
* the data which is received by the `receiveEvent` method and will be passed over the the
|
||||
* [com.facebook.react.uimanager.events.EventDispatcher]
|
||||
*/
|
||||
@LegacyArchitecture
|
||||
@InteropLegacyArchitecture
|
||||
internal class InteropEvent(
|
||||
@get:JvmName("eventName") val interopEventName: String,
|
||||
@get:JvmName("eventData") val eventData: WritableMap?,
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.WritableArray
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.common.annotations.VisibleForTesting
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.react.uimanager.UIManagerHelper
|
||||
import com.facebook.react.uimanager.events.EventDispatcher
|
||||
@@ -29,7 +29,7 @@ import com.facebook.react.uimanager.events.RCTEventEmitter
|
||||
* is providing support for the `receiveEvent` method, so that non-Fabric ViewManagers can continue
|
||||
* to deliver events also when Fabric is turned on.
|
||||
*/
|
||||
@LegacyArchitecture
|
||||
@InteropLegacyArchitecture
|
||||
internal class InteropEventEmitter(private val reactContext: ReactContext) : RCTEventEmitter {
|
||||
|
||||
private var eventDispatcherOverride: EventDispatcher? = null
|
||||
|
||||
+2
@@ -15,6 +15,7 @@ import com.facebook.react.bridge.LifecycleEventListener;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture;
|
||||
import com.facebook.react.modules.core.ReactChoreographer;
|
||||
import com.facebook.systrace.Systrace;
|
||||
import java.util.ArrayList;
|
||||
@@ -55,6 +56,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
* 0x0000ffff00000000 COALESCING_KEY_MASK = 0xffff000000000000
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
@InteropLegacyArchitecture
|
||||
public class EventDispatcherImpl implements EventDispatcher, LifecycleEventListener {
|
||||
|
||||
private static final Comparator<Event> EVENT_COMPARATOR =
|
||||
|
||||
+2
@@ -15,6 +15,7 @@ import com.facebook.react.bridge.ReactNoCrashSoftException
|
||||
import com.facebook.react.bridge.ReactSoftExceptionLogger.logSoftException
|
||||
import com.facebook.react.bridge.WritableArray
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
|
||||
import com.facebook.react.uimanager.common.UIManagerType
|
||||
import com.facebook.react.uimanager.common.ViewUtil.getUIManagerType
|
||||
|
||||
@@ -25,6 +26,7 @@ import com.facebook.react.uimanager.common.ViewUtil.getUIManagerType
|
||||
*
|
||||
* This class is constructed both by Paper's EventDispatcherImpl and the FabricEventDispatcher.
|
||||
*/
|
||||
@InteropLegacyArchitecture
|
||||
internal class EventEmitterImpl(
|
||||
private val reactContext: ReactApplicationContext,
|
||||
) : RCTModernEventEmitter {
|
||||
|
||||
+2
@@ -11,6 +11,7 @@ import com.facebook.proguard.annotations.DoNotStripAny
|
||||
import com.facebook.react.bridge.JavaScriptModule
|
||||
import com.facebook.react.bridge.WritableArray
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
|
||||
|
||||
/**
|
||||
* Paper JS interface to emit events from native to JS.
|
||||
@@ -18,6 +19,7 @@ import com.facebook.react.bridge.WritableMap
|
||||
* Deprecated in favor of [RCTModernEventEmitter], which works with both the old and new renderer.
|
||||
*/
|
||||
@DoNotStripAny
|
||||
@InteropLegacyArchitecture
|
||||
@Deprecated("Use [RCTModernEventEmitter] instead")
|
||||
public interface RCTEventEmitter : JavaScriptModule {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user