react-native-tvos 0.83.4-1 → 0.83.6-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.
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.d.ts +7 -0
- package/Libraries/Components/ScrollView/ScrollView.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Utilities/Appearance.js +6 -1
- package/Libraries/Utilities/HMRClient.js +28 -1
- package/README.md +52 -0
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTDevLoadingView.mm +17 -0
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +16 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +78 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +32 -6
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
- package/ReactAndroid/api/ReactAndroid.api +0 -9
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/BridgelessDevSupportManager.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +275 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/TracingState.kt +17 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/TracingStateListener.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/{interfaces → inspector}/TracingStateProvider.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorInspectorTargetBinding.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayManager.kt +4 -4
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorOverlayView.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/perfmonitor/PerfMonitorUpdateListener.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +6 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +20 -19
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.kt +6 -12
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +86 -4
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImplDevHelper.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostInspectorTarget.kt +10 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/UiModeUtils.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +70 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +48 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +28 -3
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +196 -17
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +168 -18
- package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/hermes/inspector-modern/chrome/Registration.cpp +44 -2
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +45 -10
- package/ReactCommon/jsinspector-modern/HostAgent.h +2 -2
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +14 -7
- package/ReactCommon/jsinspector-modern/HostTarget.h +101 -14
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +39 -8
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h +42 -5
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +54 -21
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +89 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +12 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +12 -0
- package/ReactCommon/jsinspector-modern/InspectorInterfaces.cpp +3 -7
- package/ReactCommon/jsinspector-modern/InstanceAgent.cpp +2 -11
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
- package/ReactCommon/jsinspector-modern/TracingAgent.cpp +29 -13
- package/ReactCommon/jsinspector-modern/TracingAgent.h +5 -4
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +65 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +23 -2
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +335 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.h +95 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +61 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h +43 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +165 -0
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +50 -0
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +16 -14
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
- package/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h +158 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEvent.h +2 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +100 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +60 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +44 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +18 -7
- package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +136 -0
- package/ReactCommon/jsinspector-modern/tracing/tests/TimeWindowedBufferTest.cpp +352 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +65 -29
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +10 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +3 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +10 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.h +1 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +115 -0
- package/ReactCommon/{jsinspector-modern → react/utils}/Base64.h +2 -2
- package/gradle/libs.versions.toml +1 -1
- package/package.json +10 -10
- package/scripts/cocoapods/utils.rb +1 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +12 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
- package/third-party-podspecs/RCT-Folly.podspec +1 -1
- package/third-party-podspecs/fmt.podspec +2 -2
- package/types/public/ReactNativeTVTypes.d.ts +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/TracingState.kt +0 -19
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingStateSerializer.cpp +0 -68
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingStateSerializer.h +0 -42
- package/ReactCommon/jsinspector-modern/tracing/TracingState.h +0 -24
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
package com.facebook.react.devsupport.perfmonitor
|
|
9
9
|
|
|
10
10
|
import com.facebook.react.bridge.UiThreadUtil
|
|
11
|
-
import com.facebook.react.devsupport.
|
|
11
|
+
import com.facebook.react.devsupport.inspector.TracingState
|
|
12
12
|
|
|
13
13
|
internal class PerfMonitorOverlayManager(
|
|
14
14
|
private val devHelper: PerfMonitorDevHelper,
|
|
@@ -21,7 +21,7 @@ internal class PerfMonitorOverlayManager(
|
|
|
21
21
|
get() = enabled
|
|
22
22
|
|
|
23
23
|
private var view: PerfMonitorOverlayView? = null
|
|
24
|
-
private var tracingState: TracingState = TracingState.
|
|
24
|
+
private var tracingState: TracingState = TracingState.ENABLED_IN_CDP_MODE
|
|
25
25
|
private var perfIssueCount: Int = 0
|
|
26
26
|
|
|
27
27
|
/** Enable the Perf Monitor overlay. */
|
|
@@ -92,7 +92,7 @@ internal class PerfMonitorOverlayManager(
|
|
|
92
92
|
|
|
93
93
|
private fun handleRecordingButtonPress() {
|
|
94
94
|
when (tracingState) {
|
|
95
|
-
TracingState.
|
|
95
|
+
TracingState.ENABLED_IN_BACKGROUND_MODE -> {
|
|
96
96
|
devHelper.inspectorTarget?.let { target ->
|
|
97
97
|
if (!target.pauseAndAnalyzeBackgroundTrace()) {
|
|
98
98
|
onRequestOpenDevTools()
|
|
@@ -102,7 +102,7 @@ internal class PerfMonitorOverlayManager(
|
|
|
102
102
|
TracingState.DISABLED -> {
|
|
103
103
|
devHelper.inspectorTarget?.resumeBackgroundTrace()
|
|
104
104
|
}
|
|
105
|
-
TracingState.
|
|
105
|
+
TracingState.ENABLED_IN_CDP_MODE -> Unit
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -21,7 +21,7 @@ import android.widget.TextView
|
|
|
21
21
|
import androidx.core.view.ViewCompat
|
|
22
22
|
import androidx.core.view.WindowInsetsCompat
|
|
23
23
|
import com.facebook.react.R
|
|
24
|
-
import com.facebook.react.devsupport.
|
|
24
|
+
import com.facebook.react.devsupport.inspector.TracingState
|
|
25
25
|
import com.facebook.react.uimanager.DisplayMetricsHolder
|
|
26
26
|
import com.facebook.react.uimanager.PixelUtil
|
|
27
27
|
|
|
@@ -50,12 +50,12 @@ internal class PerfMonitorOverlayView(
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
fun updateRecordingState(state: TracingState) {
|
|
53
|
-
if (state == TracingState.
|
|
53
|
+
if (state == TracingState.ENABLED_IN_CDP_MODE) {
|
|
54
54
|
dialog.hide()
|
|
55
55
|
return
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
if (state == TracingState.
|
|
58
|
+
if (state == TracingState.ENABLED_IN_BACKGROUND_MODE) {
|
|
59
59
|
(statusIndicator.background as GradientDrawable).setColor(Color.RED)
|
|
60
60
|
statusLabel.text = "Profiling Active"
|
|
61
61
|
tooltipLabel.text =
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
package com.facebook.react.devsupport.perfmonitor
|
|
9
9
|
|
|
10
|
-
import com.facebook.react.devsupport.
|
|
10
|
+
import com.facebook.react.devsupport.inspector.TracingState
|
|
11
11
|
|
|
12
12
|
/** [Experimental] An interface for subscribing to updates for the V2 Perf Monitor. */
|
|
13
13
|
internal interface PerfMonitorUpdateListener {
|
|
@@ -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<<a92c35b9527c3954516ee68db651afa7>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -372,12 +372,24 @@ public object ReactNativeFeatureFlags {
|
|
|
372
372
|
@JvmStatic
|
|
373
373
|
public fun fuseboxEnabledRelease(): Boolean = accessor.fuseboxEnabledRelease()
|
|
374
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Enable frame timings and screenshots support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes.
|
|
377
|
+
*/
|
|
378
|
+
@JvmStatic
|
|
379
|
+
public fun fuseboxFrameRecordingEnabled(): Boolean = accessor.fuseboxFrameRecordingEnabled()
|
|
380
|
+
|
|
375
381
|
/**
|
|
376
382
|
* Enable network inspection support in the React Native DevTools CDP backend. Requires `enableBridgelessArchitecture`. This flag is global and should not be changed across React Host lifetimes.
|
|
377
383
|
*/
|
|
378
384
|
@JvmStatic
|
|
379
385
|
public fun fuseboxNetworkInspectionEnabled(): Boolean = accessor.fuseboxNetworkInspectionEnabled()
|
|
380
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Enable Page.captureScreenshot CDP method support in the React Native DevTools CDP backend. This flag is global and should not be changed across React Host lifetimes.
|
|
389
|
+
*/
|
|
390
|
+
@JvmStatic
|
|
391
|
+
public fun fuseboxScreenshotCaptureEnabled(): Boolean = accessor.fuseboxScreenshotCaptureEnabled()
|
|
392
|
+
|
|
381
393
|
/**
|
|
382
394
|
* Hides offscreen VirtualViews on iOS by setting hidden = YES to avoid extra cost of views
|
|
383
395
|
*/
|
|
@@ -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<<a9ec10139cccac681fb73d8155377b02>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -77,7 +77,9 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
77
77
|
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
|
|
78
78
|
private var fuseboxAssertSingleHostStateCache: Boolean? = null
|
|
79
79
|
private var fuseboxEnabledReleaseCache: Boolean? = null
|
|
80
|
+
private var fuseboxFrameRecordingEnabledCache: Boolean? = null
|
|
80
81
|
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
|
|
82
|
+
private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null
|
|
81
83
|
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
|
|
82
84
|
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
|
|
83
85
|
private var perfIssuesEnabledCache: Boolean? = null
|
|
@@ -619,6 +621,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
619
621
|
return cached
|
|
620
622
|
}
|
|
621
623
|
|
|
624
|
+
override fun fuseboxFrameRecordingEnabled(): Boolean {
|
|
625
|
+
var cached = fuseboxFrameRecordingEnabledCache
|
|
626
|
+
if (cached == null) {
|
|
627
|
+
cached = ReactNativeFeatureFlagsCxxInterop.fuseboxFrameRecordingEnabled()
|
|
628
|
+
fuseboxFrameRecordingEnabledCache = cached
|
|
629
|
+
}
|
|
630
|
+
return cached
|
|
631
|
+
}
|
|
632
|
+
|
|
622
633
|
override fun fuseboxNetworkInspectionEnabled(): Boolean {
|
|
623
634
|
var cached = fuseboxNetworkInspectionEnabledCache
|
|
624
635
|
if (cached == null) {
|
|
@@ -628,6 +639,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
628
639
|
return cached
|
|
629
640
|
}
|
|
630
641
|
|
|
642
|
+
override fun fuseboxScreenshotCaptureEnabled(): Boolean {
|
|
643
|
+
var cached = fuseboxScreenshotCaptureEnabledCache
|
|
644
|
+
if (cached == null) {
|
|
645
|
+
cached = ReactNativeFeatureFlagsCxxInterop.fuseboxScreenshotCaptureEnabled()
|
|
646
|
+
fuseboxScreenshotCaptureEnabledCache = cached
|
|
647
|
+
}
|
|
648
|
+
return cached
|
|
649
|
+
}
|
|
650
|
+
|
|
631
651
|
override fun hideOffscreenVirtualViewsOnIOS(): Boolean {
|
|
632
652
|
var cached = hideOffscreenVirtualViewsOnIOSCache
|
|
633
653
|
if (cached == null) {
|
|
@@ -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<<ceb1cf55a1d6b6d71ad27ec7f8594b50>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -142,8 +142,12 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
142
142
|
|
|
143
143
|
@DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean
|
|
144
144
|
|
|
145
|
+
@DoNotStrip @JvmStatic public external fun fuseboxFrameRecordingEnabled(): Boolean
|
|
146
|
+
|
|
145
147
|
@DoNotStrip @JvmStatic public external fun fuseboxNetworkInspectionEnabled(): Boolean
|
|
146
148
|
|
|
149
|
+
@DoNotStrip @JvmStatic public external fun fuseboxScreenshotCaptureEnabled(): Boolean
|
|
150
|
+
|
|
147
151
|
@DoNotStrip @JvmStatic public external fun hideOffscreenVirtualViewsOnIOS(): Boolean
|
|
148
152
|
|
|
149
153
|
@DoNotStrip @JvmStatic public external fun overrideBySynchronousMountPropsAtMountingAndroid(): 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<<a292a8c3ac8d59484071106c1c323b63>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -53,7 +53,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
53
53
|
|
|
54
54
|
override fun enableCppPropsIteratorSetter(): Boolean = false
|
|
55
55
|
|
|
56
|
-
override fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean =
|
|
56
|
+
override fun enableCustomFocusSearchOnClippedElementsAndroid(): Boolean = false
|
|
57
57
|
|
|
58
58
|
override fun enableDestroyShadowTreeRevisionAsync(): Boolean = false
|
|
59
59
|
|
|
@@ -137,8 +137,12 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
137
137
|
|
|
138
138
|
override fun fuseboxEnabledRelease(): Boolean = false
|
|
139
139
|
|
|
140
|
+
override fun fuseboxFrameRecordingEnabled(): Boolean = false
|
|
141
|
+
|
|
140
142
|
override fun fuseboxNetworkInspectionEnabled(): Boolean = true
|
|
141
143
|
|
|
144
|
+
override fun fuseboxScreenshotCaptureEnabled(): Boolean = false
|
|
145
|
+
|
|
142
146
|
override fun hideOffscreenVirtualViewsOnIOS(): Boolean = false
|
|
143
147
|
|
|
144
148
|
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = false
|
|
@@ -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<<38e86d50298e5c4199d456f709ac13fc>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -81,7 +81,9 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
|
|
81
81
|
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
|
|
82
82
|
private var fuseboxAssertSingleHostStateCache: Boolean? = null
|
|
83
83
|
private var fuseboxEnabledReleaseCache: Boolean? = null
|
|
84
|
+
private var fuseboxFrameRecordingEnabledCache: Boolean? = null
|
|
84
85
|
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
|
|
86
|
+
private var fuseboxScreenshotCaptureEnabledCache: Boolean? = null
|
|
85
87
|
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
|
|
86
88
|
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
|
|
87
89
|
private var perfIssuesEnabledCache: Boolean? = null
|
|
@@ -680,6 +682,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
|
|
680
682
|
return cached
|
|
681
683
|
}
|
|
682
684
|
|
|
685
|
+
override fun fuseboxFrameRecordingEnabled(): Boolean {
|
|
686
|
+
var cached = fuseboxFrameRecordingEnabledCache
|
|
687
|
+
if (cached == null) {
|
|
688
|
+
cached = currentProvider.fuseboxFrameRecordingEnabled()
|
|
689
|
+
accessedFeatureFlags.add("fuseboxFrameRecordingEnabled")
|
|
690
|
+
fuseboxFrameRecordingEnabledCache = cached
|
|
691
|
+
}
|
|
692
|
+
return cached
|
|
693
|
+
}
|
|
694
|
+
|
|
683
695
|
override fun fuseboxNetworkInspectionEnabled(): Boolean {
|
|
684
696
|
var cached = fuseboxNetworkInspectionEnabledCache
|
|
685
697
|
if (cached == null) {
|
|
@@ -690,6 +702,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
|
|
|
690
702
|
return cached
|
|
691
703
|
}
|
|
692
704
|
|
|
705
|
+
override fun fuseboxScreenshotCaptureEnabled(): Boolean {
|
|
706
|
+
var cached = fuseboxScreenshotCaptureEnabledCache
|
|
707
|
+
if (cached == null) {
|
|
708
|
+
cached = currentProvider.fuseboxScreenshotCaptureEnabled()
|
|
709
|
+
accessedFeatureFlags.add("fuseboxScreenshotCaptureEnabled")
|
|
710
|
+
fuseboxScreenshotCaptureEnabledCache = cached
|
|
711
|
+
}
|
|
712
|
+
return cached
|
|
713
|
+
}
|
|
714
|
+
|
|
693
715
|
override fun hideOffscreenVirtualViewsOnIOS(): Boolean {
|
|
694
716
|
var cached = hideOffscreenVirtualViewsOnIOSCache
|
|
695
717
|
if (cached == null) {
|
|
@@ -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<<eb09ee29f25cd03df2e7c3d2b3def992>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -137,8 +137,12 @@ public interface ReactNativeFeatureFlagsProvider {
|
|
|
137
137
|
|
|
138
138
|
@DoNotStrip public fun fuseboxEnabledRelease(): Boolean
|
|
139
139
|
|
|
140
|
+
@DoNotStrip public fun fuseboxFrameRecordingEnabled(): Boolean
|
|
141
|
+
|
|
140
142
|
@DoNotStrip public fun fuseboxNetworkInspectionEnabled(): Boolean
|
|
141
143
|
|
|
144
|
+
@DoNotStrip public fun fuseboxScreenshotCaptureEnabled(): Boolean
|
|
145
|
+
|
|
142
146
|
@DoNotStrip public fun hideOffscreenVirtualViewsOnIOS(): Boolean
|
|
143
147
|
|
|
144
148
|
@DoNotStrip public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean
|
|
@@ -23,6 +23,45 @@ public object PerformanceTracer {
|
|
|
23
23
|
SoLoader.loadLibrary("react_performancetracerjni")
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
public fun <T> trace(name: String, block: () -> T): T {
|
|
27
|
+
return trace(name, null /* track */, null /* trackGroup */, null /* color */, block)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public fun <T> trace(name: String, track: String, block: () -> T): T {
|
|
31
|
+
return trace(name, track, null /* trackGroup */, null /* color */, block)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public fun <T> trace(name: String, track: String, trackGroup: String, block: () -> T): T {
|
|
35
|
+
return trace(name, track, trackGroup, null /* color */, block)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public fun <T> trace(
|
|
39
|
+
name: String,
|
|
40
|
+
track: String?,
|
|
41
|
+
trackGroup: String?,
|
|
42
|
+
color: String?,
|
|
43
|
+
block: () -> T,
|
|
44
|
+
): T {
|
|
45
|
+
if (!isTracing()) {
|
|
46
|
+
return block()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
val startTimeNanos = java.lang.System.nanoTime()
|
|
50
|
+
try {
|
|
51
|
+
return block()
|
|
52
|
+
} finally {
|
|
53
|
+
val endTimeNanos = java.lang.System.nanoTime()
|
|
54
|
+
reportTimeStamp(
|
|
55
|
+
name,
|
|
56
|
+
startTimeNanos,
|
|
57
|
+
endTimeNanos,
|
|
58
|
+
track,
|
|
59
|
+
trackGroup,
|
|
60
|
+
color,
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
26
65
|
/** Callback interface for tracing state changes. */
|
|
27
66
|
@DoNotStrip
|
|
28
67
|
public interface TracingStateCallback {
|
|
@@ -63,7 +63,7 @@ public class BlobModule(reactContext: ReactApplicationContext) :
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
internal val networkingUriHandler =
|
|
67
67
|
object : NetworkingModule.UriHandler {
|
|
68
68
|
override fun supports(uri: Uri, responseType: String): Boolean {
|
|
69
69
|
val scheme = uri.scheme
|
|
@@ -19,9 +19,7 @@ import com.facebook.react.common.build.ReactBuildConfig
|
|
|
19
19
|
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
20
20
|
import java.net.SocketTimeoutException
|
|
21
21
|
import okhttp3.Headers
|
|
22
|
-
import okhttp3.Protocol
|
|
23
22
|
import okhttp3.Request
|
|
24
|
-
import okhttp3.Response
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
* Utility class for reporting network lifecycle events to JavaScript and InspectorNetworkReporter.
|
|
@@ -206,11 +204,12 @@ internal object NetworkEventUtil {
|
|
|
206
204
|
requestId: Int,
|
|
207
205
|
devToolsRequestId: String,
|
|
208
206
|
requestUrl: String?,
|
|
209
|
-
|
|
207
|
+
statusCode: Int,
|
|
208
|
+
headers: Map<String, String>,
|
|
209
|
+
contentLength: Long,
|
|
210
210
|
) {
|
|
211
|
-
val headersMap = okHttpHeadersToMap(response.headers())
|
|
212
211
|
val headersBundle = Bundle()
|
|
213
|
-
for ((headerName, headerValue) in
|
|
212
|
+
for ((headerName, headerValue) in headers) {
|
|
214
213
|
headersBundle.putString(headerName, headerValue)
|
|
215
214
|
}
|
|
216
215
|
|
|
@@ -218,16 +217,16 @@ internal object NetworkEventUtil {
|
|
|
218
217
|
InspectorNetworkReporter.reportResponseStart(
|
|
219
218
|
devToolsRequestId,
|
|
220
219
|
requestUrl.orEmpty(),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
statusCode,
|
|
221
|
+
headers,
|
|
222
|
+
contentLength,
|
|
224
223
|
)
|
|
225
224
|
}
|
|
226
225
|
reactContext?.emitDeviceEvent(
|
|
227
226
|
"didReceiveNetworkResponse",
|
|
228
227
|
Arguments.createArray().apply {
|
|
229
228
|
pushInt(requestId)
|
|
230
|
-
pushInt(
|
|
229
|
+
pushInt(statusCode)
|
|
231
230
|
pushMap(Arguments.fromBundle(headersBundle))
|
|
232
231
|
pushString(requestUrl)
|
|
233
232
|
},
|
|
@@ -244,33 +243,35 @@ internal object NetworkEventUtil {
|
|
|
244
243
|
headers: WritableMap?,
|
|
245
244
|
url: String?,
|
|
246
245
|
) {
|
|
247
|
-
val
|
|
246
|
+
val headersMap = mutableMapOf<String, String>()
|
|
248
247
|
headers?.let { map ->
|
|
249
248
|
val iterator = map.keySetIterator()
|
|
250
249
|
while (iterator.hasNextKey()) {
|
|
251
250
|
val key = iterator.nextKey()
|
|
252
251
|
val value = map.getString(key)
|
|
253
252
|
if (value != null) {
|
|
254
|
-
|
|
253
|
+
headersMap[key] = value
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
256
|
}
|
|
257
|
+
|
|
258
|
+
val contentLength =
|
|
259
|
+
headersMap["Content-Length"]?.toLongOrNull()
|
|
260
|
+
?: headersMap["content-length"]?.toLongOrNull()
|
|
261
|
+
?: 0L
|
|
262
|
+
|
|
258
263
|
onResponseReceived(
|
|
259
264
|
reactContext,
|
|
260
265
|
requestId,
|
|
261
266
|
devToolsRequestId,
|
|
262
267
|
url,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
.headers(headersBuilder.build())
|
|
267
|
-
.code(statusCode)
|
|
268
|
-
.message("")
|
|
269
|
-
.build(),
|
|
268
|
+
statusCode,
|
|
269
|
+
headersMap,
|
|
270
|
+
contentLength,
|
|
270
271
|
)
|
|
271
272
|
}
|
|
272
273
|
|
|
273
|
-
|
|
274
|
+
internal fun okHttpHeadersToMap(headers: Headers): Map<String, String> {
|
|
274
275
|
val responseHeaders = mutableMapOf<String, String>()
|
|
275
276
|
for (i in 0 until headers.size()) {
|
|
276
277
|
val headerName = headers.name(i)
|
|
@@ -36,7 +36,6 @@ import okhttp3.JavaNetCookieJar
|
|
|
36
36
|
import okhttp3.MediaType
|
|
37
37
|
import okhttp3.MultipartBody
|
|
38
38
|
import okhttp3.OkHttpClient
|
|
39
|
-
import okhttp3.Protocol
|
|
40
39
|
import okhttp3.Request
|
|
41
40
|
import okhttp3.RequestBody
|
|
42
41
|
import okhttp3.Response
|
|
@@ -310,21 +309,14 @@ public class NetworkingModule(
|
|
|
310
309
|
if (handler.supports(uri, responseType)) {
|
|
311
310
|
val (res, rawBody) = handler.fetch(uri)
|
|
312
311
|
val encodedDataLength = res.toString().toByteArray().size
|
|
313
|
-
// fix: UriHandlers which are not using file:// scheme fail in whatwg-fetch at this line
|
|
314
|
-
// https://github.com/JakeChampion/fetch/blob/main/fetch.js#L547
|
|
315
|
-
val response =
|
|
316
|
-
Response.Builder()
|
|
317
|
-
.protocol(Protocol.HTTP_1_1)
|
|
318
|
-
.request(Request.Builder().url(url.orEmpty()).build())
|
|
319
|
-
.code(200)
|
|
320
|
-
.message("OK")
|
|
321
|
-
.build()
|
|
322
312
|
NetworkEventUtil.onResponseReceived(
|
|
323
313
|
reactApplicationContext,
|
|
324
314
|
requestId,
|
|
325
315
|
devToolsRequestId,
|
|
326
316
|
url,
|
|
327
|
-
|
|
317
|
+
200,
|
|
318
|
+
emptyMap(),
|
|
319
|
+
encodedDataLength.toLong(),
|
|
328
320
|
)
|
|
329
321
|
NetworkEventUtil.onDataReceived(
|
|
330
322
|
reactApplicationContext,
|
|
@@ -645,7 +637,9 @@ public class NetworkingModule(
|
|
|
645
637
|
requestId,
|
|
646
638
|
devToolsRequestId,
|
|
647
639
|
url,
|
|
648
|
-
response,
|
|
640
|
+
response.code(),
|
|
641
|
+
NetworkEventUtil.okHttpHeadersToMap(response.headers()),
|
|
642
|
+
response.body()?.contentLength() ?: 0L,
|
|
649
643
|
)
|
|
650
644
|
|
|
651
645
|
try {
|
|
@@ -12,6 +12,7 @@ import android.content.Context
|
|
|
12
12
|
import android.content.Intent
|
|
13
13
|
import android.nfc.NfcAdapter
|
|
14
14
|
import android.os.Bundle
|
|
15
|
+
import androidx.core.graphics.createBitmap
|
|
15
16
|
import com.facebook.common.logging.FLog
|
|
16
17
|
import com.facebook.infer.annotation.Assertions
|
|
17
18
|
import com.facebook.infer.annotation.ThreadConfined
|
|
@@ -43,8 +44,11 @@ import com.facebook.react.devsupport.DevMenuConfiguration
|
|
|
43
44
|
import com.facebook.react.devsupport.DevSupportManagerBase
|
|
44
45
|
import com.facebook.react.devsupport.DevSupportManagerFactory
|
|
45
46
|
import com.facebook.react.devsupport.InspectorFlags
|
|
47
|
+
import com.facebook.react.devsupport.inspector.FrameTimingsObserver
|
|
46
48
|
import com.facebook.react.devsupport.inspector.InspectorNetworkHelper
|
|
47
49
|
import com.facebook.react.devsupport.inspector.InspectorNetworkRequestListener
|
|
50
|
+
import com.facebook.react.devsupport.inspector.TracingState
|
|
51
|
+
import com.facebook.react.devsupport.inspector.TracingStateListener
|
|
48
52
|
import com.facebook.react.devsupport.interfaces.BundleLoadCallback
|
|
49
53
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
50
54
|
import com.facebook.react.devsupport.interfaces.DevSupportManager.PausedInDebuggerOverlayCommandListener
|
|
@@ -147,6 +151,7 @@ public class ReactHostImpl(
|
|
|
147
151
|
private val beforeDestroyListeners: MutableList<() -> Unit> = CopyOnWriteArrayList()
|
|
148
152
|
|
|
149
153
|
internal var reactHostInspectorTarget: ReactHostInspectorTarget? = null
|
|
154
|
+
private var frameTimingsObserver: FrameTimingsObserver? = null
|
|
150
155
|
|
|
151
156
|
@Volatile private var hostInvalidated = false
|
|
152
157
|
|
|
@@ -246,6 +251,7 @@ public class ReactHostImpl(
|
|
|
246
251
|
stateTracker.enterState("onHostResume(activity)")
|
|
247
252
|
|
|
248
253
|
currentActivity = activity
|
|
254
|
+
frameTimingsObserver?.setCurrentWindow(activity?.window)
|
|
249
255
|
|
|
250
256
|
maybeEnableDevSupport(true)
|
|
251
257
|
reactLifecycleStateManager.moveToOnHostResume(currentReactContext, activity)
|
|
@@ -442,6 +448,43 @@ public class ReactHostImpl(
|
|
|
442
448
|
InspectorNetworkHelper.loadNetworkResource(url, listener)
|
|
443
449
|
}
|
|
444
450
|
|
|
451
|
+
@DoNotStrip
|
|
452
|
+
private fun captureScreenshot(format: String, quality: Int): String? {
|
|
453
|
+
val activity = currentActivity ?: return null
|
|
454
|
+
val window = activity.window ?: return null
|
|
455
|
+
val decorView = window.decorView.rootView
|
|
456
|
+
|
|
457
|
+
val width = decorView.width
|
|
458
|
+
val height = decorView.height
|
|
459
|
+
if (width <= 0 || height <= 0) {
|
|
460
|
+
return null
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
val bitmap = createBitmap(width, height)
|
|
464
|
+
val canvas = android.graphics.Canvas(bitmap)
|
|
465
|
+
decorView.draw(canvas)
|
|
466
|
+
|
|
467
|
+
val outputStream = java.io.ByteArrayOutputStream()
|
|
468
|
+
val compressFormat =
|
|
469
|
+
when (format) {
|
|
470
|
+
"jpeg" -> android.graphics.Bitmap.CompressFormat.JPEG
|
|
471
|
+
"webp" ->
|
|
472
|
+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
|
473
|
+
android.graphics.Bitmap.CompressFormat.WEBP_LOSSY
|
|
474
|
+
} else {
|
|
475
|
+
@Suppress("DEPRECATION") android.graphics.Bitmap.CompressFormat.WEBP
|
|
476
|
+
}
|
|
477
|
+
else -> android.graphics.Bitmap.CompressFormat.PNG
|
|
478
|
+
}
|
|
479
|
+
val compressQuality = if (quality in 0..100) quality else 80
|
|
480
|
+
|
|
481
|
+
bitmap.compress(compressFormat, compressQuality, outputStream)
|
|
482
|
+
bitmap.recycle()
|
|
483
|
+
|
|
484
|
+
val bytes = outputStream.toByteArray()
|
|
485
|
+
return android.util.Base64.encodeToString(bytes, android.util.Base64.NO_WRAP)
|
|
486
|
+
}
|
|
487
|
+
|
|
445
488
|
/**
|
|
446
489
|
* Entrypoint to destroy the ReactInstance. If the ReactInstance is reloading, will wait until
|
|
447
490
|
* reload is finished, before destroying.
|
|
@@ -847,6 +890,7 @@ public class ReactHostImpl(
|
|
|
847
890
|
private fun moveToHostDestroy(currentContext: ReactContext?) {
|
|
848
891
|
reactLifecycleStateManager.moveToOnHostDestroy(currentContext)
|
|
849
892
|
currentActivity = null
|
|
893
|
+
frameTimingsObserver?.setCurrentWindow(null)
|
|
850
894
|
}
|
|
851
895
|
|
|
852
896
|
private fun raiseSoftException(
|
|
@@ -1442,8 +1486,7 @@ public class ReactHostImpl(
|
|
|
1442
1486
|
// If the host has been invalidated, now that the current context/instance
|
|
1443
1487
|
// has been unregistered, we can safely destroy the host's inspector
|
|
1444
1488
|
// target.
|
|
1445
|
-
|
|
1446
|
-
reactHostInspectorTarget = null
|
|
1489
|
+
destroyReactHostInspectorTarget()
|
|
1447
1490
|
}
|
|
1448
1491
|
|
|
1449
1492
|
// Step 1: Destroy DevSupportManager
|
|
@@ -1554,13 +1597,52 @@ public class ReactHostImpl(
|
|
|
1554
1597
|
|
|
1555
1598
|
internal fun getOrCreateReactHostInspectorTarget(): ReactHostInspectorTarget? {
|
|
1556
1599
|
if (reactHostInspectorTarget == null && InspectorFlags.getFuseboxEnabled()) {
|
|
1557
|
-
|
|
1558
|
-
reactHostInspectorTarget = ReactHostInspectorTarget(this)
|
|
1600
|
+
reactHostInspectorTarget = createReactHostInspectorTarget()
|
|
1559
1601
|
}
|
|
1560
1602
|
|
|
1561
1603
|
return reactHostInspectorTarget
|
|
1562
1604
|
}
|
|
1563
1605
|
|
|
1606
|
+
private fun createReactHostInspectorTarget(): ReactHostInspectorTarget {
|
|
1607
|
+
// NOTE: ReactHostInspectorTarget only retains a weak reference to `this`.
|
|
1608
|
+
val inspectorTarget = ReactHostInspectorTarget(this)
|
|
1609
|
+
inspectorTarget.registerTracingStateListener(
|
|
1610
|
+
TracingStateListener { state: TracingState, _screenshotsEnabled: Boolean ->
|
|
1611
|
+
when (state) {
|
|
1612
|
+
TracingState.ENABLED_IN_BACKGROUND_MODE,
|
|
1613
|
+
TracingState.ENABLED_IN_CDP_MODE -> {
|
|
1614
|
+
if (InspectorFlags.getFrameRecordingEnabled()) {
|
|
1615
|
+
val observer =
|
|
1616
|
+
FrameTimingsObserver(
|
|
1617
|
+
_screenshotsEnabled,
|
|
1618
|
+
{ frameTimingsSequence ->
|
|
1619
|
+
inspectorTarget.recordFrameTimings(frameTimingsSequence)
|
|
1620
|
+
},
|
|
1621
|
+
)
|
|
1622
|
+
observer.setCurrentWindow(currentActivity?.window)
|
|
1623
|
+
observer.start()
|
|
1624
|
+
frameTimingsObserver = observer
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
TracingState.DISABLED -> {
|
|
1628
|
+
frameTimingsObserver?.stop()
|
|
1629
|
+
frameTimingsObserver = null
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
)
|
|
1634
|
+
|
|
1635
|
+
return inspectorTarget
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
private fun destroyReactHostInspectorTarget() {
|
|
1639
|
+
frameTimingsObserver?.stop()
|
|
1640
|
+
frameTimingsObserver = null
|
|
1641
|
+
|
|
1642
|
+
reactHostInspectorTarget?.close()
|
|
1643
|
+
reactHostInspectorTarget = null
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1564
1646
|
@ThreadConfined(ThreadConfined.UI)
|
|
1565
1647
|
internal fun unregisterInstanceFromInspector(reactInstance: ReactInstance?) {
|
|
1566
1648
|
if (reactInstance != null) {
|
|
@@ -16,8 +16,8 @@ import com.facebook.react.bridge.ReactContext
|
|
|
16
16
|
import com.facebook.react.common.annotations.FrameworkAPI
|
|
17
17
|
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
|
18
18
|
import com.facebook.react.devsupport.ReactInstanceDevHelper
|
|
19
|
-
import com.facebook.react.devsupport.
|
|
20
|
-
import com.facebook.react.devsupport.
|
|
19
|
+
import com.facebook.react.devsupport.inspector.TracingState
|
|
20
|
+
import com.facebook.react.devsupport.inspector.TracingStateProvider
|
|
21
21
|
import com.facebook.react.devsupport.perfmonitor.PerfMonitorDevHelper
|
|
22
22
|
import com.facebook.react.devsupport.perfmonitor.PerfMonitorInspectorTarget
|
|
23
23
|
import com.facebook.react.interfaces.TaskInterface
|
|
@@ -81,6 +81,6 @@ internal class ReactHostImplDevHelper(private val delegate: ReactHostImpl) :
|
|
|
81
81
|
delegate.loadBundle(bundleLoader)
|
|
82
82
|
|
|
83
83
|
override fun getTracingState(): TracingState {
|
|
84
|
-
return delegate.reactHostInspectorTarget?.getTracingState() ?: TracingState.
|
|
84
|
+
return delegate.reactHostInspectorTarget?.getTracingState() ?: TracingState.ENABLED_IN_CDP_MODE
|
|
85
85
|
}
|
|
86
86
|
}
|