react-native 0.74.0-nightly-20240128-cfc0ba04a → 1000.0.0

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 (148) hide show
  1. package/Libraries/Animated/NativeAnimatedHelper.js +1 -1
  2. package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
  3. package/Libraries/Animated/useAnimatedProps.js +1 -1
  4. package/Libraries/AppDelegate/RCTAppDelegate.mm +2 -1
  5. package/Libraries/Blob/React-RCTBlob.podspec +1 -0
  6. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +69 -0
  7. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +24 -0
  8. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +33 -0
  9. package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +13 -0
  10. package/Libraries/Core/ReactNativeVersion.js +2 -3
  11. package/Libraries/Core/ReactNativeVersionCheck.js +1 -1
  12. package/Libraries/Core/registerCallableModule.js +42 -0
  13. package/Libraries/Image/RCTImageLoader.mm +4 -11
  14. package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -1
  15. package/Libraries/ReactNative/BridgelessUIManager.js +31 -13
  16. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +1 -1
  17. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -33
  18. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +12 -0
  19. package/Libraries/Renderer/implementations/ReactFabric-dev.js +24543 -21110
  20. package/Libraries/Renderer/implementations/ReactFabric-prod.js +4104 -3058
  21. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4352 -3273
  22. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25038 -21457
  23. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3721 -2600
  24. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4024 -2869
  25. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +43 -4
  26. package/Libraries/WebPerformance/Performance.js +1 -1
  27. package/React/Base/RCTBridge+Private.h +14 -0
  28. package/React/Base/RCTBridge.mm +6 -0
  29. package/React/Base/RCTKeyCommands.m +12 -1
  30. package/React/Base/RCTVersion.m +3 -3
  31. package/React/CoreModules/RCTAlertController.mm +2 -3
  32. package/React/CoreModules/RCTAppearance.mm +1 -1
  33. package/React/CoreModules/React-CoreModules.podspec +1 -0
  34. package/React/CxxBridge/RCTCxxBridge.mm +21 -3
  35. package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +22 -1
  36. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +13 -2
  37. package/React/Fabric/RCTConversions.h +2 -18
  38. package/React/React-RCTFabric.podspec +1 -0
  39. package/React-Core.podspec +1 -3
  40. package/ReactAndroid/api/ReactAndroid.api +53 -1
  41. package/ReactAndroid/gradle.properties +1 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNode.java +3 -1
  43. package/ReactAndroid/src/main/java/com/facebook/react/animated/DecayAnimation.java +2 -0
  44. package/ReactAndroid/src/main/java/com/facebook/react/animated/DiffClampAnimatedNode.java +3 -1
  45. package/ReactAndroid/src/main/java/com/facebook/react/animated/ModulusAnimatedNode.java +3 -1
  46. package/ReactAndroid/src/main/java/com/facebook/react/animated/ObjectAnimatedNode.java +3 -1
  47. package/ReactAndroid/src/main/java/com/facebook/react/animated/SpringAnimation.java +3 -1
  48. package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +1 -3
  49. package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +5 -2
  50. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +11 -1
  51. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -1
  52. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -1
  53. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -1
  54. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -1
  55. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -1
  56. package/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/JSCExecutor.kt +1 -1
  57. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +3 -3
  58. package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +3 -0
  59. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +13 -1
  60. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +7 -0
  61. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +11 -0
  62. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +9 -1
  63. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +24 -0
  64. package/ReactAndroid/src/main/java/com/facebook/react/views/image/ScaleTypeStartInside.java +1 -1
  65. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt +37 -0
  66. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt +49 -0
  67. package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt +54 -0
  68. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +2 -2
  69. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +2 -2
  70. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +2 -2
  71. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +2 -0
  72. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +9 -1
  73. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -1
  74. package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.cpp +7 -1
  75. package/ReactAndroid/src/main/jni/react/featureflags/ReactNativeFeatureFlagsProviderHolder.h +2 -1
  76. package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +16 -10
  77. package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp +0 -3
  78. package/ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h +0 -1
  79. package/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp +7 -6
  80. package/ReactCommon/cxxreact/Instance.cpp +34 -18
  81. package/ReactCommon/cxxreact/Instance.h +13 -2
  82. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -1
  83. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  84. package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +34 -0
  85. package/ReactCommon/jsinspector-modern/InstanceAgent.h +54 -0
  86. package/ReactCommon/jsinspector-modern/InstanceTarget.cpp +25 -0
  87. package/ReactCommon/jsinspector-modern/InstanceTarget.h +58 -0
  88. package/ReactCommon/jsinspector-modern/PageAgent.cpp +65 -0
  89. package/ReactCommon/jsinspector-modern/PageAgent.h +13 -0
  90. package/ReactCommon/jsinspector-modern/PageTarget.cpp +41 -0
  91. package/ReactCommon/jsinspector-modern/PageTarget.h +28 -1
  92. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +12 -1
  93. package/ReactCommon/jsinspector-modern/ReactCdp.h +1 -0
  94. package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +2 -0
  95. package/ReactCommon/jsinspector-modern/tests/PageTargetTest.cpp +164 -10
  96. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -1
  97. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -1
  98. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +18 -1
  99. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +3 -1
  100. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -1
  101. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -1
  102. package/ReactCommon/react/featureflags/tests/ReactNativeFeatureFlagsTest.cpp +4 -0
  103. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -0
  104. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -1
  105. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -1
  106. package/ReactCommon/react/renderer/attributedstring/primitives.h +0 -86
  107. package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.cpp +4 -1
  108. package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +0 -16
  109. package/ReactCommon/react/renderer/components/view/CSSTokenizer.cpp +187 -0
  110. package/ReactCommon/react/renderer/components/view/CSSTokenizer.h +101 -0
  111. package/ReactCommon/react/renderer/components/view/tests/CSSTokenizerTest.cpp +144 -0
  112. package/ReactCommon/react/renderer/core/ComponentDescriptor.h +0 -1
  113. package/ReactCommon/react/renderer/core/EventEmitter.cpp +14 -6
  114. package/ReactCommon/react/renderer/core/LayoutPrimitives.h +0 -17
  115. package/ReactCommon/react/renderer/core/graphicsConversions.h +2 -23
  116. package/ReactCommon/react/renderer/core/propsConversions.h +0 -1
  117. package/ReactCommon/react/renderer/graphics/Color.h +7 -3
  118. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +6 -1
  119. package/ReactCommon/react/renderer/graphics/fromRawValueShared.h +50 -0
  120. package/ReactCommon/react/renderer/graphics/platform/android/react/renderer/graphics/PlatformColorParser.h +18 -7
  121. package/ReactCommon/react/renderer/graphics/platform/cxx/react/renderer/graphics/PlatformColorParser.h +16 -4
  122. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +55 -15
  123. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +132 -0
  124. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.h +15 -17
  125. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/PlatformColorParser.mm +73 -0
  126. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.h +8 -2
  127. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm +14 -3
  128. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h +4 -19
  129. package/ReactCommon/react/runtime/ReactInstance.cpp +15 -2
  130. package/ReactCommon/react/runtime/ReactInstance.h +13 -2
  131. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +5 -3
  132. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +3 -1
  133. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +10 -2
  134. package/ReactCommon/react/test_utils/ios/Shims/ShimRCTInstance.mm +5 -2
  135. package/ReactCommon/react/utils/hash_combine.h +8 -6
  136. package/gradle/libs.versions.toml +1 -1
  137. package/index.js +9 -0
  138. package/package.json +9 -9
  139. package/sdks/hermesc/osx-bin/hermes +0 -0
  140. package/sdks/hermesc/osx-bin/hermesc +0 -0
  141. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  142. package/src/private/featureflags/NativeReactNativeFeatureFlags.js +2 -1
  143. package/src/private/featureflags/ReactNativeFeatureFlags.js +42 -1
  144. package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +47 -0
  145. package/template/Gemfile +3 -1
  146. package/template/package.json +5 -5
  147. package/Libraries/Performance/QuickPerformanceLogger.js +0 -155
  148. package/ReactAndroid/src/main/jni/react/jni/OnLoad.h +0 -16
@@ -5,6 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ @file:Suppress("DEPRECATION") // We want to use ReactFeatureFlags here specifically
9
+
8
10
  package com.facebook.react.defaults
9
11
 
10
12
  import com.facebook.react.common.annotations.VisibleForTesting
@@ -19,7 +21,8 @@ import com.facebook.react.config.ReactFeatureFlags
19
21
  * By default it loads a library called `appmodules`. `appmodules` is a convention used to refer to
20
22
  * the application dynamic library. If changed here should be updated also inside the template.
21
23
  *
22
- * By default it also enables both TurboModules, Fabric and Concurrent React (aka React 18)
24
+ * By default it also enables both TurboModules, Fabric and Concurrent React (aka React 18), and
25
+ * Bridgeless
23
26
  */
24
27
  object DefaultNewArchitectureEntryPoint {
25
28
  @JvmStatic
@@ -27,7 +30,7 @@ object DefaultNewArchitectureEntryPoint {
27
30
  fun load(
28
31
  turboModulesEnabled: Boolean = true,
29
32
  fabricEnabled: Boolean = true,
30
- bridgelessEnabled: Boolean = false
33
+ bridgelessEnabled: Boolean = true
31
34
  ) {
32
35
  val (isValid, errorMessage) =
33
36
  isConfigurationValid(turboModulesEnabled, fabricEnabled, bridgelessEnabled)
@@ -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<<52367278b4d0fdf7f436bd8c511d4ffe>>
7
+ * @generated SignedSource<<82a7973a820b75c46977931a8b178493>>
8
8
  */
9
9
 
10
10
  /**
@@ -31,23 +31,33 @@ object ReactNativeFeatureFlags {
31
31
  /**
32
32
  * Common flag for testing. Do NOT modify.
33
33
  */
34
+ @JvmStatic
34
35
  fun commonTestFlag() = accessor.commonTestFlag()
35
36
 
36
37
  /**
37
38
  * When enabled, it uses the modern fork of RuntimeScheduler that allows scheduling tasks with priorities from any thread.
38
39
  */
40
+ @JvmStatic
39
41
  fun useModernRuntimeScheduler() = accessor.useModernRuntimeScheduler()
40
42
 
41
43
  /**
42
44
  * Enables the use of microtasks in Hermes (scheduling) and RuntimeScheduler (execution).
43
45
  */
46
+ @JvmStatic
44
47
  fun enableMicrotasks() = accessor.enableMicrotasks()
45
48
 
46
49
  /**
47
50
  * When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
48
51
  */
52
+ @JvmStatic
49
53
  fun batchRenderingUpdatesInEventLoop() = accessor.batchRenderingUpdatesInEventLoop()
50
54
 
55
+ /**
56
+ * Uses new, deduplicated logic for constructing Android Spannables from text fragments
57
+ */
58
+ @JvmStatic
59
+ fun enableSpannableBuildingUnification() = accessor.enableSpannableBuildingUnification()
60
+
51
61
  /**
52
62
  * Overrides the feature flags with the ones provided by the given provider
53
63
  * (generally one that extends `ReactNativeFeatureFlagsDefaults`).
@@ -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<<920bb26d238f935f63a77943df7ef6e2>>
7
+ * @generated SignedSource<<881b7f9eb6b1765764b70719155a457c>>
8
8
  */
9
9
 
10
10
  /**
@@ -24,6 +24,7 @@ class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
24
24
  private var useModernRuntimeSchedulerCache: Boolean? = null
25
25
  private var enableMicrotasksCache: Boolean? = null
26
26
  private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
27
+ private var enableSpannableBuildingUnificationCache: Boolean? = null
27
28
 
28
29
  override fun commonTestFlag(): Boolean {
29
30
  var cached = commonTestFlagCache
@@ -61,6 +62,15 @@ class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
61
62
  return cached
62
63
  }
63
64
 
65
+ override fun enableSpannableBuildingUnification(): Boolean {
66
+ var cached = enableSpannableBuildingUnificationCache
67
+ if (cached == null) {
68
+ cached = ReactNativeFeatureFlagsCxxInterop.enableSpannableBuildingUnification()
69
+ enableSpannableBuildingUnificationCache = cached
70
+ }
71
+ return cached
72
+ }
73
+
64
74
  override fun override(provider: ReactNativeFeatureFlagsProvider) =
65
75
  ReactNativeFeatureFlagsCxxInterop.override(provider as Any)
66
76
 
@@ -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<<19d0606854e3e34efe67acf9dc1d26b4>>
7
+ * @generated SignedSource<<c4908662a6c752ef8dc85f7eb86d1df4>>
8
8
  */
9
9
 
10
10
  /**
@@ -36,6 +36,8 @@ object ReactNativeFeatureFlagsCxxInterop {
36
36
 
37
37
  @DoNotStrip @JvmStatic external fun batchRenderingUpdatesInEventLoop(): Boolean
38
38
 
39
+ @DoNotStrip @JvmStatic external fun enableSpannableBuildingUnification(): Boolean
40
+
39
41
  @DoNotStrip @JvmStatic external fun override(provider: Any)
40
42
 
41
43
  @DoNotStrip @JvmStatic external fun dangerouslyReset()
@@ -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<<932fd2768c81d5a5f49929c89d6659ff>>
7
+ * @generated SignedSource<<44159bbcf15dc403e40656c71d84516a>>
8
8
  */
9
9
 
10
10
  /**
@@ -30,4 +30,6 @@ open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvider {
30
30
  override fun enableMicrotasks(): Boolean = false
31
31
 
32
32
  override fun batchRenderingUpdatesInEventLoop(): Boolean = false
33
+
34
+ override fun enableSpannableBuildingUnification(): Boolean = false
33
35
  }
@@ -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<<6254686d99a8bfd0531ed629655cf673>>
7
+ * @generated SignedSource<<85d0ebc43b7c390be7dd89c58f1b7a7a>>
8
8
  */
9
9
 
10
10
  /**
@@ -28,6 +28,7 @@ class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAccessor {
28
28
  private var useModernRuntimeSchedulerCache: Boolean? = null
29
29
  private var enableMicrotasksCache: Boolean? = null
30
30
  private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
31
+ private var enableSpannableBuildingUnificationCache: Boolean? = null
31
32
 
32
33
  override fun commonTestFlag(): Boolean {
33
34
  var cached = commonTestFlagCache
@@ -69,6 +70,16 @@ class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAccessor {
69
70
  return cached
70
71
  }
71
72
 
73
+ override fun enableSpannableBuildingUnification(): Boolean {
74
+ var cached = enableSpannableBuildingUnificationCache
75
+ if (cached == null) {
76
+ cached = currentProvider.enableSpannableBuildingUnification()
77
+ accessedFeatureFlags.add("enableSpannableBuildingUnification")
78
+ enableSpannableBuildingUnificationCache = cached
79
+ }
80
+ return cached
81
+ }
82
+
72
83
  override fun override(provider: ReactNativeFeatureFlagsProvider) {
73
84
  if (accessedFeatureFlags.isNotEmpty()) {
74
85
  val accessedFeatureFlagsStr = accessedFeatureFlags.joinToString(separator = ", ") { it }
@@ -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<<c5c87368aae4df966b4b7971aadb79f2>>
7
+ * @generated SignedSource<<d5db40f4f25503513c4128892fd12e3f>>
8
8
  */
9
9
 
10
10
  /**
@@ -30,4 +30,6 @@ interface ReactNativeFeatureFlagsProvider {
30
30
  @DoNotStrip fun enableMicrotasks(): Boolean
31
31
 
32
32
  @DoNotStrip fun batchRenderingUpdatesInEventLoop(): Boolean
33
+
34
+ @DoNotStrip fun enableSpannableBuildingUnification(): Boolean
33
35
  }
@@ -31,6 +31,6 @@ class JSCExecutor internal constructor(jscConfig: ReadableNativeMap) :
31
31
  SoLoader.loadLibrary("jscexecutor")
32
32
  }
33
33
 
34
- @JvmStatic private external fun initHybrid(jscConfig: ReadableNativeMap): HybridData?
34
+ @JvmStatic private external fun initHybrid(jscConfig: ReadableNativeMap): HybridData
35
35
  }
36
36
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @generated by scripts/set-rn-version.js
3
- *
4
2
  * Copyright (c) Meta Platforms, Inc. and affiliates.
5
3
  *
6
4
  * This source code is licensed under the MIT license found in the
7
5
  * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @generated by scripts/releases/set-rn-version.js
8
8
  */
9
9
 
10
10
  package com.facebook.react.modules.systeminfo;
@@ -18,5 +18,5 @@ public class ReactNativeVersion {
18
18
  "major", 0,
19
19
  "minor", 74,
20
20
  "patch", 0,
21
- "prerelease", "nightly-20240128-cfc0ba04a");
21
+ "prerelease", "nightly-20240131-82e9a5e4f");
22
22
  }
@@ -47,6 +47,7 @@ import com.facebook.react.uimanager.ViewManager;
47
47
  import com.facebook.react.views.drawer.ReactDrawerLayoutManager;
48
48
  import com.facebook.react.views.image.ReactImageManager;
49
49
  import com.facebook.react.views.modal.ReactModalHostManager;
50
+ import com.facebook.react.views.popupmenu.ReactPopupMenuManager;
50
51
  import com.facebook.react.views.progressbar.ReactProgressBarViewManager;
51
52
  import com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager;
52
53
  import com.facebook.react.views.scroll.ReactHorizontalScrollViewManager;
@@ -170,6 +171,7 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
170
171
  viewManagers.add(new ReactScrollViewManager());
171
172
  viewManagers.add(new ReactSwitchManager());
172
173
  viewManagers.add(new SwipeRefreshLayoutManager());
174
+ viewManagers.add(new ReactPopupMenuManager());
173
175
 
174
176
  // Native equivalents
175
177
  viewManagers.add(new FrescoBasedReactTextInlineImageViewManager());
@@ -211,6 +213,7 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
211
213
  appendMap(viewManagers, ReactSwitchManager.REACT_CLASS, ReactSwitchManager::new);
212
214
  appendMap(
213
215
  viewManagers, SwipeRefreshLayoutManager.REACT_CLASS, SwipeRefreshLayoutManager::new);
216
+ appendMap(viewManagers, ReactPopupMenuManager.REACT_CLASS, ReactPopupMenuManager::new);
214
217
  appendMap(
215
218
  viewManagers,
216
219
  FrescoBasedReactTextInlineImageViewManager.REACT_CLASS,
@@ -866,12 +866,17 @@ public class NativeViewHierarchyManager {
866
866
  /**
867
867
  * Show a {@link PopupMenu}.
868
868
  *
869
+ * <p>This is deprecated, please use the <PopupMenuAndroid /> component instead.
870
+ *
871
+ * <p>TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
872
+ *
869
873
  * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this
870
874
  * needs to be the tag of a native view (shadow views can not be anchors)
871
875
  * @param items the menu items as an array of strings
872
876
  * @param success will be called with the position of the selected item as the first argument, or
873
877
  * no arguments if the menu is dismissed
874
878
  */
879
+ @Deprecated
875
880
  public synchronized void showPopupMenu(
876
881
  int reactTag, ReadableArray items, Callback success, Callback error) {
877
882
  UiThreadUtil.assertOnUiThread();
@@ -894,7 +899,14 @@ public class NativeViewHierarchyManager {
894
899
  mPopupMenu.show();
895
900
  }
896
901
 
897
- /** Dismiss the last opened PopupMenu {@link PopupMenu}. */
902
+ /**
903
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
904
+ *
905
+ * <p>TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
906
+ *
907
+ * <p>Dismiss the last opened PopupMenu {@link PopupMenu}.
908
+ */
909
+ @Deprecated
898
910
  public void dismissPopupMenu() {
899
911
  if (mPopupMenu != null) {
900
912
  mPopupMenu.dismiss();
@@ -750,6 +750,10 @@ public class UIImplementation {
750
750
  /**
751
751
  * Show a PopupMenu.
752
752
  *
753
+ * <p>This is deprecated, please use the <PopupMenuAndroid /> component instead.
754
+ *
755
+ * <p>TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
756
+ *
753
757
  * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this
754
758
  * needs to be the tag of a native view (shadow views can not be anchors)
755
759
  * @param items the menu items as an array of strings
@@ -757,6 +761,7 @@ public class UIImplementation {
757
761
  * @param success will be called with the position of the selected item as the first argument, or
758
762
  * no arguments if the menu is dismissed
759
763
  */
764
+ @Deprecated
760
765
  public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success) {
761
766
  boolean viewExists = checkOrAssertViewExists(reactTag, "showPopupMenu");
762
767
  if (!viewExists) {
@@ -766,6 +771,8 @@ public class UIImplementation {
766
771
  mOperationsQueue.enqueueShowPopupMenu(reactTag, items, error, success);
767
772
  }
768
773
 
774
+ /** TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75. */
775
+ @Deprecated
769
776
  public void dismissPopupMenu() {
770
777
  mOperationsQueue.enqueueDismissPopupMenu();
771
778
  }
@@ -618,6 +618,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule
618
618
  /**
619
619
  * Show a PopupMenu.
620
620
  *
621
+ * <p>This is deprecated, please use the <PopupMenuAndroid /> component instead.
622
+ *
623
+ * <p>TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
624
+ *
621
625
  * @param reactTag the tag of the anchor view (the PopupMenu is displayed next to this view); this
622
626
  * needs to be the tag of a native view (shadow views can not be anchors)
623
627
  * @param items the menu items as an array of strings
@@ -626,11 +630,18 @@ public class UIManagerModule extends ReactContextBaseJavaModule
626
630
  * no arguments if the menu is dismissed
627
631
  */
628
632
  @ReactMethod
633
+ @Deprecated
629
634
  public void showPopupMenu(int reactTag, ReadableArray items, Callback error, Callback success) {
630
635
  mUIImplementation.showPopupMenu(reactTag, items, error, success);
631
636
  }
632
637
 
638
+ /**
639
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
640
+ *
641
+ * <p>TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
642
+ */
633
643
  @ReactMethod
644
+ @Deprecated
634
645
  public void dismissPopupMenu() {
635
646
  mUIImplementation.dismissPopupMenu();
636
647
  }
@@ -193,7 +193,15 @@ public class UIManagerModuleConstantsHelper {
193
193
  }
194
194
  for (String oldKey : keysToNormalize) {
195
195
  Object value = events.get(oldKey);
196
- String newKey = "top" + oldKey.substring(0, 1).toUpperCase() + oldKey.substring(1);
196
+ String baseKey = "";
197
+ if (oldKey.startsWith("on")) {
198
+ // Drop "on" prefix.
199
+ baseKey = oldKey.substring(2);
200
+ } else {
201
+ // Capitalize first letter.
202
+ baseKey = oldKey.substring(0, 1).toUpperCase() + oldKey.substring(1);
203
+ }
204
+ String newKey = "top" + baseKey;
197
205
  events.put(newKey, value);
198
206
  }
199
207
  }
@@ -343,6 +343,12 @@ public class UIViewOperationQueue {
343
343
  }
344
344
  }
345
345
 
346
+ /**
347
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
348
+ *
349
+ * <p>TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
350
+ */
351
+ @Deprecated
346
352
  private final class ShowPopupMenuOperation extends ViewOperation {
347
353
 
348
354
  private final ReadableArray mItems;
@@ -362,6 +368,12 @@ public class UIViewOperationQueue {
362
368
  }
363
369
  }
364
370
 
371
+ /**
372
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
373
+ *
374
+ * <p>TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
375
+ */
376
+ @Deprecated
365
377
  private final class DismissPopupMenuOperation implements UIOperation {
366
378
  @Override
367
379
  public void execute() {
@@ -703,11 +715,23 @@ public class UIViewOperationQueue {
703
715
  mOperations.add(new UpdateViewExtraData(reactTag, extraData));
704
716
  }
705
717
 
718
+ /**
719
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
720
+ *
721
+ * <p>TODO(T175424986): Remove UIManager.showPopupMenu() in React Native v0.75.
722
+ */
723
+ @Deprecated
706
724
  public void enqueueShowPopupMenu(
707
725
  int reactTag, ReadableArray items, Callback error, Callback success) {
708
726
  mOperations.add(new ShowPopupMenuOperation(reactTag, items, error, success));
709
727
  }
710
728
 
729
+ /**
730
+ * This is deprecated, please use the <PopupMenuAndroid /> component instead.
731
+ *
732
+ * <p>TODO(T175424986): Remove UIManager.dismissPopupMenu() in React Native v0.75.
733
+ */
734
+ @Deprecated
711
735
  public void enqueueDismissPopupMenu() {
712
736
  mOperations.add(new DismissPopupMenuOperation());
713
737
  }
@@ -28,7 +28,7 @@ class ScaleTypeStartInside extends ScalingUtils.AbstractScaleType {
28
28
  float dx = parentRect.left;
29
29
  float dy = parentRect.top;
30
30
  outTransform.setScale(scale, scale);
31
- outTransform.postTranslate((dx + 0.5f), (dy + 0.5f));
31
+ outTransform.postTranslate(Math.round(dx), Math.round(dy));
32
32
  }
33
33
 
34
34
  @Override
@@ -0,0 +1,37 @@
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
+ @file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes
8
+
9
+ package com.facebook.react.views.popupmenu
10
+
11
+ import com.facebook.react.bridge.Arguments
12
+ import com.facebook.react.bridge.WritableMap
13
+ import com.facebook.react.uimanager.events.Event
14
+ import com.facebook.react.uimanager.events.RCTEventEmitter
15
+
16
+ class PopupMenuSelectionEvent(surfaceId: Int, viewId: Int, val item: Int) :
17
+ Event<PopupMenuSelectionEvent>(surfaceId, viewId) {
18
+
19
+ override fun getEventName(): String {
20
+ return EVENT_NAME
21
+ }
22
+
23
+ override fun getEventData(): WritableMap {
24
+ val eventData: WritableMap = Arguments.createMap()
25
+ eventData.putInt("target", viewTag)
26
+ eventData.putDouble("item", item.toDouble())
27
+ return eventData
28
+ }
29
+
30
+ override fun dispatch(rctEventEmitter: RCTEventEmitter) {
31
+ rctEventEmitter.receiveEvent(viewTag, eventName, eventData)
32
+ }
33
+
34
+ companion object {
35
+ const val EVENT_NAME: String = "topSelectionChange"
36
+ }
37
+ }
@@ -0,0 +1,49 @@
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.views.popupmenu
9
+
10
+ import android.content.Context
11
+ import android.os.Build
12
+ import android.view.Menu
13
+ import android.widget.FrameLayout
14
+ import android.widget.PopupMenu
15
+ import com.facebook.react.bridge.ReactContext
16
+ import com.facebook.react.bridge.ReadableArray
17
+ import com.facebook.react.uimanager.UIManagerHelper
18
+
19
+ class ReactPopupMenuContainer(context: Context) : FrameLayout(context) {
20
+ private var menuItems: ReadableArray? = null
21
+
22
+ fun setMenuItems(items: ReadableArray?) {
23
+ menuItems = items
24
+ }
25
+
26
+ fun showPopupMenu() {
27
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
28
+ val view = getChildAt(0)
29
+ val popupMenu = PopupMenu(context, view)
30
+ var menu = popupMenu.menu
31
+ val items = menuItems
32
+ if (items != null) {
33
+ for (i in 0 until items.size()) {
34
+ menu.add(Menu.NONE, Menu.NONE, i, items.getString(i))
35
+ }
36
+ }
37
+ popupMenu.setOnMenuItemClickListener { menuItem ->
38
+ val reactContext = context as ReactContext
39
+ val eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, id)
40
+ if (eventDispatcher != null) {
41
+ val surfaceId = UIManagerHelper.getSurfaceId(reactContext)
42
+ eventDispatcher.dispatchEvent(PopupMenuSelectionEvent(surfaceId, id, menuItem.order))
43
+ }
44
+ true
45
+ }
46
+ popupMenu.show()
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,54 @@
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.views.popupmenu
9
+
10
+ import com.facebook.react.bridge.ReadableArray
11
+ import com.facebook.react.module.annotations.ReactModule
12
+ import com.facebook.react.uimanager.ThemedReactContext
13
+ import com.facebook.react.uimanager.ViewGroupManager
14
+ import com.facebook.react.uimanager.annotations.ReactProp
15
+ import com.facebook.react.viewmanagers.AndroidPopupMenuManagerInterface
16
+
17
+ @ReactModule(name = ReactPopupMenuManager.REACT_CLASS)
18
+ class ReactPopupMenuManager() :
19
+ ViewGroupManager<ReactPopupMenuContainer>(),
20
+ AndroidPopupMenuManagerInterface<ReactPopupMenuContainer> {
21
+ override fun createViewInstance(reactContext: ThemedReactContext): ReactPopupMenuContainer {
22
+ return ReactPopupMenuContainer(reactContext)
23
+ }
24
+
25
+ @ReactProp(name = "menuItems")
26
+ override fun setMenuItems(view: ReactPopupMenuContainer, menuItems: ReadableArray?) {
27
+ view.setMenuItems(menuItems)
28
+ }
29
+
30
+ override fun getName(): String {
31
+ return REACT_CLASS
32
+ }
33
+
34
+ override fun receiveCommand(
35
+ view: ReactPopupMenuContainer,
36
+ commandId: String,
37
+ items: ReadableArray?
38
+ ) {
39
+ when (commandId) {
40
+ "show" -> show(view)
41
+ else -> {
42
+ // no-op
43
+ }
44
+ }
45
+ }
46
+
47
+ override fun show(popupMenu: ReactPopupMenuContainer) {
48
+ popupMenu.showPopupMenu()
49
+ }
50
+
51
+ companion object {
52
+ const val REACT_CLASS: String = "AndroidPopupMenu"
53
+ }
54
+ }
@@ -21,7 +21,7 @@ import com.facebook.infer.annotation.Assertions;
21
21
  import com.facebook.react.bridge.ReadableArray;
22
22
  import com.facebook.react.bridge.ReadableMap;
23
23
  import com.facebook.react.common.ReactConstants;
24
- import com.facebook.react.config.ReactFeatureFlags;
24
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
25
25
  import com.facebook.react.uimanager.IllegalViewOperationException;
26
26
  import com.facebook.react.uimanager.LayoutShadowNode;
27
27
  import com.facebook.react.uimanager.NativeViewHierarchyOptimizer;
@@ -93,7 +93,7 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode
93
93
  boolean supportsInlineViews,
94
94
  @Nullable Map<Integer, ReactShadowNode> inlineViews,
95
95
  int start) {
96
- if (ReactFeatureFlags.enableSpannableBuildingUnification) {
96
+ if (ReactNativeFeatureFlags.enableSpannableBuildingUnification()) {
97
97
  buildSpannedFromShadowNodeUnified(
98
98
  textShadowNode, sb, ops, parentTextAttributes, supportsInlineViews, inlineViews, start);
99
99
  } else {
@@ -31,7 +31,7 @@ import com.facebook.react.bridge.ReadableNativeMap;
31
31
  import com.facebook.react.bridge.WritableArray;
32
32
  import com.facebook.react.common.ReactConstants;
33
33
  import com.facebook.react.common.build.ReactBuildConfig;
34
- import com.facebook.react.config.ReactFeatureFlags;
34
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
35
35
  import com.facebook.react.uimanager.PixelUtil;
36
36
  import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole;
37
37
  import com.facebook.react.uimanager.ReactAccessibilityDelegate.Role;
@@ -118,7 +118,7 @@ public class TextLayoutManager {
118
118
  ReadableArray fragments,
119
119
  SpannableStringBuilder sb,
120
120
  List<SetSpanOperation> ops) {
121
- if (ReactFeatureFlags.enableSpannableBuildingUnification) {
121
+ if (ReactNativeFeatureFlags.enableSpannableBuildingUnification()) {
122
122
  buildSpannableFromFragmentsUnified(context, fragments, sb, ops);
123
123
  } else {
124
124
  buildSpannableFromFragmentsDuplicated(context, fragments, sb, ops);
@@ -32,7 +32,7 @@ import com.facebook.react.common.ReactConstants;
32
32
  import com.facebook.react.common.build.ReactBuildConfig;
33
33
  import com.facebook.react.common.mapbuffer.MapBuffer;
34
34
  import com.facebook.react.common.mapbuffer.ReadableMapBuffer;
35
- import com.facebook.react.config.ReactFeatureFlags;
35
+ import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
36
36
  import com.facebook.react.uimanager.PixelUtil;
37
37
  import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole;
38
38
  import com.facebook.react.uimanager.ReactAccessibilityDelegate.Role;
@@ -140,7 +140,7 @@ public class TextLayoutManagerMapBuffer {
140
140
 
141
141
  private static void buildSpannableFromFragments(
142
142
  Context context, MapBuffer fragments, SpannableStringBuilder sb, List<SetSpanOperation> ops) {
143
- if (ReactFeatureFlags.enableSpannableBuildingUnification) {
143
+ if (ReactNativeFeatureFlags.enableSpannableBuildingUnification()) {
144
144
  buildSpannableFromFragmentsUnified(context, fragments, sb, ops);
145
145
  } else {
146
146
  buildSpannableFromFragmentsDuplicated(context, fragments, sb, ops);
@@ -67,6 +67,8 @@ CoreComponentsRegistry::sharedProviderRegistry() {
67
67
  AndroidDrawerLayoutComponentDescriptor>());
68
68
  providerRegistry->add(concreteComponentDescriptorProvider<
69
69
  DebuggingOverlayComponentDescriptor>());
70
+ providerRegistry->add(concreteComponentDescriptorProvider<
71
+ AndroidPopupMenuComponentDescriptor>());
70
72
 
71
73
  return providerRegistry;
72
74
  }();
@@ -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<<bd4482119f1c4963aa4ad1e354f9107d>>
7
+ * @generated SignedSource<<36acddfcb6c038dbf523ad669bcedeba>>
8
8
  */
9
9
 
10
10
  /**
@@ -43,6 +43,11 @@ bool JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop(
43
43
  return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
44
44
  }
45
45
 
46
+ bool JReactNativeFeatureFlagsCxxInterop::enableSpannableBuildingUnification(
47
+ facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
48
+ return ReactNativeFeatureFlags::enableSpannableBuildingUnification();
49
+ }
50
+
46
51
  void JReactNativeFeatureFlagsCxxInterop::override(
47
52
  facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/,
48
53
  jni::alias_ref<jobject> provider) {
@@ -72,6 +77,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
72
77
  makeNativeMethod(
73
78
  "batchRenderingUpdatesInEventLoop",
74
79
  JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop),
80
+ makeNativeMethod(
81
+ "enableSpannableBuildingUnification",
82
+ JReactNativeFeatureFlagsCxxInterop::enableSpannableBuildingUnification),
75
83
  });
76
84
  }
77
85