react-native 0.82.0-nightly-20250815-41029d8e9 → 0.82.0-nightly-20250816-0e6b94f4a
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.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/api/ReactAndroid.api +2 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.kt +33 -6
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerfMonitorOverlayViewManager.kt +234 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/PerfMonitorOverlayManager.kt +26 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/PerfMonitorV2Handler.kt +22 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +8 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +6 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +11 -2
- package/ReactCommon/callinvoker/ReactCommon/tests/TestCallInvoker.h +5 -6
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/bridging/tests/BridgingTest.h +1 -1
- package/ReactCommon/react/nativemodule/core/tests/TurboModuleTestFixture.h +1 -1
- package/index.js +3 -0
- package/index.js.flow +2 -0
- package/package.json +8 -8
- package/sdks/hermes-engine/hermes-utils.rb +1 -1
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/types_generated/Libraries/NativeComponent/NativeComponentRegistry.d.ts +50 -0
- package/types_generated/index.d.ts +2 -1
|
@@ -29,7 +29,7 @@ export default class ReactNativeVersion {
|
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 82;
|
|
31
31
|
static patch: number = 0;
|
|
32
|
-
static prerelease: string | null = 'nightly-
|
|
32
|
+
static prerelease: string | null = 'nightly-20250816-0e6b94f4a';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(82),
|
|
26
26
|
RCTVersionPatch: @(0),
|
|
27
|
-
RCTVersionPrerelease: @"nightly-
|
|
27
|
+
RCTVersionPrerelease: @"nightly-20250816-0e6b94f4a",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -1965,7 +1965,7 @@ public abstract interface class com/facebook/react/devsupport/DevServerHelper$Pa
|
|
|
1965
1965
|
public abstract fun onPackagerReloadCommand ()V
|
|
1966
1966
|
}
|
|
1967
1967
|
|
|
1968
|
-
public abstract class com/facebook/react/devsupport/DevSupportManagerBase : com/facebook/react/devsupport/interfaces/DevSupportManager {
|
|
1968
|
+
public abstract class com/facebook/react/devsupport/DevSupportManagerBase : com/facebook/react/devsupport/interfaces/DevSupportManager, com/facebook/react/devsupport/interfaces/PerfMonitorV2Handler {
|
|
1969
1969
|
public static final field Companion Lcom/facebook/react/devsupport/DevSupportManagerBase$Companion;
|
|
1970
1970
|
public fun <init> (Landroid/content/Context;Lcom/facebook/react/devsupport/ReactInstanceDevHelper;Ljava/lang/String;ZLcom/facebook/react/devsupport/interfaces/RedBoxHandler;Lcom/facebook/react/devsupport/interfaces/DevBundleDownloadListener;ILjava/util/Map;Lcom/facebook/react/common/SurfaceDelegateFactory;Lcom/facebook/react/devsupport/interfaces/DevLoadingViewManager;Lcom/facebook/react/devsupport/interfaces/PausedInDebuggerOverlayManager;)V
|
|
1971
1971
|
public fun addCustomDevOption (Ljava/lang/String;Lcom/facebook/react/devsupport/interfaces/DevOptionHandler;)V
|
|
@@ -2023,6 +2023,7 @@ public abstract class com/facebook/react/devsupport/DevSupportManagerBase : com/
|
|
|
2023
2023
|
public fun startInspector ()V
|
|
2024
2024
|
public fun stopInspector ()V
|
|
2025
2025
|
public fun toggleElementInspector ()V
|
|
2026
|
+
public fun unstable_updatePerfMonitor (Ljava/lang/String;I)V
|
|
2026
2027
|
}
|
|
2027
2028
|
|
|
2028
2029
|
public abstract interface class com/facebook/react/devsupport/DevSupportManagerBase$CallbackWithBundleLoader {
|
|
@@ -62,8 +62,12 @@ import com.facebook.react.devsupport.interfaces.ErrorCustomizer
|
|
|
62
62
|
import com.facebook.react.devsupport.interfaces.ErrorType
|
|
63
63
|
import com.facebook.react.devsupport.interfaces.PackagerStatusCallback
|
|
64
64
|
import com.facebook.react.devsupport.interfaces.PausedInDebuggerOverlayManager
|
|
65
|
+
import com.facebook.react.devsupport.interfaces.PerfMonitorOverlayManager
|
|
66
|
+
import com.facebook.react.devsupport.interfaces.PerfMonitorV2Handler
|
|
65
67
|
import com.facebook.react.devsupport.interfaces.RedBoxHandler
|
|
66
68
|
import com.facebook.react.devsupport.interfaces.StackFrame
|
|
69
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
70
|
+
import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatureFlags
|
|
67
71
|
import com.facebook.react.modules.core.RCTNativeAppEventEmitter
|
|
68
72
|
import com.facebook.react.modules.debug.interfaces.DeveloperSettings
|
|
69
73
|
import com.facebook.react.packagerconnection.RequestHandler
|
|
@@ -84,7 +88,7 @@ public abstract class DevSupportManagerBase(
|
|
|
84
88
|
private val surfaceDelegateFactory: SurfaceDelegateFactory?,
|
|
85
89
|
public var devLoadingViewManager: DevLoadingViewManager?,
|
|
86
90
|
private var pausedInDebuggerOverlayManager: PausedInDebuggerOverlayManager?,
|
|
87
|
-
) : DevSupportManager {
|
|
91
|
+
) : DevSupportManager, PerfMonitorV2Handler {
|
|
88
92
|
|
|
89
93
|
public interface CallbackWithBundleLoader {
|
|
90
94
|
public fun onSuccess(bundleLoader: JSBundleLoader)
|
|
@@ -176,6 +180,8 @@ public abstract class DevSupportManagerBase(
|
|
|
176
180
|
null
|
|
177
181
|
}
|
|
178
182
|
|
|
183
|
+
private var perfMonitorOverlayManager: PerfMonitorOverlayManager? = null
|
|
184
|
+
|
|
179
185
|
init {
|
|
180
186
|
// We store JS bundle loaded from dev server in a single destination in app's data dir.
|
|
181
187
|
// In case when someone schedule 2 subsequent reloads it may happen that JS thread will
|
|
@@ -202,6 +208,20 @@ public abstract class DevSupportManagerBase(
|
|
|
202
208
|
context
|
|
203
209
|
})
|
|
204
210
|
}
|
|
211
|
+
if (ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture() &&
|
|
212
|
+
ReactNativeFeatureFlags.perfMonitorV2Enabled() &&
|
|
213
|
+
perfMonitorOverlayManager == null) {
|
|
214
|
+
perfMonitorOverlayManager =
|
|
215
|
+
PerfMonitorOverlayViewManager(
|
|
216
|
+
Supplier {
|
|
217
|
+
val context = reactInstanceDevHelper.currentActivity
|
|
218
|
+
if (context == null || context.isFinishing) {
|
|
219
|
+
return@Supplier null
|
|
220
|
+
}
|
|
221
|
+
context
|
|
222
|
+
},
|
|
223
|
+
{ openDebugger() })
|
|
224
|
+
}
|
|
205
225
|
}
|
|
206
226
|
|
|
207
227
|
override fun handleException(e: Exception) {
|
|
@@ -793,11 +813,14 @@ public abstract class DevSupportManagerBase(
|
|
|
793
813
|
devLoadingViewManager?.showMessage("Reloading...")
|
|
794
814
|
}
|
|
795
815
|
|
|
816
|
+
perfMonitorOverlayManager?.reset()
|
|
817
|
+
|
|
796
818
|
devServerHelper.openPackagerConnection(
|
|
797
819
|
javaClass.simpleName,
|
|
798
820
|
object : PackagerCommandListener {
|
|
799
821
|
override fun onPackagerConnected() {
|
|
800
822
|
isPackagerConnected = true
|
|
823
|
+
perfMonitorOverlayManager?.enable()
|
|
801
824
|
}
|
|
802
825
|
|
|
803
826
|
override fun onPackagerDisconnected() {
|
|
@@ -837,14 +860,11 @@ public abstract class DevSupportManagerBase(
|
|
|
837
860
|
isReceiverRegistered = false
|
|
838
861
|
}
|
|
839
862
|
|
|
840
|
-
// hide redbox dialog
|
|
841
863
|
hideRedboxDialog()
|
|
842
|
-
|
|
843
|
-
// hide dev options dialog
|
|
844
864
|
hideDevOptionsDialog()
|
|
845
|
-
|
|
846
|
-
// hide loading view
|
|
847
865
|
devLoadingViewManager?.hide()
|
|
866
|
+
perfMonitorOverlayManager?.reset()
|
|
867
|
+
|
|
848
868
|
devServerHelper.closePackagerConnection()
|
|
849
869
|
}
|
|
850
870
|
}
|
|
@@ -902,6 +922,13 @@ public abstract class DevSupportManagerBase(
|
|
|
902
922
|
pausedInDebuggerOverlayManager?.hidePausedInDebuggerOverlay()
|
|
903
923
|
}
|
|
904
924
|
|
|
925
|
+
override fun unstable_updatePerfMonitor(
|
|
926
|
+
interactionName: String,
|
|
927
|
+
durationMs: Int,
|
|
928
|
+
) {
|
|
929
|
+
perfMonitorOverlayManager?.update(interactionName, durationMs)
|
|
930
|
+
}
|
|
931
|
+
|
|
905
932
|
override fun setAdditionalOptionForPackager(name: String, value: String) {
|
|
906
933
|
devSettings.packagerConnectionSettings.setAdditionalOptionForPackager(name, value)
|
|
907
934
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/devsupport/PerfMonitorOverlayViewManager.kt
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
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.devsupport
|
|
9
|
+
|
|
10
|
+
import android.app.Dialog
|
|
11
|
+
import android.content.Context
|
|
12
|
+
import android.graphics.Color
|
|
13
|
+
import android.graphics.Typeface
|
|
14
|
+
import android.graphics.drawable.ColorDrawable
|
|
15
|
+
import android.graphics.drawable.GradientDrawable
|
|
16
|
+
import android.view.Gravity
|
|
17
|
+
import android.view.Window
|
|
18
|
+
import android.view.WindowManager
|
|
19
|
+
import android.widget.LinearLayout
|
|
20
|
+
import android.widget.TextView
|
|
21
|
+
import androidx.core.util.Supplier
|
|
22
|
+
import androidx.core.view.ViewCompat
|
|
23
|
+
import androidx.core.view.WindowInsetsCompat
|
|
24
|
+
import com.facebook.react.R
|
|
25
|
+
import com.facebook.react.bridge.UiThreadUtil
|
|
26
|
+
import com.facebook.react.devsupport.interfaces.PerfMonitorOverlayManager
|
|
27
|
+
import com.facebook.react.uimanager.DisplayMetricsHolder
|
|
28
|
+
import com.facebook.react.uimanager.PixelUtil
|
|
29
|
+
import java.util.Locale
|
|
30
|
+
|
|
31
|
+
internal class PerfMonitorOverlayViewManager(
|
|
32
|
+
private val contextSupplier: Supplier<Context?>,
|
|
33
|
+
private val onRequestAnalyzeTrace: () -> Unit
|
|
34
|
+
) : PerfMonitorOverlayManager {
|
|
35
|
+
private var initialized: Boolean = false
|
|
36
|
+
private var enabled: Boolean = false
|
|
37
|
+
private var hasInteractionData: Boolean = false
|
|
38
|
+
private var interactionDialog: Dialog? = null
|
|
39
|
+
private var buttonDialog: Dialog? = null
|
|
40
|
+
private var interactionNameLabel: TextView? = null
|
|
41
|
+
private var durationLabel: TextView? = null
|
|
42
|
+
|
|
43
|
+
override fun enable() {
|
|
44
|
+
UiThreadUtil.runOnUiThread {
|
|
45
|
+
enabled = true
|
|
46
|
+
if (hasInteractionData) {
|
|
47
|
+
showOverlay()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
override fun disable() {
|
|
53
|
+
UiThreadUtil.runOnUiThread {
|
|
54
|
+
enabled = false
|
|
55
|
+
hideOverlay()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun reset() {
|
|
60
|
+
UiThreadUtil.runOnUiThread {
|
|
61
|
+
hasInteractionData = false
|
|
62
|
+
hideOverlay()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
override fun update(interactionName: String, durationMs: Int) {
|
|
67
|
+
UiThreadUtil.runOnUiThread {
|
|
68
|
+
ensureInitialized()
|
|
69
|
+
interactionNameLabel?.text = interactionName
|
|
70
|
+
durationLabel?.text = String.format(Locale.US, "%d ms", durationMs)
|
|
71
|
+
hasInteractionData = true
|
|
72
|
+
if (enabled) {
|
|
73
|
+
showOverlay()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private fun ensureInitialized() {
|
|
79
|
+
if (initialized) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
val context = contextSupplier.get() ?: return
|
|
83
|
+
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(context)
|
|
84
|
+
createDialog(context)
|
|
85
|
+
createButton(context)
|
|
86
|
+
initialized = true
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private fun showOverlay() {
|
|
90
|
+
interactionDialog?.show()
|
|
91
|
+
buttonDialog?.show()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private fun hideOverlay() {
|
|
95
|
+
interactionDialog?.hide()
|
|
96
|
+
buttonDialog?.hide()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private fun createDialog(context: Context) {
|
|
100
|
+
val containerLayout = createInnerLayout(context)
|
|
101
|
+
interactionNameLabel =
|
|
102
|
+
TextView(context).apply {
|
|
103
|
+
textSize = TEXT_SIZE_PRIMARY
|
|
104
|
+
setTextColor(Color.WHITE)
|
|
105
|
+
typeface = TYPEFACE_BOLD
|
|
106
|
+
}
|
|
107
|
+
durationLabel =
|
|
108
|
+
TextView(context).apply {
|
|
109
|
+
textSize = TEXT_SIZE_PRIMARY
|
|
110
|
+
setTextColor(COLOR_TEXT_GREEN)
|
|
111
|
+
typeface = TYPEFACE_BOLD
|
|
112
|
+
}
|
|
113
|
+
containerLayout.addView(interactionNameLabel)
|
|
114
|
+
containerLayout.addView(durationLabel)
|
|
115
|
+
|
|
116
|
+
val dialog =
|
|
117
|
+
createAnchoredDialog(context, dpToPx(140f), dpToPx(16f)).apply {
|
|
118
|
+
setContentView(containerLayout)
|
|
119
|
+
}
|
|
120
|
+
dialog.window?.apply {
|
|
121
|
+
attributes =
|
|
122
|
+
attributes?.apply {
|
|
123
|
+
flags =
|
|
124
|
+
flags or
|
|
125
|
+
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE or
|
|
126
|
+
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.interactionDialog = dialog
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private fun createButton(context: Context) {
|
|
134
|
+
val buttonInner = createInnerLayout(context)
|
|
135
|
+
buttonInner.addView(
|
|
136
|
+
TextView(context).apply {
|
|
137
|
+
text = "Analyze"
|
|
138
|
+
textSize = TEXT_SIZE_PRIMARY
|
|
139
|
+
setTextColor(Color.WHITE)
|
|
140
|
+
typeface = TYPEFACE_BOLD
|
|
141
|
+
})
|
|
142
|
+
buttonInner.addView(
|
|
143
|
+
TextView(context).apply {
|
|
144
|
+
text = "cmd + A"
|
|
145
|
+
textSize = TEXT_SIZE_ACCESSORY
|
|
146
|
+
setTextColor(Color.WHITE)
|
|
147
|
+
alpha = 0.7f
|
|
148
|
+
typeface = TYPEFACE_BOLD
|
|
149
|
+
})
|
|
150
|
+
val buttonView =
|
|
151
|
+
LinearLayout(context).apply {
|
|
152
|
+
orientation = LinearLayout.VERTICAL
|
|
153
|
+
setPadding(
|
|
154
|
+
dpToPx(8f).toInt(), dpToPx(16f).toInt(), dpToPx(16f).toInt(), dpToPx(8f).toInt())
|
|
155
|
+
addView(buttonInner)
|
|
156
|
+
setOnClickListener { onRequestAnalyzeTrace() }
|
|
157
|
+
}
|
|
158
|
+
val dialog =
|
|
159
|
+
createAnchoredDialog(context, dpToPx(0f), dpToPx(0f)).apply { setContentView(buttonView) }
|
|
160
|
+
dialog.window?.apply {
|
|
161
|
+
attributes =
|
|
162
|
+
attributes?.apply { flags = flags or WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE }
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
this.buttonDialog = dialog
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
private fun createAnchoredDialog(context: Context, offsetX: Float, offsetY: Float): Dialog {
|
|
169
|
+
val dialog =
|
|
170
|
+
Dialog(context, R.style.NoAnimationDialog).apply {
|
|
171
|
+
requestWindowFeature(Window.FEATURE_NO_TITLE)
|
|
172
|
+
window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
|
173
|
+
window?.setDimAmount(0f)
|
|
174
|
+
setCancelable(false)
|
|
175
|
+
}
|
|
176
|
+
dialog.window?.apply {
|
|
177
|
+
attributes =
|
|
178
|
+
attributes?.apply {
|
|
179
|
+
width = WindowManager.LayoutParams.WRAP_CONTENT
|
|
180
|
+
height = WindowManager.LayoutParams.WRAP_CONTENT
|
|
181
|
+
gravity = Gravity.TOP or Gravity.END
|
|
182
|
+
x = offsetX.toInt()
|
|
183
|
+
y = offsetY.toInt()
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
dialog.window?.decorView?.let { decorView ->
|
|
187
|
+
ViewCompat.setOnApplyWindowInsetsListener(decorView) { view, windowInsets ->
|
|
188
|
+
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
|
|
189
|
+
val layoutParams = (view.layoutParams as WindowManager.LayoutParams)
|
|
190
|
+
layoutParams.y = insets.top + offsetY.toInt()
|
|
191
|
+
dialog.window?.attributes = layoutParams
|
|
192
|
+
WindowInsetsCompat.CONSUMED
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return dialog
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
private fun createInnerLayout(context: Context): LinearLayout {
|
|
200
|
+
return LinearLayout(context).apply {
|
|
201
|
+
orientation = LinearLayout.HORIZONTAL
|
|
202
|
+
gravity = Gravity.CENTER_VERTICAL
|
|
203
|
+
val paddingHorizontal = dpToPx(14f).toInt()
|
|
204
|
+
val paddingVertical = dpToPx(8f).toInt()
|
|
205
|
+
setPadding(paddingHorizontal, paddingVertical, paddingHorizontal, paddingVertical)
|
|
206
|
+
layoutParams =
|
|
207
|
+
LinearLayout.LayoutParams(
|
|
208
|
+
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)
|
|
209
|
+
background =
|
|
210
|
+
GradientDrawable().apply {
|
|
211
|
+
shape = GradientDrawable.RECTANGLE
|
|
212
|
+
setColor(Color.BLACK)
|
|
213
|
+
cornerRadius = dpToPx(14.5f)
|
|
214
|
+
alpha = (0.8 * 255).toInt()
|
|
215
|
+
setStroke(dpToPx(1f).toInt(), COLOR_OVERLAY_BORDER)
|
|
216
|
+
}
|
|
217
|
+
showDividers = LinearLayout.SHOW_DIVIDER_MIDDLE
|
|
218
|
+
dividerDrawable =
|
|
219
|
+
object : ColorDrawable(Color.TRANSPARENT) {
|
|
220
|
+
override fun getIntrinsicWidth(): Int = dpToPx(8f).toInt()
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private fun dpToPx(dp: Float): Float = PixelUtil.toPixelFromDIP(dp)
|
|
226
|
+
|
|
227
|
+
companion object {
|
|
228
|
+
private val COLOR_TEXT_GREEN = Color.parseColor("#4AEB2F")
|
|
229
|
+
private val COLOR_OVERLAY_BORDER = Color.parseColor("#6C6C6C")
|
|
230
|
+
private val TEXT_SIZE_PRIMARY = 13f
|
|
231
|
+
private val TEXT_SIZE_ACCESSORY = 9f
|
|
232
|
+
private val TYPEFACE_BOLD = Typeface.create("sans-serif", Typeface.BOLD)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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.devsupport.interfaces
|
|
9
|
+
|
|
10
|
+
/** [Experimental] Interface to manage the V2 Perf Monitor overlay. */
|
|
11
|
+
internal interface PerfMonitorOverlayManager {
|
|
12
|
+
/** Enable the Perf Monitor overlay. Will be shown when updates are received. */
|
|
13
|
+
public fun enable()
|
|
14
|
+
|
|
15
|
+
/** Disable the Perf Monitor overlay. Will remain hidden when updates are received. */
|
|
16
|
+
public fun disable()
|
|
17
|
+
|
|
18
|
+
/** Reset the Perf Monitor overlay, e.g. after a reload. */
|
|
19
|
+
public fun reset()
|
|
20
|
+
|
|
21
|
+
/** Update the state of the Perf Monitor overlay. */
|
|
22
|
+
public fun update(
|
|
23
|
+
interactionName: String,
|
|
24
|
+
durationMs: Int,
|
|
25
|
+
)
|
|
26
|
+
}
|
package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/PerfMonitorV2Handler.kt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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.devsupport.interfaces
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* [Experimental] Interface used by [com.facebook.react.devsupport.BridgeDevSupportManagerBase]
|
|
12
|
+
* implement the UI for the V2 Perf Monitor overlay.
|
|
13
|
+
*/
|
|
14
|
+
internal interface PerfMonitorV2Handler {
|
|
15
|
+
|
|
16
|
+
/** [Experimental] Update the V2 Perf Monitor overlay with the given data. */
|
|
17
|
+
// FIXME(T233950466): Refactor ReactHostImpl/DevSupport setup to avoid this public API addition
|
|
18
|
+
public fun unstable_updatePerfMonitor(
|
|
19
|
+
interactionName: String,
|
|
20
|
+
durationMs: Int,
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -47,6 +47,7 @@ import com.facebook.react.devsupport.inspector.InspectorNetworkRequestListener
|
|
|
47
47
|
import com.facebook.react.devsupport.interfaces.BundleLoadCallback
|
|
48
48
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
49
49
|
import com.facebook.react.devsupport.interfaces.DevSupportManager.PausedInDebuggerOverlayCommandListener
|
|
50
|
+
import com.facebook.react.devsupport.interfaces.PerfMonitorV2Handler
|
|
50
51
|
import com.facebook.react.fabric.ComponentFactory
|
|
51
52
|
import com.facebook.react.fabric.FabricUIManager
|
|
52
53
|
import com.facebook.react.interfaces.TaskInterface
|
|
@@ -418,6 +419,13 @@ public class ReactHostImpl(
|
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
|
|
422
|
+
@DoNotStrip
|
|
423
|
+
private fun unstable_updatePerfMonitor(interactionName: String, durationMs: Int) {
|
|
424
|
+
if (devSupportManager is PerfMonitorV2Handler) {
|
|
425
|
+
devSupportManager.unstable_updatePerfMonitor(interactionName, durationMs)
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
421
429
|
@get:DoNotStrip
|
|
422
430
|
private val hostMetadata: Map<String, String?>
|
|
423
431
|
get() = AndroidInfoHelpers.getInspectorHostMetadata(context)
|
|
@@ -128,7 +128,12 @@ void JReactHostInspectorTarget::onSetPausedInDebuggerMessage(
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
void JReactHostInspectorTarget::unstable_onPerfMonitorUpdate(
|
|
131
|
-
const PerfMonitorUpdateRequest&
|
|
131
|
+
const PerfMonitorUpdateRequest& request) {
|
|
132
|
+
if (auto javaReactHostImplStrong = javaReactHostImpl_->get()) {
|
|
133
|
+
javaReactHostImplStrong->unstable_updatePerfMonitor(
|
|
134
|
+
request.interactionName, request.durationMs);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
132
137
|
|
|
133
138
|
void JReactHostInspectorTarget::loadNetworkResource(
|
|
134
139
|
const jsinspector_modern::LoadNetworkResourceRequest& params,
|
|
@@ -38,6 +38,15 @@ struct JReactHostImpl : public jni::JavaClass<JReactHostImpl> {
|
|
|
38
38
|
method(self(), message ? jni::make_jstring(*message) : nullptr);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
void unstable_updatePerfMonitor(
|
|
42
|
+
const std::string& interactionName,
|
|
43
|
+
uint16_t durationMs) {
|
|
44
|
+
static auto method =
|
|
45
|
+
javaClassStatic()->getMethod<void(jni::local_ref<jni::JString>, jint)>(
|
|
46
|
+
"unstable_updatePerfMonitor");
|
|
47
|
+
method(self(), jni::make_jstring(interactionName), durationMs);
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
jni::local_ref<jni::JMap<jstring, jstring>> getHostMetadata() const {
|
|
42
51
|
static auto method =
|
|
43
52
|
javaClassStatic()
|
|
@@ -83,9 +92,9 @@ class JReactHostInspectorTarget
|
|
|
83
92
|
jsinspector_modern::HostTargetMetadata getMetadata() override;
|
|
84
93
|
void onReload(const PageReloadRequest& request) override;
|
|
85
94
|
void onSetPausedInDebuggerMessage(
|
|
86
|
-
const OverlaySetPausedInDebuggerMessageRequest&) override;
|
|
95
|
+
const OverlaySetPausedInDebuggerMessageRequest& request) override;
|
|
87
96
|
void unstable_onPerfMonitorUpdate(
|
|
88
|
-
const PerfMonitorUpdateRequest&
|
|
97
|
+
const PerfMonitorUpdateRequest& request) override;
|
|
89
98
|
void loadNetworkResource(
|
|
90
99
|
const jsinspector_modern::LoadNetworkResourceRequest& params,
|
|
91
100
|
jsinspector_modern::ScopedExecutor<
|
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
#include <ReactCommon/CallInvoker.h>
|
|
11
11
|
#include <jsi/jsi.h>
|
|
12
12
|
#include <list>
|
|
13
|
-
#include <memory>
|
|
14
13
|
|
|
15
14
|
namespace facebook::react {
|
|
16
15
|
|
|
17
16
|
class TestCallInvoker : public CallInvoker {
|
|
18
17
|
public:
|
|
19
|
-
explicit TestCallInvoker(
|
|
18
|
+
explicit TestCallInvoker(facebook::jsi::Runtime& runtime)
|
|
20
19
|
: runtime_(runtime) {}
|
|
21
20
|
|
|
22
21
|
void invokeAsync(CallFunc&& func) noexcept override {
|
|
@@ -24,14 +23,14 @@ class TestCallInvoker : public CallInvoker {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
void invokeSync(CallFunc&& func) override {
|
|
27
|
-
func(
|
|
26
|
+
func(runtime_);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
void flushQueue() {
|
|
31
30
|
while (!queue_.empty()) {
|
|
32
|
-
queue_.front()(
|
|
31
|
+
queue_.front()(runtime_);
|
|
33
32
|
queue_.pop_front();
|
|
34
|
-
runtime_
|
|
33
|
+
runtime_.drainMicrotasks(); // Run microtasks every cycle.
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -40,8 +39,8 @@ class TestCallInvoker : public CallInvoker {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
private:
|
|
42
|
+
facebook::jsi::Runtime& runtime_;
|
|
43
43
|
std::list<CallFunc> queue_{};
|
|
44
|
-
std::shared_ptr<facebook::jsi::Runtime> runtime_{};
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
} // namespace facebook::react
|
|
@@ -22,7 +22,7 @@ constexpr struct {
|
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 82;
|
|
24
24
|
int32_t Patch = 0;
|
|
25
|
-
std::string_view Prerelease = "nightly-
|
|
25
|
+
std::string_view Prerelease = "nightly-20250816-0e6b94f4a";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
|
28
28
|
} // namespace facebook::react
|
|
@@ -31,7 +31,7 @@ class BridgingTest : public ::testing::Test {
|
|
|
31
31
|
.withMicrotaskQueue(true)
|
|
32
32
|
.build())),
|
|
33
33
|
rt(*runtime),
|
|
34
|
-
invoker(std::make_shared<TestCallInvoker>(runtime)) {}
|
|
34
|
+
invoker(std::make_shared<TestCallInvoker>(*runtime)) {}
|
|
35
35
|
|
|
36
36
|
~BridgingTest() override {
|
|
37
37
|
LongLivedObjectCollection::get(rt).clear();
|
|
@@ -27,7 +27,7 @@ class TurboModuleTestFixture : public ::testing::Test {
|
|
|
27
27
|
public:
|
|
28
28
|
explicit TurboModuleTestFixture(Args... args)
|
|
29
29
|
: runtime_(hermes::makeHermesRuntime()),
|
|
30
|
-
jsInvoker_(std::make_shared<TestCallInvoker>(runtime_)),
|
|
30
|
+
jsInvoker_(std::make_shared<TestCallInvoker>(*runtime_)),
|
|
31
31
|
module_(std::make_shared<T>(jsInvoker_, std::forward<Args>(args)...)) {}
|
|
32
32
|
|
|
33
33
|
void SetUp() override {
|
package/index.js
CHANGED
|
@@ -241,6 +241,9 @@ module.exports = {
|
|
|
241
241
|
get NativeAppEventEmitter() {
|
|
242
242
|
return require('./Libraries/EventEmitter/RCTNativeAppEventEmitter').default;
|
|
243
243
|
},
|
|
244
|
+
get NativeComponentRegistry() {
|
|
245
|
+
return require('./Libraries/NativeComponent/NativeComponentRegistry');
|
|
246
|
+
},
|
|
244
247
|
get NativeDialogManagerAndroid() {
|
|
245
248
|
return require('./Libraries/NativeModules/specs/NativeDialogManagerAndroid')
|
|
246
249
|
.default;
|
package/index.js.flow
CHANGED
|
@@ -311,6 +311,8 @@ export {default as LogBox} from './Libraries/LogBox/LogBox';
|
|
|
311
311
|
|
|
312
312
|
export {default as NativeAppEventEmitter} from './Libraries/EventEmitter/RCTNativeAppEventEmitter';
|
|
313
313
|
|
|
314
|
+
export * as NativeComponentRegistry from './Libraries/NativeComponent/NativeComponentRegistry';
|
|
315
|
+
|
|
314
316
|
export {default as NativeDialogManagerAndroid} from './Libraries/NativeModules/specs/NativeDialogManagerAndroid';
|
|
315
317
|
|
|
316
318
|
export type {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.82.0-nightly-
|
|
3
|
+
"version": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -162,13 +162,13 @@
|
|
|
162
162
|
},
|
|
163
163
|
"dependencies": {
|
|
164
164
|
"@jest/create-cache-key-function": "^29.7.0",
|
|
165
|
-
"@react-native/assets-registry": "0.82.0-nightly-
|
|
166
|
-
"@react-native/codegen": "0.82.0-nightly-
|
|
167
|
-
"@react-native/community-cli-plugin": "0.82.0-nightly-
|
|
168
|
-
"@react-native/gradle-plugin": "0.82.0-nightly-
|
|
169
|
-
"@react-native/js-polyfills": "0.82.0-nightly-
|
|
170
|
-
"@react-native/normalize-colors": "0.82.0-nightly-
|
|
171
|
-
"@react-native/virtualized-lists": "0.82.0-nightly-
|
|
165
|
+
"@react-native/assets-registry": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
166
|
+
"@react-native/codegen": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
167
|
+
"@react-native/community-cli-plugin": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
168
|
+
"@react-native/gradle-plugin": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
169
|
+
"@react-native/js-polyfills": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
170
|
+
"@react-native/normalize-colors": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
171
|
+
"@react-native/virtualized-lists": "0.82.0-nightly-20250816-0e6b94f4a",
|
|
172
172
|
"abort-controller": "^3.0.0",
|
|
173
173
|
"anser": "^1.4.9",
|
|
174
174
|
"ansi-regex": "^5.0.0",
|
|
@@ -204,7 +204,7 @@ def hermestag_file(react_native_path)
|
|
|
204
204
|
end
|
|
205
205
|
|
|
206
206
|
def release_tarball_url(version, build_type)
|
|
207
|
-
## You can use the `ENTERPRISE_REPOSITORY`
|
|
207
|
+
## You can use the `ENTERPRISE_REPOSITORY` variable to customise the base url from which artifacts will be downloaded.
|
|
208
208
|
## The mirror's structure must be the same of the Maven repo the react-native core team publishes on Maven Central.
|
|
209
209
|
maven_repo_url =
|
|
210
210
|
ENV['ENTERPRISE_REPOSITORY'] != nil && ENV['ENTERPRISE_REPOSITORY'] != "" ?
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
* @generated SignedSource<<c151a9bc6e5de92d9ca8bc683bed8ba0>>
|
|
8
|
+
*
|
|
9
|
+
* This file was translated from Flow by scripts/js-api/build-types/index.js.
|
|
10
|
+
* Original file: packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { HostComponent } from "../../src/private/types/HostComponent";
|
|
14
|
+
import type { PartialViewConfig } from "../Renderer/shims/ReactNativeTypes";
|
|
15
|
+
import * as React from "react";
|
|
16
|
+
/**
|
|
17
|
+
* Configures a function that is called to determine whether a given component
|
|
18
|
+
* should be registered using reflection of the native component at runtime.
|
|
19
|
+
*
|
|
20
|
+
* The provider should return null if the native component is unavailable in
|
|
21
|
+
* the current environment.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setRuntimeConfigProvider(runtimeConfigProvider: (name: string) => null | undefined | {
|
|
24
|
+
native: boolean;
|
|
25
|
+
verify: boolean;
|
|
26
|
+
}): void;
|
|
27
|
+
/**
|
|
28
|
+
* Gets a `NativeComponent` that can be rendered by React Native.
|
|
29
|
+
*
|
|
30
|
+
* The supplied `viewConfigProvider` may or may not be invoked and utilized,
|
|
31
|
+
* depending on how `setRuntimeConfigProvider` is configured.
|
|
32
|
+
*/
|
|
33
|
+
export declare function get<Config extends {}>(name: string, viewConfigProvider: () => PartialViewConfig): HostComponent<Config>;
|
|
34
|
+
/**
|
|
35
|
+
* Same as `NativeComponentRegistry.get(...)`, except this will check either
|
|
36
|
+
* the `setRuntimeConfigProvider` configuration or use native reflection (slow)
|
|
37
|
+
* to determine whether this native component is available.
|
|
38
|
+
*
|
|
39
|
+
* If the native component is not available, a stub component is returned. Note
|
|
40
|
+
* that the return value of this is not `HostComponent` because the returned
|
|
41
|
+
* component instance is not guaranteed to have native methods.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getWithFallback_DEPRECATED<Config extends {}>(name: string, viewConfigProvider: () => PartialViewConfig): React.ComponentType<Config>;
|
|
44
|
+
/**
|
|
45
|
+
* Unstable API. Do not use!
|
|
46
|
+
*
|
|
47
|
+
* This method returns if there is a StaticViewConfig registered for the
|
|
48
|
+
* component name received as a parameter.
|
|
49
|
+
*/
|
|
50
|
+
export declare function unstable_hasStaticViewConfig(name: string): boolean;
|
|
@@ -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<<
|
|
7
|
+
* @generated SignedSource<<1b2686d01e2a15e1ee33d21283e05e5f>>
|
|
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/index.js.flow
|
|
@@ -108,6 +108,7 @@ export { default as Linking } from "./Libraries/Linking/Linking";
|
|
|
108
108
|
export type { ExtendedExceptionData, IgnorePattern, LogData } from "./Libraries/LogBox/LogBox";
|
|
109
109
|
export { default as LogBox } from "./Libraries/LogBox/LogBox";
|
|
110
110
|
export { default as NativeAppEventEmitter } from "./Libraries/EventEmitter/RCTNativeAppEventEmitter";
|
|
111
|
+
export * as NativeComponentRegistry from "./Libraries/NativeComponent/NativeComponentRegistry";
|
|
111
112
|
export { default as NativeDialogManagerAndroid } from "./Libraries/NativeModules/specs/NativeDialogManagerAndroid";
|
|
112
113
|
export type { EventSubscription, EmitterSubscription, NativeEventSubscription } from "./Libraries/EventEmitter/NativeEventEmitter";
|
|
113
114
|
export { default as NativeEventEmitter } from "./Libraries/EventEmitter/NativeEventEmitter";
|