react-native-tvos 0.85.2-0 → 0.85.3-1
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/ScrollView.d.ts +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +1 -1
- package/Libraries/Components/TV/TVViewPropTypes.js +9 -0
- package/Libraries/Components/View/View.js +7 -3
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/NativeComponent/TVViewConfig.js +1 -0
- package/Libraries/Utilities/HMRClient.js +28 -1
- package/README.md +13 -1
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
- package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
- package/React/CoreModules/RCTRedBox+Internal.h +42 -0
- package/React/CoreModules/RCTRedBox.mm +30 -471
- package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
- package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
- package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
- package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
- package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
- package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
- package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
- package/React/CoreModules/RCTRedBoxController.mm +447 -0
- package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
- package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +40 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +35 -15
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +17 -0
- package/ReactAndroid/publish.gradle +20 -46
- 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 +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +127 -26
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +31 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +56 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +39 -0
- 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 +50 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +14 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +14 -4
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +46 -6
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt +5 -0
- package/ReactAndroid/src/main/jni/CMakeLists.txt +7 -0
- 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 +71 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +16 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +14 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +18 -4
- package/ReactCommon/React-Fabric.podspec +6 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +36 -0
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +7 -1
- package/ReactCommon/jsinspector-modern/HostTarget.h +25 -0
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +1 -1
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +4 -4
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +12 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +12 -0
- 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/tests/HostTargetTest.cpp +12 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +3 -2
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +1 -1
- 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 +7 -3
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +52 -29
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +6 -6
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +12 -5
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +42 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/react/debug/CMakeLists.txt +2 -1
- package/ReactCommon/react/debug/React-debug.podspec +7 -1
- package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
- package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
- package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
- package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
- package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +135 -45
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +12 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +21 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +46 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +6 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +7 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +26 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +66 -0
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.cpp +7 -0
- package/ReactCommon/react/renderer/components/view/BaseViewProps.h +1 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.cpp +18 -0
- package/ReactCommon/react/renderer/components/view/platform/android/react/renderer/components/view/HostPlatformViewProps.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/package.json +11 -11
- package/scripts/cocoapods/utils.rb +1 -0
- package/scripts/react_native_pods.rb +1 -0
- package/scripts/replace-rncore-version.js +72 -15
- package/src/private/featureflags/ReactNativeFeatureFlags.js +26 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +6 -1
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/types/public/ReactNativeTVTypes.d.ts +9 -0
|
@@ -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<<fbfa1db0da68d08e055002244a6847de>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -285,6 +285,12 @@ class ReactNativeFeatureFlagsJavaProvider
|
|
|
285
285
|
return method(javaProvider_);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
bool enableMutationObserverByDefault() override {
|
|
289
|
+
static const auto method =
|
|
290
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableMutationObserverByDefault");
|
|
291
|
+
return method(javaProvider_);
|
|
292
|
+
}
|
|
293
|
+
|
|
288
294
|
bool enableNativeCSSParsing() override {
|
|
289
295
|
static const auto method =
|
|
290
296
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableNativeCSSParsing");
|
|
@@ -393,12 +399,24 @@ class ReactNativeFeatureFlagsJavaProvider
|
|
|
393
399
|
return method(javaProvider_);
|
|
394
400
|
}
|
|
395
401
|
|
|
402
|
+
bool fuseboxFrameRecordingEnabled() override {
|
|
403
|
+
static const auto method =
|
|
404
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxFrameRecordingEnabled");
|
|
405
|
+
return method(javaProvider_);
|
|
406
|
+
}
|
|
407
|
+
|
|
396
408
|
bool fuseboxNetworkInspectionEnabled() override {
|
|
397
409
|
static const auto method =
|
|
398
410
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxNetworkInspectionEnabled");
|
|
399
411
|
return method(javaProvider_);
|
|
400
412
|
}
|
|
401
413
|
|
|
414
|
+
bool fuseboxScreenshotCaptureEnabled() override {
|
|
415
|
+
static const auto method =
|
|
416
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxScreenshotCaptureEnabled");
|
|
417
|
+
return method(javaProvider_);
|
|
418
|
+
}
|
|
419
|
+
|
|
402
420
|
bool hideOffscreenVirtualViewsOnIOS() override {
|
|
403
421
|
static const auto method =
|
|
404
422
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("hideOffscreenVirtualViewsOnIOS");
|
|
@@ -435,6 +453,18 @@ class ReactNativeFeatureFlagsJavaProvider
|
|
|
435
453
|
return method(javaProvider_);
|
|
436
454
|
}
|
|
437
455
|
|
|
456
|
+
bool redBoxV2Android() override {
|
|
457
|
+
static const auto method =
|
|
458
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("redBoxV2Android");
|
|
459
|
+
return method(javaProvider_);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
bool redBoxV2IOS() override {
|
|
463
|
+
static const auto method =
|
|
464
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("redBoxV2IOS");
|
|
465
|
+
return method(javaProvider_);
|
|
466
|
+
}
|
|
467
|
+
|
|
438
468
|
bool shouldPressibilityUseW3CPointerEventsForHover() override {
|
|
439
469
|
static const auto method =
|
|
440
470
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("shouldPressibilityUseW3CPointerEventsForHover");
|
|
@@ -758,6 +788,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS
|
|
|
758
788
|
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
|
|
759
789
|
}
|
|
760
790
|
|
|
791
|
+
bool JReactNativeFeatureFlagsCxxInterop::enableMutationObserverByDefault(
|
|
792
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
793
|
+
return ReactNativeFeatureFlags::enableMutationObserverByDefault();
|
|
794
|
+
}
|
|
795
|
+
|
|
761
796
|
bool JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing(
|
|
762
797
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
763
798
|
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
|
@@ -848,11 +883,21 @@ bool JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease(
|
|
|
848
883
|
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
|
|
849
884
|
}
|
|
850
885
|
|
|
886
|
+
bool JReactNativeFeatureFlagsCxxInterop::fuseboxFrameRecordingEnabled(
|
|
887
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
888
|
+
return ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled();
|
|
889
|
+
}
|
|
890
|
+
|
|
851
891
|
bool JReactNativeFeatureFlagsCxxInterop::fuseboxNetworkInspectionEnabled(
|
|
852
892
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
853
893
|
return ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled();
|
|
854
894
|
}
|
|
855
895
|
|
|
896
|
+
bool JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled(
|
|
897
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
898
|
+
return ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled();
|
|
899
|
+
}
|
|
900
|
+
|
|
856
901
|
bool JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS(
|
|
857
902
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
858
903
|
return ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS();
|
|
@@ -883,6 +928,16 @@ bool JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion(
|
|
|
883
928
|
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion();
|
|
884
929
|
}
|
|
885
930
|
|
|
931
|
+
bool JReactNativeFeatureFlagsCxxInterop::redBoxV2Android(
|
|
932
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
933
|
+
return ReactNativeFeatureFlags::redBoxV2Android();
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
bool JReactNativeFeatureFlagsCxxInterop::redBoxV2IOS(
|
|
937
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
938
|
+
return ReactNativeFeatureFlags::redBoxV2IOS();
|
|
939
|
+
}
|
|
940
|
+
|
|
886
941
|
bool JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsForHover(
|
|
887
942
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
888
943
|
return ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover();
|
|
@@ -1132,6 +1187,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
1132
1187
|
makeNativeMethod(
|
|
1133
1188
|
"enableModuleArgumentNSNullConversionIOS",
|
|
1134
1189
|
JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS),
|
|
1190
|
+
makeNativeMethod(
|
|
1191
|
+
"enableMutationObserverByDefault",
|
|
1192
|
+
JReactNativeFeatureFlagsCxxInterop::enableMutationObserverByDefault),
|
|
1135
1193
|
makeNativeMethod(
|
|
1136
1194
|
"enableNativeCSSParsing",
|
|
1137
1195
|
JReactNativeFeatureFlagsCxxInterop::enableNativeCSSParsing),
|
|
@@ -1186,9 +1244,15 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
1186
1244
|
makeNativeMethod(
|
|
1187
1245
|
"fuseboxEnabledRelease",
|
|
1188
1246
|
JReactNativeFeatureFlagsCxxInterop::fuseboxEnabledRelease),
|
|
1247
|
+
makeNativeMethod(
|
|
1248
|
+
"fuseboxFrameRecordingEnabled",
|
|
1249
|
+
JReactNativeFeatureFlagsCxxInterop::fuseboxFrameRecordingEnabled),
|
|
1189
1250
|
makeNativeMethod(
|
|
1190
1251
|
"fuseboxNetworkInspectionEnabled",
|
|
1191
1252
|
JReactNativeFeatureFlagsCxxInterop::fuseboxNetworkInspectionEnabled),
|
|
1253
|
+
makeNativeMethod(
|
|
1254
|
+
"fuseboxScreenshotCaptureEnabled",
|
|
1255
|
+
JReactNativeFeatureFlagsCxxInterop::fuseboxScreenshotCaptureEnabled),
|
|
1192
1256
|
makeNativeMethod(
|
|
1193
1257
|
"hideOffscreenVirtualViewsOnIOS",
|
|
1194
1258
|
JReactNativeFeatureFlagsCxxInterop::hideOffscreenVirtualViewsOnIOS),
|
|
@@ -1207,6 +1271,12 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
1207
1271
|
makeNativeMethod(
|
|
1208
1272
|
"preventShadowTreeCommitExhaustion",
|
|
1209
1273
|
JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion),
|
|
1274
|
+
makeNativeMethod(
|
|
1275
|
+
"redBoxV2Android",
|
|
1276
|
+
JReactNativeFeatureFlagsCxxInterop::redBoxV2Android),
|
|
1277
|
+
makeNativeMethod(
|
|
1278
|
+
"redBoxV2IOS",
|
|
1279
|
+
JReactNativeFeatureFlagsCxxInterop::redBoxV2IOS),
|
|
1210
1280
|
makeNativeMethod(
|
|
1211
1281
|
"shouldPressibilityUseW3CPointerEventsForHover",
|
|
1212
1282
|
JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsForHover),
|
|
@@ -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<<707465eb2a901c79a91681f2bcec1972>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -153,6 +153,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
153
153
|
static bool enableModuleArgumentNSNullConversionIOS(
|
|
154
154
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
155
155
|
|
|
156
|
+
static bool enableMutationObserverByDefault(
|
|
157
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
158
|
+
|
|
156
159
|
static bool enableNativeCSSParsing(
|
|
157
160
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
158
161
|
|
|
@@ -207,9 +210,15 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
207
210
|
static bool fuseboxEnabledRelease(
|
|
208
211
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
209
212
|
|
|
213
|
+
static bool fuseboxFrameRecordingEnabled(
|
|
214
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
215
|
+
|
|
210
216
|
static bool fuseboxNetworkInspectionEnabled(
|
|
211
217
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
212
218
|
|
|
219
|
+
static bool fuseboxScreenshotCaptureEnabled(
|
|
220
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
221
|
+
|
|
213
222
|
static bool hideOffscreenVirtualViewsOnIOS(
|
|
214
223
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
215
224
|
|
|
@@ -228,6 +237,12 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
228
237
|
static bool preventShadowTreeCommitExhaustion(
|
|
229
238
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
230
239
|
|
|
240
|
+
static bool redBoxV2Android(
|
|
241
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
242
|
+
|
|
243
|
+
static bool redBoxV2IOS(
|
|
244
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
245
|
+
|
|
231
246
|
static bool shouldPressibilityUseW3CPointerEventsForHover(
|
|
232
247
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
233
248
|
|
|
@@ -145,6 +145,20 @@ void JReactHostInspectorTarget::loadNetworkResource(
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
std::optional<std::string> JReactHostInspectorTarget::captureScreenshot(
|
|
149
|
+
const jsinspector_modern::HostTargetDelegate::PageCaptureScreenshotRequest&
|
|
150
|
+
request) {
|
|
151
|
+
if (auto javaReactHostImplStrong = javaReactHostImpl_->get()) {
|
|
152
|
+
std::string format = request.format.value_or("png");
|
|
153
|
+
int quality = request.quality.value_or(-1);
|
|
154
|
+
auto result = javaReactHostImplStrong->captureScreenshot(format, quality);
|
|
155
|
+
if (result) {
|
|
156
|
+
return result->toStdString();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return std::nullopt;
|
|
160
|
+
}
|
|
161
|
+
|
|
148
162
|
HostTarget* JReactHostInspectorTarget::getInspectorTarget() {
|
|
149
163
|
return inspectorTarget_ ? inspectorTarget_.get() : nullptr;
|
|
150
164
|
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
+
#include <fbjni/ByteBuffer.h>
|
|
10
11
|
#include <fbjni/fbjni.h>
|
|
11
12
|
|
|
12
13
|
#include <jsinspector-modern/HostTarget.h>
|
|
@@ -98,13 +99,17 @@ struct JFrameTimingSequence : public jni::JavaClass<JFrameTimingSequence> {
|
|
|
98
99
|
std::chrono::steady_clock::time_point(std::chrono::nanoseconds(getFieldValue(field))));
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
std::optional<std::
|
|
102
|
+
std::optional<std::vector<uint8_t>> getScreenshot() const
|
|
102
103
|
{
|
|
103
|
-
auto field = javaClassStatic()->getField<
|
|
104
|
+
auto field = javaClassStatic()->getField<jbyteArray>("screenshot");
|
|
104
105
|
auto javaScreenshot = getFieldValue(field);
|
|
105
106
|
if (javaScreenshot) {
|
|
106
|
-
auto
|
|
107
|
-
|
|
107
|
+
auto size = static_cast<size_t>(javaScreenshot->size());
|
|
108
|
+
if (size > 0) {
|
|
109
|
+
std::vector<uint8_t> result(size);
|
|
110
|
+
javaScreenshot->getRegion(0, javaScreenshot->size(), reinterpret_cast<jbyte *>(result.data()));
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
108
113
|
}
|
|
109
114
|
return std::nullopt;
|
|
110
115
|
}
|
|
@@ -140,6 +145,13 @@ struct JReactHostImpl : public jni::JavaClass<JReactHostImpl> {
|
|
|
140
145
|
"loadNetworkResource");
|
|
141
146
|
return method(self(), jni::make_jstring(url), listener);
|
|
142
147
|
}
|
|
148
|
+
|
|
149
|
+
jni::local_ref<jni::JString> captureScreenshot(const std::string &format, int quality) const
|
|
150
|
+
{
|
|
151
|
+
auto method = javaClassStatic()->getMethod<jni::local_ref<jni::JString>(jni::local_ref<jni::JString>, jint)>(
|
|
152
|
+
"captureScreenshot");
|
|
153
|
+
return method(self(), jni::make_jstring(format), static_cast<jint>(quality));
|
|
154
|
+
}
|
|
143
155
|
};
|
|
144
156
|
|
|
145
157
|
/**
|
|
@@ -270,6 +282,8 @@ class JReactHostInspectorTarget : public jni::HybridClass<JReactHostInspectorTar
|
|
|
270
282
|
void loadNetworkResource(
|
|
271
283
|
const jsinspector_modern::LoadNetworkResourceRequest ¶ms,
|
|
272
284
|
jsinspector_modern::ScopedExecutor<jsinspector_modern::NetworkRequestListener> executor) override;
|
|
285
|
+
std::optional<std::string> captureScreenshot(
|
|
286
|
+
const jsinspector_modern::HostTargetDelegate::PageCaptureScreenshotRequest &request) override;
|
|
273
287
|
jsinspector_modern::HostTargetTracingDelegate *getTracingDelegate() override;
|
|
274
288
|
|
|
275
289
|
private:
|
|
@@ -190,6 +190,12 @@ Pod::Spec.new do |s|
|
|
|
190
190
|
sss.exclude_files = "react/renderer/observers/intersection/tests"
|
|
191
191
|
sss.header_dir = "react/renderer/observers/intersection"
|
|
192
192
|
end
|
|
193
|
+
|
|
194
|
+
ss.subspec "mutation" do |sss|
|
|
195
|
+
sss.source_files = podspec_sources("react/renderer/observers/mutation/**/*.{m,mm,cpp,h}", "react/renderer/observers/mutation/**/*.h")
|
|
196
|
+
sss.exclude_files = "react/renderer/observers/mutation/tests"
|
|
197
|
+
sss.header_dir = "react/renderer/observers/mutation"
|
|
198
|
+
end
|
|
193
199
|
end
|
|
194
200
|
|
|
195
201
|
s.subspec "telemetry" do |ss|
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
#define REACT_NATIVE_VERSION_MAJOR 0
|
|
16
16
|
#define REACT_NATIVE_VERSION_MINOR 85
|
|
17
|
-
#define REACT_NATIVE_VERSION_PATCH
|
|
17
|
+
#define REACT_NATIVE_VERSION_PATCH 3
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
21
|
struct ReactNativeVersionType {
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 85;
|
|
24
|
-
int32_t Patch =
|
|
25
|
-
std::string_view Prerelease = "
|
|
24
|
+
int32_t Patch = 3;
|
|
25
|
+
std::string_view Prerelease = "1";
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
constexpr ReactNativeVersionType ReactNativeVersion;
|
|
@@ -198,6 +198,42 @@ class HostAgent::Impl final {
|
|
|
198
198
|
.shouldSendOKResponse = true,
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
|
+
if (InspectorFlags::getInstance().getScreenshotCaptureEnabled()) {
|
|
202
|
+
if (req.method == "Page.captureScreenshot") {
|
|
203
|
+
std::optional<std::string> format;
|
|
204
|
+
std::optional<int> quality;
|
|
205
|
+
|
|
206
|
+
if (req.params.isObject()) {
|
|
207
|
+
if (req.params.count("format") != 0u) {
|
|
208
|
+
format = req.params.at("format").asString();
|
|
209
|
+
}
|
|
210
|
+
if (req.params.count("quality") != 0u) {
|
|
211
|
+
quality = static_cast<int>(req.params.at("quality").asInt());
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
auto base64Data = targetController_.getDelegate().captureScreenshot(
|
|
216
|
+
{.format = format, .quality = quality});
|
|
217
|
+
|
|
218
|
+
if (base64Data.has_value()) {
|
|
219
|
+
frontendChannel_(
|
|
220
|
+
cdp::jsonResult(
|
|
221
|
+
req.id,
|
|
222
|
+
folly::dynamic::object("data", std::move(*base64Data))));
|
|
223
|
+
} else {
|
|
224
|
+
frontendChannel_(
|
|
225
|
+
cdp::jsonError(
|
|
226
|
+
req.id,
|
|
227
|
+
cdp::ErrorCode::InternalError,
|
|
228
|
+
"Failed to capture screenshot"));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
.isFinishedHandlingRequest = true,
|
|
233
|
+
.shouldSendOKResponse = false,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
201
237
|
if (req.method == "Overlay.setPausedInDebuggerMessage") {
|
|
202
238
|
auto message =
|
|
203
239
|
req.params.isObject() && (req.params.count("message") != 0u)
|
|
@@ -328,6 +328,7 @@ namespace {
|
|
|
328
328
|
struct StaticHostTargetMetadata {
|
|
329
329
|
std::optional<bool> isProfilingBuild;
|
|
330
330
|
std::optional<bool> networkInspectionEnabled;
|
|
331
|
+
std::optional<bool> frameRecordingEnabled;
|
|
331
332
|
};
|
|
332
333
|
|
|
333
334
|
StaticHostTargetMetadata getStaticHostMetadata() {
|
|
@@ -335,7 +336,8 @@ StaticHostTargetMetadata getStaticHostMetadata() {
|
|
|
335
336
|
|
|
336
337
|
return {
|
|
337
338
|
.isProfilingBuild = inspectorFlags.getIsProfilingBuild(),
|
|
338
|
-
.networkInspectionEnabled = inspectorFlags.getNetworkInspectionEnabled()
|
|
339
|
+
.networkInspectionEnabled = inspectorFlags.getNetworkInspectionEnabled(),
|
|
340
|
+
.frameRecordingEnabled = inspectorFlags.getFrameRecordingEnabled()};
|
|
339
341
|
}
|
|
340
342
|
|
|
341
343
|
} // namespace
|
|
@@ -370,6 +372,10 @@ folly::dynamic createHostMetadataPayload(const HostTargetMetadata& metadata) {
|
|
|
370
372
|
result["unstable_networkInspectionEnabled"] =
|
|
371
373
|
staticMetadata.networkInspectionEnabled.value();
|
|
372
374
|
}
|
|
375
|
+
if (staticMetadata.frameRecordingEnabled) {
|
|
376
|
+
result["unstable_frameRecordingEnabled"] =
|
|
377
|
+
staticMetadata.frameRecordingEnabled.value();
|
|
378
|
+
}
|
|
373
379
|
|
|
374
380
|
return result;
|
|
375
381
|
}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
#include "ScopedExecutor.h"
|
|
17
17
|
#include "WeakList.h"
|
|
18
18
|
|
|
19
|
+
#include <functional>
|
|
19
20
|
#include <optional>
|
|
20
21
|
#include <set>
|
|
21
22
|
#include <string>
|
|
@@ -134,6 +135,19 @@ class HostTargetDelegate : public LoadNetworkResourceDelegate {
|
|
|
134
135
|
}
|
|
135
136
|
};
|
|
136
137
|
|
|
138
|
+
struct PageCaptureScreenshotRequest {
|
|
139
|
+
/**
|
|
140
|
+
* Image compression format. Defaults to "png".
|
|
141
|
+
* Allowed values: "jpeg", "png", "webp".
|
|
142
|
+
*/
|
|
143
|
+
std::optional<std::string> format;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Compression quality from range [0..100] (jpeg only).
|
|
147
|
+
*/
|
|
148
|
+
std::optional<int> quality;
|
|
149
|
+
};
|
|
150
|
+
|
|
137
151
|
virtual ~HostTargetDelegate() override;
|
|
138
152
|
|
|
139
153
|
/**
|
|
@@ -181,6 +195,17 @@ class HostTargetDelegate : public LoadNetworkResourceDelegate {
|
|
|
181
195
|
"LoadNetworkResourceDelegate.loadNetworkResource is not implemented by this host target delegate.");
|
|
182
196
|
}
|
|
183
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Called when the debugger requests a screenshot of the current page via
|
|
200
|
+
* @cdp Page.captureScreenshot. The delegate should capture the current
|
|
201
|
+
* view, encode it to the requested format, and return base64-encoded
|
|
202
|
+
* image data. Return std::nullopt on failure.
|
|
203
|
+
*/
|
|
204
|
+
virtual std::optional<std::string> captureScreenshot(const PageCaptureScreenshotRequest & /*request*/)
|
|
205
|
+
{
|
|
206
|
+
return std::nullopt;
|
|
207
|
+
}
|
|
208
|
+
|
|
184
209
|
/**
|
|
185
210
|
* An optional delegate that will be used by HostTarget to notify about tracing-related events.
|
|
186
211
|
*/
|
|
@@ -93,7 +93,7 @@ void HostTarget::recordFrameTimings(
|
|
|
93
93
|
std::lock_guard lock(tracingMutex_);
|
|
94
94
|
|
|
95
95
|
if (traceRecording_) {
|
|
96
|
-
traceRecording_->recordFrameTimings(frameTimingSequence);
|
|
96
|
+
traceRecording_->recordFrameTimings(std::move(frameTimingSequence));
|
|
97
97
|
} else {
|
|
98
98
|
assert(
|
|
99
99
|
false &&
|
|
@@ -35,10 +35,10 @@ void emitNotificationsForTracingProfile(
|
|
|
35
35
|
std::convertible_to<std::ranges::range_value_t<ChannelsRange>, FrontendChannel>
|
|
36
36
|
{
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
39
|
-
* Tracing.dataCollected event.
|
|
38
|
+
* Maximum serialized byte size of a Trace Event chunk before it is flushed
|
|
39
|
+
* with a Tracing.dataCollected event.
|
|
40
40
|
*/
|
|
41
|
-
static constexpr
|
|
41
|
+
static constexpr size_t TRACE_EVENT_CHUNK_MAX_BYTES = 10 * 1024 * 1024; // 10 MiB
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The maximum number of ProfileChunk trace events
|
|
@@ -65,7 +65,7 @@ void emitNotificationsForTracingProfile(
|
|
|
65
65
|
cdp::jsonNotification("Tracing.dataCollected", folly::dynamic::object("value", serializedChunk)));
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
|
|
68
|
+
TRACE_EVENT_CHUNK_MAX_BYTES,
|
|
69
69
|
PROFILE_TRACE_EVENT_CHUNK_SIZE);
|
|
70
70
|
|
|
71
71
|
for (auto &frontendChannel : channels) {
|
|
@@ -21,6 +21,14 @@ bool InspectorFlags::getAssertSingleHostState() const {
|
|
|
21
21
|
return loadFlagsAndAssertUnchanged().assertSingleHostState;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
bool InspectorFlags::getScreenshotCaptureEnabled() const {
|
|
25
|
+
return loadFlagsAndAssertUnchanged().screenshotCaptureEnabled;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
bool InspectorFlags::getFrameRecordingEnabled() const {
|
|
29
|
+
return loadFlagsAndAssertUnchanged().frameRecordingEnabled;
|
|
30
|
+
}
|
|
31
|
+
|
|
24
32
|
bool InspectorFlags::getFuseboxEnabled() const {
|
|
25
33
|
if (fuseboxDisabledForTest_) {
|
|
26
34
|
return false;
|
|
@@ -54,6 +62,10 @@ const InspectorFlags::Values& InspectorFlags::loadFlagsAndAssertUnchanged()
|
|
|
54
62
|
InspectorFlags::Values newValues = {
|
|
55
63
|
.assertSingleHostState =
|
|
56
64
|
ReactNativeFeatureFlags::fuseboxAssertSingleHostState(),
|
|
65
|
+
.screenshotCaptureEnabled =
|
|
66
|
+
ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled(),
|
|
67
|
+
.frameRecordingEnabled =
|
|
68
|
+
ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled(),
|
|
57
69
|
.fuseboxEnabled =
|
|
58
70
|
#if defined(REACT_NATIVE_DEBUGGER_ENABLED)
|
|
59
71
|
true,
|
|
@@ -36,6 +36,16 @@ class InspectorFlags {
|
|
|
36
36
|
*/
|
|
37
37
|
bool getIsProfilingBuild() const;
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Flag determining if Page.captureScreenshot CDP method is enabled.
|
|
41
|
+
*/
|
|
42
|
+
bool getScreenshotCaptureEnabled() const;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Flag determining if frame recording (timings + screenshots) is enabled.
|
|
46
|
+
*/
|
|
47
|
+
bool getFrameRecordingEnabled() const;
|
|
48
|
+
|
|
39
49
|
/**
|
|
40
50
|
* Flag determining if network inspection is enabled.
|
|
41
51
|
*/
|
|
@@ -61,6 +71,8 @@ class InspectorFlags {
|
|
|
61
71
|
private:
|
|
62
72
|
struct Values {
|
|
63
73
|
bool assertSingleHostState;
|
|
74
|
+
bool screenshotCaptureEnabled;
|
|
75
|
+
bool frameRecordingEnabled;
|
|
64
76
|
bool fuseboxEnabled;
|
|
65
77
|
bool isProfilingBuild;
|
|
66
78
|
bool networkInspectionEnabled;
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
#include "RuntimeAgent.h"
|
|
9
9
|
#include "SessionState.h"
|
|
10
10
|
|
|
11
|
+
#include <folly/dynamic.h>
|
|
12
|
+
#include <jsinspector-modern/cdp/CdpJson.h>
|
|
13
|
+
|
|
14
|
+
#include <chrono>
|
|
11
15
|
#include <utility>
|
|
12
16
|
|
|
13
17
|
namespace facebook::react::jsinspector_modern {
|
|
@@ -119,6 +123,21 @@ void RuntimeAgent::notifyBindingCalled(
|
|
|
119
123
|
"name", bindingName)("payload", payload)));
|
|
120
124
|
}
|
|
121
125
|
|
|
126
|
+
void RuntimeAgent::notifyFastRefreshComplete() {
|
|
127
|
+
if (!sessionState_.isReactNativeApplicationDomainEnabled) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
folly::dynamic params = folly::dynamic::object(
|
|
131
|
+
"timestamp",
|
|
132
|
+
std::chrono::duration_cast<std::chrono::milliseconds>(
|
|
133
|
+
std::chrono::system_clock::now().time_since_epoch())
|
|
134
|
+
.count());
|
|
135
|
+
frontendChannel_(
|
|
136
|
+
cdp::jsonNotification(
|
|
137
|
+
"ReactNativeApplication.unstable_fastRefreshComplete",
|
|
138
|
+
std::move(params)));
|
|
139
|
+
}
|
|
140
|
+
|
|
122
141
|
RuntimeAgent::ExportedState RuntimeAgent::getExportedState() {
|
|
123
142
|
return {
|
|
124
143
|
.delegateState = delegate_ ? delegate_->getExportedState() : nullptr,
|
|
@@ -72,6 +72,13 @@ class RuntimeAgent final {
|
|
|
72
72
|
|
|
73
73
|
void notifyBindingCalled(const std::string &bindingName, const std::string &payload);
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Called by RuntimeTarget when JS calls __notifyFastRefreshComplete().
|
|
77
|
+
* Emits a ReactNativeApplication.unstable_fastRefreshComplete CDP
|
|
78
|
+
* notification if the ReactNativeApplication domain is enabled.
|
|
79
|
+
*/
|
|
80
|
+
void notifyFastRefreshComplete();
|
|
81
|
+
|
|
75
82
|
struct ExportedState {
|
|
76
83
|
std::unique_ptr<RuntimeAgentDelegate::ExportedState> delegateState;
|
|
77
84
|
};
|
|
@@ -47,6 +47,8 @@ void RuntimeTarget::installGlobals() {
|
|
|
47
47
|
// NOTE: RuntimeTarget::installNetworkReporterAPI is in
|
|
48
48
|
// RuntimeTargetNetwork.cpp
|
|
49
49
|
installNetworkReporterAPI();
|
|
50
|
+
|
|
51
|
+
installFastRefreshHandler();
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
std::shared_ptr<RuntimeAgent> RuntimeTarget::createAgent(
|
|
@@ -128,6 +130,37 @@ void RuntimeTarget::installBindingHandler(const std::string& bindingName) {
|
|
|
128
130
|
});
|
|
129
131
|
}
|
|
130
132
|
|
|
133
|
+
void RuntimeTarget::installFastRefreshHandler() {
|
|
134
|
+
jsExecutor_([selfExecutor = executorFromThis()](jsi::Runtime& runtime) {
|
|
135
|
+
auto globalObj = runtime.global();
|
|
136
|
+
try {
|
|
137
|
+
auto name =
|
|
138
|
+
jsi::PropNameID::forUtf8(runtime, "__notifyFastRefreshComplete");
|
|
139
|
+
globalObj.setProperty(
|
|
140
|
+
runtime,
|
|
141
|
+
name,
|
|
142
|
+
jsi::Function::createFromHostFunction(
|
|
143
|
+
runtime,
|
|
144
|
+
name,
|
|
145
|
+
0,
|
|
146
|
+
[selfExecutor](
|
|
147
|
+
jsi::Runtime& /*rt*/,
|
|
148
|
+
const jsi::Value&,
|
|
149
|
+
const jsi::Value*,
|
|
150
|
+
size_t) -> jsi::Value {
|
|
151
|
+
selfExecutor([](auto& self) {
|
|
152
|
+
self.agents_.forEach(
|
|
153
|
+
[](auto& agent) { agent.notifyFastRefreshComplete(); });
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
return jsi::Value::undefined();
|
|
157
|
+
}));
|
|
158
|
+
} catch (jsi::JSError&) {
|
|
159
|
+
// Swallow JavaScript exceptions that occur while setting up the global.
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
131
164
|
void RuntimeTarget::emitDebuggerSessionCreated() {
|
|
132
165
|
jsExecutor_([selfExecutor = executorFromThis()](jsi::Runtime& runtime) {
|
|
133
166
|
try {
|
|
@@ -295,6 +295,12 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis<RuntimeTa
|
|
|
295
295
|
*/
|
|
296
296
|
void installGlobals();
|
|
297
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Installs __notifyFastRefreshComplete on the runtime's global object.
|
|
300
|
+
* When called from JS, dispatches to all connected RuntimeAgents.
|
|
301
|
+
*/
|
|
302
|
+
void installFastRefreshHandler();
|
|
303
|
+
|
|
298
304
|
/**
|
|
299
305
|
* Install the console API handler.
|
|
300
306
|
*/
|
|
@@ -1579,4 +1579,16 @@ TEST_F(HostTargetTest, TracingDelegateIsNotifiedOnDirectTracingCall) {
|
|
|
1579
1579
|
page_->stopTracing();
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
+
TEST_F(HostTargetProtocolTest, CaptureScreenshotNotSupportedWhenFlagDisabled) {
|
|
1583
|
+
EXPECT_CALL(
|
|
1584
|
+
fromPage(),
|
|
1585
|
+
onMessage(JsonParsed(AllOf(
|
|
1586
|
+
AtJsonPtr("/error/code", Eq(-32601)), AtJsonPtr("/id", Eq(1))))))
|
|
1587
|
+
.RetiresOnSaturation();
|
|
1588
|
+
toPage_->sendMessage(R"({
|
|
1589
|
+
"id": 1,
|
|
1590
|
+
"method": "Page.captureScreenshot"
|
|
1591
|
+
})");
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1582
1594
|
} // namespace facebook::react::jsinspector_modern
|