react-native 0.84.0-nightly-20251118-d314e5f4e → 0.84.0-nightly-20251119-79b09ce9c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/Libraries/Components/View/ViewPropTypes.js +10 -0
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/NativeComponent/BaseViewConfig.android.js +12 -0
  4. package/Libraries/Types/CoreEventTypes.js +31 -0
  5. package/React/Base/RCTVersion.m +1 -1
  6. package/React/CxxModule/RCTCxxUtils.mm +1 -1
  7. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +14 -0
  8. package/ReactAndroid/api/ReactAndroid.api +2 -14
  9. package/ReactAndroid/gradle.properties +1 -1
  10. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +0 -7
  11. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerBuilder.kt +0 -10
  12. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +58 -2
  13. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.kt +0 -18
  14. package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +0 -54
  15. package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/FpsDebugFrameCallback.kt +3 -27
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  17. package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +0 -9
  18. package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +52 -0
  19. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +10 -0
  20. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSKeyDispatcher.kt +65 -0
  21. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +0 -8
  22. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +0 -8
  23. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +0 -16
  24. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyDownEvent.kt +23 -0
  25. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyEvent.kt +156 -0
  26. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/KeyUpEvent.kt +24 -0
  27. package/ReactAndroid/src/main/jni/react/tracing/PerformanceTracerCxxInterop.cpp +1 -1
  28. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  29. package/ReactCommon/jsi/jsi/test/testlib.cpp +2 -2
  30. package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +1 -1
  31. package/ReactCommon/react/runtime/ReactInstance.cpp +1 -1
  32. package/index.js.flow +3 -0
  33. package/package.json +9 -9
  34. package/sdks/hermes-engine/version.properties +1 -1
  35. package/types_generated/Libraries/Components/View/ViewPropTypes.d.ts +9 -3
  36. package/types_generated/Libraries/Types/CoreEventTypes.d.ts +29 -1
  37. package/types_generated/index.d.ts +2 -2
  38. package/ReactAndroid/src/main/java/com/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener.kt +0 -36
  39. package/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DidJSUpdateUiDuringFrameDetector.kt +0 -157
  40. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt +0 -30
@@ -19,7 +19,6 @@ import com.facebook.react.bridge.NativeArray
19
19
  import com.facebook.react.bridge.NativeArrayInterface
20
20
  import com.facebook.react.bridge.NativeModule
21
21
  import com.facebook.react.bridge.NativeModuleRegistry
22
- import com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener
23
22
  import com.facebook.react.bridge.RuntimeExecutor
24
23
  import com.facebook.react.bridge.RuntimeScheduler
25
24
  import com.facebook.react.bridge.UIManager
@@ -140,14 +139,6 @@ internal class BridgelessCatalystInstance(private val reactHost: ReactHostImpl)
140
139
  override val sourceURL: String
141
140
  get() = throw UnsupportedOperationException("Unimplemented method 'getSourceURL'")
142
141
 
143
- override fun addBridgeIdleDebugListener(listener: NotThreadSafeBridgeIdleDebugListener) {
144
- throw UnsupportedOperationException("Unimplemented method 'addBridgeIdleDebugListener'")
145
- }
146
-
147
- override fun removeBridgeIdleDebugListener(listener: NotThreadSafeBridgeIdleDebugListener) {
148
- throw UnsupportedOperationException("Unimplemented method 'removeBridgeIdleDebugListener'")
149
- }
150
-
151
142
  override fun registerSegment(segmentId: Int, path: String) {
152
143
  throw UnsupportedOperationException("Unimplemented method 'registerSegment'")
153
144
  }
@@ -12,6 +12,7 @@ package com.facebook.react.runtime
12
12
  import android.content.Context
13
13
  import android.graphics.Point
14
14
  import android.graphics.Rect
15
+ import android.view.KeyEvent
15
16
  import android.view.MotionEvent
16
17
  import android.view.View
17
18
  import com.facebook.common.logging.FLog
@@ -20,7 +21,9 @@ import com.facebook.react.bridge.ReactContext
20
21
  import com.facebook.react.common.annotations.FrameworkAPI
21
22
  import com.facebook.react.common.annotations.UnstableReactNativeAPI
22
23
  import com.facebook.react.config.ReactFeatureFlags
24
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
23
25
  import com.facebook.react.uimanager.IllegalViewOperationException
26
+ import com.facebook.react.uimanager.JSKeyDispatcher
24
27
  import com.facebook.react.uimanager.JSPointerDispatcher
25
28
  import com.facebook.react.uimanager.JSTouchDispatcher
26
29
  import com.facebook.react.uimanager.common.UIManagerType
@@ -37,6 +40,7 @@ public class ReactSurfaceView(context: Context?, private val surface: ReactSurfa
37
40
  ReactRootView(context) {
38
41
  private val jsTouchDispatcher: JSTouchDispatcher = JSTouchDispatcher(this)
39
42
  private var jsPointerDispatcher: JSPointerDispatcher? = null
43
+ private var jsKeyDispatcher: JSKeyDispatcher? = null
40
44
  private var wasMeasured = false
41
45
  private var widthMeasureSpec = 0
42
46
  private var heightMeasureSpec = 0
@@ -45,6 +49,9 @@ public class ReactSurfaceView(context: Context?, private val surface: ReactSurfa
45
49
  if (ReactFeatureFlags.dispatchPointerEvents) {
46
50
  jsPointerDispatcher = JSPointerDispatcher(this)
47
51
  }
52
+ if (ReactNativeFeatureFlags.enableKeyEvents()) {
53
+ jsKeyDispatcher = JSKeyDispatcher()
54
+ }
48
55
  }
49
56
 
50
57
  override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
@@ -188,6 +195,51 @@ public class ReactSurfaceView(context: Context?, private val surface: ReactSurfa
188
195
  }
189
196
  }
190
197
 
198
+ override fun dispatchJSKeyEvent(event: KeyEvent) {
199
+ if (jsKeyDispatcher == null) {
200
+ if (!ReactNativeFeatureFlags.enableKeyEvents()) {
201
+ return
202
+ }
203
+ FLog.w(TAG, "Unable to dispatch key events to JS before the dispatcher is available")
204
+ return
205
+ }
206
+ val eventDispatcher = surface.eventDispatcher
207
+ if (eventDispatcher != null) {
208
+ jsKeyDispatcher?.handleKeyEvent(event, eventDispatcher, surface.surfaceID)
209
+ } else {
210
+ FLog.w(
211
+ TAG,
212
+ "Unable to dispatch key events to JS as the React instance has not been attached",
213
+ )
214
+ }
215
+ }
216
+
217
+ override fun requestChildFocus(child: View?, focused: View?) {
218
+ super.requestChildFocus(child, focused)
219
+
220
+ if (ReactNativeFeatureFlags.enableKeyEvents()) {
221
+ val focusedViewTag = focused?.id
222
+ if (focusedViewTag != null) {
223
+ jsKeyDispatcher?.setFocusedView(focusedViewTag)
224
+ }
225
+ }
226
+ }
227
+
228
+ override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
229
+ super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
230
+
231
+ if (ReactNativeFeatureFlags.enableKeyEvents()) {
232
+ if (gainFocus) {
233
+ val focusedViewTag = focusedChild?.id
234
+ if (focusedViewTag != null) {
235
+ jsKeyDispatcher?.setFocusedView(focusedViewTag)
236
+ }
237
+ } else {
238
+ jsKeyDispatcher?.clearFocus()
239
+ }
240
+ }
241
+ }
242
+
191
243
  override fun hasActiveReactContext(): Boolean =
192
244
  surface.isAttached && surface.reactHost?.currentReactContext != null
193
245
 
@@ -770,6 +770,16 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
770
770
  MapBuilder.of(
771
771
  "phasedRegistrationNames",
772
772
  MapBuilder.of("bubbled", "onFocus", "captured", "onFocusCapture")))
773
+ .put(
774
+ "topKeyDown",
775
+ MapBuilder.of(
776
+ "phasedRegistrationNames",
777
+ MapBuilder.of("bubbled", "onKeyDown", "captured", "onKeyDownCapture")))
778
+ .put(
779
+ "topKeyUp",
780
+ MapBuilder.of(
781
+ "phasedRegistrationNames",
782
+ MapBuilder.of("bubbled", "onKeyUp", "captured", "onKeyUpCapture")))
773
783
  .build());
774
784
  return eventTypeConstants;
775
785
  }
@@ -0,0 +1,65 @@
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.uimanager
9
+
10
+ import android.view.KeyEvent as AndroidKeyEvent
11
+ import android.view.View
12
+ import com.facebook.react.uimanager.events.EventDispatcher
13
+ import com.facebook.react.uimanager.events.KeyDownEvent
14
+ import com.facebook.react.uimanager.events.KeyUpEvent
15
+
16
+ /**
17
+ * JSKeyDispatcher handles dispatching keyboard events to JS from RootViews. It sends keydown and
18
+ * keyup events according to the W3C KeyboardEvent specification, supporting both capture and bubble
19
+ * phases.
20
+ *
21
+ * The keydown and keyup events provide a code indicating which key is pressed. The event target is
22
+ * derived from the currently focused Android view.
23
+ */
24
+ internal class JSKeyDispatcher {
25
+ private var focusedViewTag: Int = View.NO_ID
26
+
27
+ fun handleKeyEvent(
28
+ keyEvent: AndroidKeyEvent,
29
+ eventDispatcher: EventDispatcher,
30
+ surfaceId: Int,
31
+ ) {
32
+ if (focusedViewTag == View.NO_ID) {
33
+ return
34
+ }
35
+
36
+ when (keyEvent.action) {
37
+ AndroidKeyEvent.ACTION_DOWN -> {
38
+ eventDispatcher.dispatchEvent(
39
+ KeyDownEvent(
40
+ surfaceId,
41
+ focusedViewTag,
42
+ keyEvent,
43
+ )
44
+ )
45
+ }
46
+ AndroidKeyEvent.ACTION_UP -> {
47
+ eventDispatcher.dispatchEvent(
48
+ KeyUpEvent(
49
+ surfaceId,
50
+ focusedViewTag,
51
+ keyEvent,
52
+ )
53
+ )
54
+ }
55
+ }
56
+ }
57
+
58
+ fun setFocusedView(viewTag: Int) {
59
+ focusedViewTag = viewTag
60
+ }
61
+
62
+ fun clearFocus() {
63
+ focusedViewTag = View.NO_ID
64
+ }
65
+ }
@@ -26,7 +26,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
26
26
  import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
27
27
  import com.facebook.react.common.build.ReactBuildConfig;
28
28
  import com.facebook.react.modules.i18nmanager.I18nUtil;
29
- import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
30
29
  import com.facebook.react.uimanager.events.EventDispatcher;
31
30
  import com.facebook.systrace.Systrace;
32
31
  import com.facebook.systrace.SystraceMessage;
@@ -782,13 +781,6 @@ public class UIImplementation {
782
781
  mViewManagers.invalidate();
783
782
  }
784
783
 
785
- // NOTE: When converted to Kotlin this method should be `internal` due to
786
- // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
787
- public void setViewHierarchyUpdateDebugListener(
788
- @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
789
- mOperationsQueue.setViewHierarchyUpdateDebugListener(listener);
790
- }
791
-
792
784
  protected final void removeShadowNode(ReactShadowNode nodeToRemove) {
793
785
  removeShadowNodeRecursive(nodeToRemove);
794
786
  nodeToRemove.dispose();
@@ -45,7 +45,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
45
45
  import com.facebook.react.common.build.ReactBuildConfig;
46
46
  import com.facebook.react.module.annotations.ReactModule;
47
47
  import com.facebook.react.uimanager.common.ViewUtil;
48
- import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
49
48
  import com.facebook.react.uimanager.events.EventDispatcher;
50
49
  import com.facebook.react.uimanager.events.EventDispatcherImpl;
51
50
  import com.facebook.react.uimanager.events.RCTEventEmitter;
@@ -699,13 +698,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule
699
698
  }
700
699
  }
701
700
 
702
- // NOTE: When converted to Kotlin this method should be `internal` due to
703
- // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
704
- public void setViewHierarchyUpdateDebugListener(
705
- @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
706
- mUIImplementation.setViewHierarchyUpdateDebugListener(listener);
707
- }
708
-
709
701
  @Override
710
702
  public EventDispatcher getEventDispatcher() {
711
703
  return mEventDispatcher;
@@ -29,7 +29,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitecture;
29
29
  import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel;
30
30
  import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
31
31
  import com.facebook.react.modules.core.ReactChoreographer;
32
- import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
33
32
  import com.facebook.systrace.Systrace;
34
33
  import com.facebook.systrace.SystraceMessage;
35
34
  import com.facebook.yoga.YogaDirection;
@@ -584,7 +583,6 @@ public class UIViewOperationQueue {
584
583
  @GuardedBy("mNonBatchedOperationsLock")
585
584
  private ArrayDeque<UIOperation> mNonBatchedOperations = new ArrayDeque<>();
586
585
 
587
- private @Nullable NotThreadSafeViewHierarchyUpdateDebugListener mViewHierarchyUpdateDebugListener;
588
586
  private boolean mIsDispatchUIFrameCallbackEnqueued = false;
589
587
  private boolean mIsInIllegalUIState = false;
590
588
  private boolean mIsProfilingNextBatch = false;
@@ -619,13 +617,6 @@ public class UIViewOperationQueue {
619
617
  return mNativeViewHierarchyManager;
620
618
  }
621
619
 
622
- // NOTE: When converted to Kotlin this method should be `internal` due to
623
- // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
624
- public void setViewHierarchyUpdateDebugListener(
625
- @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
626
- mViewHierarchyUpdateDebugListener = listener;
627
- }
628
-
629
620
  public void profileNextBatch() {
630
621
  mIsProfilingNextBatch = true;
631
622
  mProfiledBatchCommitStartTime = 0;
@@ -833,10 +824,6 @@ public class UIViewOperationQueue {
833
824
  }
834
825
  }
835
826
 
836
- if (mViewHierarchyUpdateDebugListener != null) {
837
- mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateEnqueued();
838
- }
839
-
840
827
  Runnable runOperations =
841
828
  new Runnable() {
842
829
  @Override
@@ -926,9 +913,6 @@ public class UIViewOperationQueue {
926
913
  // Clear layout animation, as animation only apply to current UI operations batch.
927
914
  mNativeViewHierarchyManager.clearLayoutAnimation();
928
915
 
929
- if (mViewHierarchyUpdateDebugListener != null) {
930
- mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateFinished();
931
- }
932
916
  } catch (Exception e) {
933
917
  mIsInIllegalUIState = true;
934
918
  throw e;
@@ -0,0 +1,23 @@
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.uimanager.events
9
+
10
+ import android.view.KeyEvent as AndroidKeyEvent
11
+
12
+ internal class KeyDownEvent(
13
+ surfaceId: Int,
14
+ viewTag: Int,
15
+ keyEvent: AndroidKeyEvent,
16
+ ) : KeyEvent(surfaceId, viewTag, keyEvent) {
17
+
18
+ override fun getEventName(): String = EVENT_NAME
19
+
20
+ companion object {
21
+ private const val EVENT_NAME: String = "topKeyDown"
22
+ }
23
+ }
@@ -0,0 +1,156 @@
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.uimanager.events
9
+
10
+ import android.view.KeyEvent as AndroidKeyEvent
11
+ import com.facebook.react.bridge.Arguments
12
+ import com.facebook.react.bridge.WritableMap
13
+
14
+ internal abstract class KeyEvent(
15
+ surfaceId: Int,
16
+ viewTag: Int,
17
+ keyEvent: AndroidKeyEvent,
18
+ ) : Event<KeyEvent>(surfaceId, viewTag) {
19
+
20
+ // Extract all needed data from keyEvent immediately to avoid storing the AndroidKeyEvent itself
21
+ private val keyCode: Int = keyEvent.keyCode
22
+ private val unicodeChar: Int = keyEvent.unicodeChar
23
+ private val isAltPressed: Boolean = keyEvent.isAltPressed
24
+ private val isCtrlPressed: Boolean = keyEvent.isCtrlPressed
25
+ private val isMetaPressed: Boolean = keyEvent.isMetaPressed
26
+ private val isShiftPressed: Boolean = keyEvent.isShiftPressed
27
+
28
+ override fun canCoalesce(): Boolean = false
29
+
30
+ override fun getEventCategory(): Int = EventCategoryDef.DISCRETE
31
+
32
+ override fun getEventData(): WritableMap {
33
+ val eventData = Arguments.createMap()
34
+
35
+ eventData.putInt("target", viewTag)
36
+
37
+ // W3C KeyboardEvent properties
38
+ eventData.putString("key", getKeyString())
39
+ eventData.putString("code", getCodeString())
40
+
41
+ // Modifier keys
42
+ eventData.putBoolean("altKey", isAltPressed)
43
+ eventData.putBoolean("ctrlKey", isCtrlPressed)
44
+ eventData.putBoolean("metaKey", isMetaPressed)
45
+ eventData.putBoolean("shiftKey", isShiftPressed)
46
+
47
+ // Additional properties
48
+ eventData.putDouble("timestamp", timestampMs.toDouble())
49
+
50
+ return eventData
51
+ }
52
+
53
+ private fun getKeyString(): String {
54
+ return when {
55
+ unicodeChar != 0 && !Character.isISOControl(unicodeChar) -> unicodeChar.toChar().toString()
56
+ else -> KEY_NAME_MAP[keyCode] ?: UNIDENTIFIED
57
+ }
58
+ }
59
+
60
+ private fun getCodeString(): String {
61
+ return CODE_MAP[keyCode] ?: UNIDENTIFIED
62
+ }
63
+
64
+ internal companion object {
65
+ private const val UNIDENTIFIED = "Unidentified"
66
+
67
+ private val CODE_MAP: Map<Int, String> by
68
+ lazy(LazyThreadSafetyMode.PUBLICATION) {
69
+ mapOf(
70
+ // Letter keys
71
+ AndroidKeyEvent.KEYCODE_A to "KeyA",
72
+ AndroidKeyEvent.KEYCODE_B to "KeyB",
73
+ AndroidKeyEvent.KEYCODE_C to "KeyC",
74
+ AndroidKeyEvent.KEYCODE_D to "KeyD",
75
+ AndroidKeyEvent.KEYCODE_E to "KeyE",
76
+ AndroidKeyEvent.KEYCODE_F to "KeyF",
77
+ AndroidKeyEvent.KEYCODE_G to "KeyG",
78
+ AndroidKeyEvent.KEYCODE_H to "KeyH",
79
+ AndroidKeyEvent.KEYCODE_I to "KeyI",
80
+ AndroidKeyEvent.KEYCODE_J to "KeyJ",
81
+ AndroidKeyEvent.KEYCODE_K to "KeyK",
82
+ AndroidKeyEvent.KEYCODE_L to "KeyL",
83
+ AndroidKeyEvent.KEYCODE_M to "KeyM",
84
+ AndroidKeyEvent.KEYCODE_N to "KeyN",
85
+ AndroidKeyEvent.KEYCODE_O to "KeyO",
86
+ AndroidKeyEvent.KEYCODE_P to "KeyP",
87
+ AndroidKeyEvent.KEYCODE_Q to "KeyQ",
88
+ AndroidKeyEvent.KEYCODE_R to "KeyR",
89
+ AndroidKeyEvent.KEYCODE_S to "KeyS",
90
+ AndroidKeyEvent.KEYCODE_T to "KeyT",
91
+ AndroidKeyEvent.KEYCODE_U to "KeyU",
92
+ AndroidKeyEvent.KEYCODE_V to "KeyV",
93
+ AndroidKeyEvent.KEYCODE_W to "KeyW",
94
+ AndroidKeyEvent.KEYCODE_X to "KeyX",
95
+ AndroidKeyEvent.KEYCODE_Y to "KeyY",
96
+ AndroidKeyEvent.KEYCODE_Z to "KeyZ",
97
+ // Digit keys
98
+ AndroidKeyEvent.KEYCODE_0 to "Digit0",
99
+ AndroidKeyEvent.KEYCODE_1 to "Digit1",
100
+ AndroidKeyEvent.KEYCODE_2 to "Digit2",
101
+ AndroidKeyEvent.KEYCODE_3 to "Digit3",
102
+ AndroidKeyEvent.KEYCODE_4 to "Digit4",
103
+ AndroidKeyEvent.KEYCODE_5 to "Digit5",
104
+ AndroidKeyEvent.KEYCODE_6 to "Digit6",
105
+ AndroidKeyEvent.KEYCODE_7 to "Digit7",
106
+ AndroidKeyEvent.KEYCODE_8 to "Digit8",
107
+ AndroidKeyEvent.KEYCODE_9 to "Digit9",
108
+ // Special keys
109
+ AndroidKeyEvent.KEYCODE_ENTER to "Enter",
110
+ AndroidKeyEvent.KEYCODE_SPACE to "Space",
111
+ AndroidKeyEvent.KEYCODE_TAB to "Tab",
112
+ AndroidKeyEvent.KEYCODE_DEL to "Backspace",
113
+ AndroidKeyEvent.KEYCODE_ESCAPE to "Escape",
114
+ // Modifier keys
115
+ AndroidKeyEvent.KEYCODE_SHIFT_LEFT to "ShiftLeft",
116
+ AndroidKeyEvent.KEYCODE_SHIFT_RIGHT to "ShiftRight",
117
+ AndroidKeyEvent.KEYCODE_CTRL_LEFT to "ControlLeft",
118
+ AndroidKeyEvent.KEYCODE_CTRL_RIGHT to "ControlRight",
119
+ AndroidKeyEvent.KEYCODE_ALT_LEFT to "AltLeft",
120
+ AndroidKeyEvent.KEYCODE_ALT_RIGHT to "AltRight",
121
+ AndroidKeyEvent.KEYCODE_META_LEFT to "MetaLeft",
122
+ AndroidKeyEvent.KEYCODE_META_RIGHT to "MetaRight",
123
+ // Arrow keys
124
+ AndroidKeyEvent.KEYCODE_DPAD_UP to "ArrowUp",
125
+ AndroidKeyEvent.KEYCODE_DPAD_DOWN to "ArrowDown",
126
+ AndroidKeyEvent.KEYCODE_DPAD_LEFT to "ArrowLeft",
127
+ AndroidKeyEvent.KEYCODE_DPAD_RIGHT to "ArrowRight",
128
+ AndroidKeyEvent.KEYCODE_DPAD_CENTER to "Enter",
129
+ )
130
+ }
131
+
132
+ private val KEY_NAME_MAP: Map<Int, String> by
133
+ lazy(LazyThreadSafetyMode.PUBLICATION) {
134
+ mapOf(
135
+ AndroidKeyEvent.KEYCODE_ENTER to "Enter",
136
+ AndroidKeyEvent.KEYCODE_DPAD_CENTER to "Enter",
137
+ AndroidKeyEvent.KEYCODE_SPACE to " ",
138
+ AndroidKeyEvent.KEYCODE_TAB to "Tab",
139
+ AndroidKeyEvent.KEYCODE_DEL to "Backspace",
140
+ AndroidKeyEvent.KEYCODE_ESCAPE to "Escape",
141
+ AndroidKeyEvent.KEYCODE_SHIFT_LEFT to "Shift",
142
+ AndroidKeyEvent.KEYCODE_SHIFT_RIGHT to "Shift",
143
+ AndroidKeyEvent.KEYCODE_CTRL_LEFT to "Control",
144
+ AndroidKeyEvent.KEYCODE_CTRL_RIGHT to "Control",
145
+ AndroidKeyEvent.KEYCODE_ALT_LEFT to "Alt",
146
+ AndroidKeyEvent.KEYCODE_ALT_RIGHT to "Alt",
147
+ AndroidKeyEvent.KEYCODE_META_LEFT to "Meta",
148
+ AndroidKeyEvent.KEYCODE_META_RIGHT to "Meta",
149
+ AndroidKeyEvent.KEYCODE_DPAD_UP to "ArrowUp",
150
+ AndroidKeyEvent.KEYCODE_DPAD_DOWN to "ArrowDown",
151
+ AndroidKeyEvent.KEYCODE_DPAD_LEFT to "ArrowLeft",
152
+ AndroidKeyEvent.KEYCODE_DPAD_RIGHT to "ArrowRight",
153
+ )
154
+ }
155
+ }
156
+ }
@@ -0,0 +1,24 @@
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.uimanager.events
9
+
10
+ import android.view.KeyEvent as AndroidKeyEvent
11
+
12
+ /** An event representing a key release (keyup). Corresponds to W3C KeyboardEvent specification. */
13
+ internal class KeyUpEvent(
14
+ surfaceId: Int,
15
+ viewTag: Int,
16
+ keyEvent: AndroidKeyEvent,
17
+ ) : KeyEvent(surfaceId, viewTag, keyEvent) {
18
+
19
+ override fun getEventName(): String = EVENT_NAME
20
+
21
+ companion object {
22
+ private const val EVENT_NAME: String = "topKeyUp"
23
+ }
24
+ }
@@ -200,7 +200,7 @@ jint PerformanceTracerCxxInterop::subscribeToTracingStateChanges(
200
200
  onTracingStateChangedMethod(
201
201
  callback, static_cast<jboolean>(isTracing));
202
202
  });
203
- } catch (const std::exception& e) {
203
+ } catch (const std::exception&) {
204
204
  }
205
205
  }
206
206
  });
@@ -22,7 +22,7 @@ constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 84;
24
24
  int32_t Patch = 0;
25
- std::string_view Prerelease = "nightly-20251118-d314e5f4e";
25
+ std::string_view Prerelease = "nightly-20251119-79b09ce9c";
26
26
  } ReactNativeVersion;
27
27
 
28
28
  } // namespace facebook::react
@@ -1455,7 +1455,7 @@ TEST_P(JSITest, MicrotasksTest) {
1455
1455
  EXPECT_EQ(
1456
1456
  rt.global().getProperty(rt, "globalValue").asString(rt).utf8(rt),
1457
1457
  "hello world");
1458
- } catch (const JSINativeException& ex) {
1458
+ } catch (const JSINativeException&) {
1459
1459
  // queueMicrotask() is unimplemented by some runtimes, ignore such failures.
1460
1460
  }
1461
1461
  }
@@ -1550,7 +1550,7 @@ TEST_P(JSITest, ArrayBufferSizeTest) {
1550
1550
  try {
1551
1551
  // Ensure we can safely write some data to the buffer.
1552
1552
  memset(ab.data(rt), 0xab, 10);
1553
- } catch (const JSINativeException& ex) {
1553
+ } catch (const JSINativeException&) {
1554
1554
  // data() is unimplemented by some runtimes, ignore such failures.
1555
1555
  }
1556
1556
 
@@ -936,7 +936,7 @@ folly::dynamic HostPlatformViewProps::getDiffProps(
936
936
 
937
937
  if (accessibilityState != oldProps->accessibilityState) {
938
938
  updateAccessibilityStateProp(
939
- result, oldProps->accessibilityState, accessibilityState);
939
+ result, accessibilityState, oldProps->accessibilityState);
940
940
  }
941
941
 
942
942
  if (accessibilityLabel != oldProps->accessibilityLabel) {
@@ -95,7 +95,7 @@ ReactInstance::ReactInstance(
95
95
  jsErrorHandler->handleError(jsiRuntime, originalError, true);
96
96
  } catch (std::exception& ex) {
97
97
  jsi::JSError error(
98
- jsiRuntime, std::string("Non-js exception: ") + ex.what());
98
+ jsiRuntime, std::string("Non-JS exception: ") + ex.what());
99
99
  jsErrorHandler->handleError(jsiRuntime, error, true);
100
100
  }
101
101
  });
package/index.js.flow CHANGED
@@ -420,6 +420,9 @@ export type {
420
420
  BlurEvent,
421
421
  FocusEvent,
422
422
  GestureResponderEvent,
423
+ KeyDownEvent,
424
+ KeyEvent,
425
+ KeyUpEvent,
423
426
  LayoutChangeEvent,
424
427
  LayoutRectangle,
425
428
  MouseEvent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.84.0-nightly-20251118-d314e5f4e",
3
+ "version": "0.84.0-nightly-20251119-79b09ce9c",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -160,13 +160,13 @@
160
160
  },
161
161
  "dependencies": {
162
162
  "@jest/create-cache-key-function": "^29.7.0",
163
- "@react-native/assets-registry": "0.84.0-nightly-20251118-d314e5f4e",
164
- "@react-native/codegen": "0.84.0-nightly-20251118-d314e5f4e",
165
- "@react-native/community-cli-plugin": "0.84.0-nightly-20251118-d314e5f4e",
166
- "@react-native/gradle-plugin": "0.84.0-nightly-20251118-d314e5f4e",
167
- "@react-native/js-polyfills": "0.84.0-nightly-20251118-d314e5f4e",
168
- "@react-native/normalize-colors": "0.84.0-nightly-20251118-d314e5f4e",
169
- "@react-native/virtualized-lists": "0.84.0-nightly-20251118-d314e5f4e",
163
+ "@react-native/assets-registry": "0.84.0-nightly-20251119-79b09ce9c",
164
+ "@react-native/codegen": "0.84.0-nightly-20251119-79b09ce9c",
165
+ "@react-native/community-cli-plugin": "0.84.0-nightly-20251119-79b09ce9c",
166
+ "@react-native/gradle-plugin": "0.84.0-nightly-20251119-79b09ce9c",
167
+ "@react-native/js-polyfills": "0.84.0-nightly-20251119-79b09ce9c",
168
+ "@react-native/normalize-colors": "0.84.0-nightly-20251119-79b09ce9c",
169
+ "@react-native/virtualized-lists": "0.84.0-nightly-20251119-79b09ce9c",
170
170
  "abort-controller": "^3.0.0",
171
171
  "anser": "^1.4.9",
172
172
  "ansi-regex": "^5.0.0",
@@ -176,7 +176,7 @@
176
176
  "commander": "^12.0.0",
177
177
  "flow-enums-runtime": "^0.0.6",
178
178
  "glob": "^7.1.1",
179
- "hermes-compiler": "0.14.0-commitly-202511160156-8b7dd3e16",
179
+ "hermes-compiler": "0.14.0-commitly-202511181844-5b560d093",
180
180
  "invariant": "^2.2.4",
181
181
  "jest-environment-node": "^29.7.0",
182
182
  "memoize-one": "^5.0.0",
@@ -1,2 +1,2 @@
1
- HERMES_VERSION_NAME=0.14.0-commitly-202511160156-8b7dd3e16
1
+ HERMES_VERSION_NAME=0.14.0-commitly-202511181844-5b560d093
2
2
  HERMES_V1_VERSION_NAME=250829098.0.3
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @generated SignedSource<<8771ae37c049a4be45b289e8bf1e74df>>
7
+ * @generated SignedSource<<e4fd9057301628b1c4a12dffd674e809>>
8
8
  *
9
9
  * This file was translated from Flow by scripts/js-api/build-types/index.js.
10
10
  * Original file: packages/react-native/Libraries/Components/View/ViewPropTypes.js
@@ -12,7 +12,7 @@
12
12
 
13
13
  import type { EdgeInsetsOrSizeProp } from "../../StyleSheet/EdgeInsetsPropType";
14
14
  import type { ViewStyleProp } from "../../StyleSheet/StyleSheet";
15
- import type { BlurEvent, FocusEvent, GestureResponderEvent, LayoutChangeEvent, LayoutRectangle, MouseEvent, PointerEvent } from "../../Types/CoreEventTypes";
15
+ import type { BlurEvent, FocusEvent, GestureResponderEvent, KeyDownEvent, KeyUpEvent, LayoutChangeEvent, LayoutRectangle, MouseEvent, PointerEvent } from "../../Types/CoreEventTypes";
16
16
  import type { AccessibilityActionEvent, AccessibilityProps } from "./ViewAccessibility";
17
17
  import * as React from "react";
18
18
  export type ViewLayout = LayoutRectangle;
@@ -92,6 +92,12 @@ type FocusEventProps = Readonly<{
92
92
  onFocus?: ((event: FocusEvent) => void) | undefined;
93
93
  onFocusCapture?: ((event: FocusEvent) => void) | undefined;
94
94
  }>;
95
+ type KeyEventProps = Readonly<{
96
+ onKeyDown?: ((event: KeyDownEvent) => void) | undefined;
97
+ onKeyDownCapture?: ((event: KeyDownEvent) => void) | undefined;
98
+ onKeyUp?: ((event: KeyUpEvent) => void) | undefined;
99
+ onKeyUpCapture?: ((event: KeyUpEvent) => void) | undefined;
100
+ }>;
95
101
  type TouchEventProps = Readonly<{
96
102
  onTouchCancel?: ((e: GestureResponderEvent) => void) | undefined;
97
103
  onTouchCancelCapture?: ((e: GestureResponderEvent) => void) | undefined;
@@ -432,4 +438,4 @@ type ViewBaseProps = Readonly<{
432
438
  */
433
439
  experimental_accessibilityOrder?: Array<string> | undefined;
434
440
  }>;
435
- export type ViewProps = Readonly<Omit<DirectEventProps, keyof GestureResponderHandlers | keyof MouseEventProps | keyof PointerEventProps | keyof FocusEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<GestureResponderHandlers, keyof MouseEventProps | keyof PointerEventProps | keyof FocusEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<MouseEventProps, keyof PointerEventProps | keyof FocusEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<PointerEventProps, keyof FocusEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<FocusEventProps, keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<TouchEventProps, keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<ViewPropsAndroid, keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<ViewPropsIOS, keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<AccessibilityProps, keyof ViewBaseProps | keyof {}> & Omit<ViewBaseProps, keyof {}> & {}>;
441
+ export type ViewProps = Readonly<Omit<DirectEventProps, keyof GestureResponderHandlers | keyof MouseEventProps | keyof PointerEventProps | keyof FocusEventProps | keyof KeyEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<GestureResponderHandlers, keyof MouseEventProps | keyof PointerEventProps | keyof FocusEventProps | keyof KeyEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<MouseEventProps, keyof PointerEventProps | keyof FocusEventProps | keyof KeyEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<PointerEventProps, keyof FocusEventProps | keyof KeyEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<FocusEventProps, keyof KeyEventProps | keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<KeyEventProps, keyof TouchEventProps | keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<TouchEventProps, keyof ViewPropsAndroid | keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<ViewPropsAndroid, keyof ViewPropsIOS | keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<ViewPropsIOS, keyof AccessibilityProps | keyof ViewBaseProps | keyof {}> & Omit<AccessibilityProps, keyof ViewBaseProps | keyof {}> & Omit<ViewBaseProps, keyof {}> & {}>;