react-native 0.85.1 → 0.85.3
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/Libraries/Utilities/HMRClient.js +28 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTDevLoadingView.mm +17 -0
- 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 -454
- 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/ReactAndroid/gradle.properties +1 -1
- 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 +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +50 -10
- 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 +2 -2
- 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/animated/NativeAnimatedNodesManager.cpp +4 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +58 -25
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +9 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +5 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.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
|
@@ -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<<e2a6a7a32ffbf20eb8906dfa526a5f9b>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -414,6 +414,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
414
414
|
return ReactNativeFeatureFlagsDefaults::enableModuleArgumentNSNullConversionIOS();
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
+
bool enableMutationObserverByDefault() override {
|
|
418
|
+
auto value = values_["enableMutationObserverByDefault"];
|
|
419
|
+
if (!value.isNull()) {
|
|
420
|
+
return value.getBool();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return ReactNativeFeatureFlagsDefaults::enableMutationObserverByDefault();
|
|
424
|
+
}
|
|
425
|
+
|
|
417
426
|
bool enableNativeCSSParsing() override {
|
|
418
427
|
auto value = values_["enableNativeCSSParsing"];
|
|
419
428
|
if (!value.isNull()) {
|
|
@@ -576,6 +585,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
576
585
|
return ReactNativeFeatureFlagsDefaults::fuseboxEnabledRelease();
|
|
577
586
|
}
|
|
578
587
|
|
|
588
|
+
bool fuseboxFrameRecordingEnabled() override {
|
|
589
|
+
auto value = values_["fuseboxFrameRecordingEnabled"];
|
|
590
|
+
if (!value.isNull()) {
|
|
591
|
+
return value.getBool();
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return ReactNativeFeatureFlagsDefaults::fuseboxFrameRecordingEnabled();
|
|
595
|
+
}
|
|
596
|
+
|
|
579
597
|
bool fuseboxNetworkInspectionEnabled() override {
|
|
580
598
|
auto value = values_["fuseboxNetworkInspectionEnabled"];
|
|
581
599
|
if (!value.isNull()) {
|
|
@@ -585,6 +603,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
585
603
|
return ReactNativeFeatureFlagsDefaults::fuseboxNetworkInspectionEnabled();
|
|
586
604
|
}
|
|
587
605
|
|
|
606
|
+
bool fuseboxScreenshotCaptureEnabled() override {
|
|
607
|
+
auto value = values_["fuseboxScreenshotCaptureEnabled"];
|
|
608
|
+
if (!value.isNull()) {
|
|
609
|
+
return value.getBool();
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
return ReactNativeFeatureFlagsDefaults::fuseboxScreenshotCaptureEnabled();
|
|
613
|
+
}
|
|
614
|
+
|
|
588
615
|
bool hideOffscreenVirtualViewsOnIOS() override {
|
|
589
616
|
auto value = values_["hideOffscreenVirtualViewsOnIOS"];
|
|
590
617
|
if (!value.isNull()) {
|
|
@@ -639,6 +666,24 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
639
666
|
return ReactNativeFeatureFlagsDefaults::preventShadowTreeCommitExhaustion();
|
|
640
667
|
}
|
|
641
668
|
|
|
669
|
+
bool redBoxV2Android() override {
|
|
670
|
+
auto value = values_["redBoxV2Android"];
|
|
671
|
+
if (!value.isNull()) {
|
|
672
|
+
return value.getBool();
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
return ReactNativeFeatureFlagsDefaults::redBoxV2Android();
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
bool redBoxV2IOS() override {
|
|
679
|
+
auto value = values_["redBoxV2IOS"];
|
|
680
|
+
if (!value.isNull()) {
|
|
681
|
+
return value.getBool();
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
return ReactNativeFeatureFlagsDefaults::redBoxV2IOS();
|
|
685
|
+
}
|
|
686
|
+
|
|
642
687
|
bool shouldPressibilityUseW3CPointerEventsForHover() override {
|
|
643
688
|
auto value = values_["shouldPressibilityUseW3CPointerEventsForHover"];
|
|
644
689
|
if (!value.isNull()) {
|
|
@@ -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<<ba443ccb843898a70e1968ba5d4ab62c>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -66,6 +66,7 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
66
66
|
virtual bool enableLayoutAnimationsOnIOS() = 0;
|
|
67
67
|
virtual bool enableMainQueueCoordinatorOnIOS() = 0;
|
|
68
68
|
virtual bool enableModuleArgumentNSNullConversionIOS() = 0;
|
|
69
|
+
virtual bool enableMutationObserverByDefault() = 0;
|
|
69
70
|
virtual bool enableNativeCSSParsing() = 0;
|
|
70
71
|
virtual bool enableNetworkEventReporting() = 0;
|
|
71
72
|
virtual bool enablePreparedTextLayout() = 0;
|
|
@@ -84,13 +85,17 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
84
85
|
virtual bool fixTextClippingAndroid15useBoundsForWidth() = 0;
|
|
85
86
|
virtual bool fuseboxAssertSingleHostState() = 0;
|
|
86
87
|
virtual bool fuseboxEnabledRelease() = 0;
|
|
88
|
+
virtual bool fuseboxFrameRecordingEnabled() = 0;
|
|
87
89
|
virtual bool fuseboxNetworkInspectionEnabled() = 0;
|
|
90
|
+
virtual bool fuseboxScreenshotCaptureEnabled() = 0;
|
|
88
91
|
virtual bool hideOffscreenVirtualViewsOnIOS() = 0;
|
|
89
92
|
virtual bool overrideBySynchronousMountPropsAtMountingAndroid() = 0;
|
|
90
93
|
virtual bool perfIssuesEnabled() = 0;
|
|
91
94
|
virtual bool perfMonitorV2Enabled() = 0;
|
|
92
95
|
virtual double preparedTextCacheSize() = 0;
|
|
93
96
|
virtual bool preventShadowTreeCommitExhaustion() = 0;
|
|
97
|
+
virtual bool redBoxV2Android() = 0;
|
|
98
|
+
virtual bool redBoxV2IOS() = 0;
|
|
94
99
|
virtual bool shouldPressibilityUseW3CPointerEventsForHover() = 0;
|
|
95
100
|
virtual bool shouldTriggerResponderTransferOnScrollAndroid() = 0;
|
|
96
101
|
virtual bool skipActivityIdentityAssertionOnHostPause() = 0;
|
|
@@ -22,6 +22,7 @@ target_link_libraries(react_nativemodule_defaults
|
|
|
22
22
|
react_nativemodule_microtasks
|
|
23
23
|
react_nativemodule_idlecallbacks
|
|
24
24
|
react_nativemodule_intersectionobserver
|
|
25
|
+
react_nativemodule_mutationobserver
|
|
25
26
|
react_nativemodule_webperformance
|
|
26
27
|
react_renderer_animated
|
|
27
28
|
)
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include <react/nativemodule/idlecallbacks/NativeIdleCallbacks.h>
|
|
13
13
|
#include <react/nativemodule/intersectionobserver/NativeIntersectionObserver.h>
|
|
14
14
|
#include <react/nativemodule/microtasks/NativeMicrotasks.h>
|
|
15
|
+
#include <react/nativemodule/mutationobserver/NativeMutationObserver.h>
|
|
15
16
|
#include <react/nativemodule/webperformance/NativePerformance.h>
|
|
16
17
|
#include <react/renderer/animated/AnimatedModule.h>
|
|
17
18
|
|
|
@@ -50,6 +51,12 @@ namespace facebook::react {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
if (ReactNativeFeatureFlags::enableMutationObserverByDefault()) {
|
|
55
|
+
if (name == NativeMutationObserver::kModuleName) {
|
|
56
|
+
return std::make_shared<NativeMutationObserver>(jsInvoker);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
53
60
|
if (ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() &&
|
|
54
61
|
ReactNativeFeatureFlags::useSharedAnimatedBackend() &&
|
|
55
62
|
name == AnimatedModule::kModuleName) {
|
|
@@ -53,6 +53,7 @@ Pod::Spec.new do |s|
|
|
|
53
53
|
s.dependency "React-microtasksnativemodule"
|
|
54
54
|
s.dependency "React-idlecallbacksnativemodule"
|
|
55
55
|
s.dependency "React-intersectionobservernativemodule"
|
|
56
|
+
s.dependency "React-mutationobservernativemodule"
|
|
56
57
|
s.dependency "React-webperformancenativemodule"
|
|
57
58
|
s.dependency "React-Fabric/animated"
|
|
58
59
|
add_dependency(s, "React-RCTFBReactNativeSpec")
|
|
@@ -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<<4dd16dbf31dc31860960aa2abcb7862d>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -249,6 +249,11 @@ bool NativeReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS(
|
|
|
249
249
|
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
bool NativeReactNativeFeatureFlags::enableMutationObserverByDefault(
|
|
253
|
+
jsi::Runtime& /*runtime*/) {
|
|
254
|
+
return ReactNativeFeatureFlags::enableMutationObserverByDefault();
|
|
255
|
+
}
|
|
256
|
+
|
|
252
257
|
bool NativeReactNativeFeatureFlags::enableNativeCSSParsing(
|
|
253
258
|
jsi::Runtime& /*runtime*/) {
|
|
254
259
|
return ReactNativeFeatureFlags::enableNativeCSSParsing();
|
|
@@ -339,11 +344,21 @@ bool NativeReactNativeFeatureFlags::fuseboxEnabledRelease(
|
|
|
339
344
|
return ReactNativeFeatureFlags::fuseboxEnabledRelease();
|
|
340
345
|
}
|
|
341
346
|
|
|
347
|
+
bool NativeReactNativeFeatureFlags::fuseboxFrameRecordingEnabled(
|
|
348
|
+
jsi::Runtime& /*runtime*/) {
|
|
349
|
+
return ReactNativeFeatureFlags::fuseboxFrameRecordingEnabled();
|
|
350
|
+
}
|
|
351
|
+
|
|
342
352
|
bool NativeReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled(
|
|
343
353
|
jsi::Runtime& /*runtime*/) {
|
|
344
354
|
return ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled();
|
|
345
355
|
}
|
|
346
356
|
|
|
357
|
+
bool NativeReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled(
|
|
358
|
+
jsi::Runtime& /*runtime*/) {
|
|
359
|
+
return ReactNativeFeatureFlags::fuseboxScreenshotCaptureEnabled();
|
|
360
|
+
}
|
|
361
|
+
|
|
347
362
|
bool NativeReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS(
|
|
348
363
|
jsi::Runtime& /*runtime*/) {
|
|
349
364
|
return ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS();
|
|
@@ -374,6 +389,16 @@ bool NativeReactNativeFeatureFlags::preventShadowTreeCommitExhaustion(
|
|
|
374
389
|
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion();
|
|
375
390
|
}
|
|
376
391
|
|
|
392
|
+
bool NativeReactNativeFeatureFlags::redBoxV2Android(
|
|
393
|
+
jsi::Runtime& /*runtime*/) {
|
|
394
|
+
return ReactNativeFeatureFlags::redBoxV2Android();
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
bool NativeReactNativeFeatureFlags::redBoxV2IOS(
|
|
398
|
+
jsi::Runtime& /*runtime*/) {
|
|
399
|
+
return ReactNativeFeatureFlags::redBoxV2IOS();
|
|
400
|
+
}
|
|
401
|
+
|
|
377
402
|
bool NativeReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover(
|
|
378
403
|
jsi::Runtime& /*runtime*/) {
|
|
379
404
|
return ReactNativeFeatureFlags::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<<ed4a87c5d258ebf5aa61e7d74d1b09be>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -118,6 +118,8 @@ class NativeReactNativeFeatureFlags
|
|
|
118
118
|
|
|
119
119
|
bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime& runtime);
|
|
120
120
|
|
|
121
|
+
bool enableMutationObserverByDefault(jsi::Runtime& runtime);
|
|
122
|
+
|
|
121
123
|
bool enableNativeCSSParsing(jsi::Runtime& runtime);
|
|
122
124
|
|
|
123
125
|
bool enableNetworkEventReporting(jsi::Runtime& runtime);
|
|
@@ -154,8 +156,12 @@ class NativeReactNativeFeatureFlags
|
|
|
154
156
|
|
|
155
157
|
bool fuseboxEnabledRelease(jsi::Runtime& runtime);
|
|
156
158
|
|
|
159
|
+
bool fuseboxFrameRecordingEnabled(jsi::Runtime& runtime);
|
|
160
|
+
|
|
157
161
|
bool fuseboxNetworkInspectionEnabled(jsi::Runtime& runtime);
|
|
158
162
|
|
|
163
|
+
bool fuseboxScreenshotCaptureEnabled(jsi::Runtime& runtime);
|
|
164
|
+
|
|
159
165
|
bool hideOffscreenVirtualViewsOnIOS(jsi::Runtime& runtime);
|
|
160
166
|
|
|
161
167
|
bool overrideBySynchronousMountPropsAtMountingAndroid(jsi::Runtime& runtime);
|
|
@@ -168,6 +174,10 @@ class NativeReactNativeFeatureFlags
|
|
|
168
174
|
|
|
169
175
|
bool preventShadowTreeCommitExhaustion(jsi::Runtime& runtime);
|
|
170
176
|
|
|
177
|
+
bool redBoxV2Android(jsi::Runtime& runtime);
|
|
178
|
+
|
|
179
|
+
bool redBoxV2IOS(jsi::Runtime& runtime);
|
|
180
|
+
|
|
171
181
|
bool shouldPressibilityUseW3CPointerEventsForHover(jsi::Runtime& runtime);
|
|
172
182
|
|
|
173
183
|
bool shouldTriggerResponderTransferOnScrollAndroid(jsi::Runtime& runtime);
|
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
+
#if __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple
|
|
11
|
+
#include "FBReactNativeSpecJSI.h"
|
|
12
|
+
#else
|
|
10
13
|
#include <FBReactNativeSpec/FBReactNativeSpecJSI.h>
|
|
14
|
+
#endif
|
|
11
15
|
#include <react/renderer/bridging/bridging.h>
|
|
12
16
|
#include <react/renderer/observers/mutation/MutationObserverManager.h>
|
|
13
17
|
#include <react/renderer/uimanager/UIManager.h>
|
package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
require "json"
|
|
7
|
+
|
|
8
|
+
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json")))
|
|
9
|
+
version = package['version']
|
|
10
|
+
|
|
11
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
12
|
+
if version == '1000.0.0'
|
|
13
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we're presumably in.
|
|
14
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
15
|
+
else
|
|
16
|
+
source[:tag] = "v#{version}"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
header_search_paths = [
|
|
20
|
+
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
if ENV['USE_FRAMEWORKS']
|
|
24
|
+
header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" # this is needed to allow the module access its own files
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Pod::Spec.new do |s|
|
|
28
|
+
s.name = "React-mutationobservernativemodule"
|
|
29
|
+
s.version = version
|
|
30
|
+
s.summary = "React Native mutation observer native module"
|
|
31
|
+
s.homepage = "https://reactnative.dev/"
|
|
32
|
+
s.license = package["license"]
|
|
33
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
34
|
+
s.platforms = min_supported_versions
|
|
35
|
+
s.source = source
|
|
36
|
+
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
|
|
37
|
+
s.header_dir = "react/nativemodule/mutationobserver"
|
|
38
|
+
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
39
|
+
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
|
40
|
+
"OTHER_CFLAGS" => "$(inherited)",
|
|
41
|
+
"DEFINES_MODULE" => "YES" }
|
|
42
|
+
|
|
43
|
+
if ENV['USE_FRAMEWORKS']
|
|
44
|
+
s.module_name = "mutationobservernativemodule"
|
|
45
|
+
s.header_mappings_dir = "../.."
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
s.dependency "Yoga"
|
|
49
|
+
s.dependency "React-jsi"
|
|
50
|
+
s.dependency "React-jsiexecutor"
|
|
51
|
+
s.dependency "React-cxxreact"
|
|
52
|
+
|
|
53
|
+
depend_on_js_engine(s)
|
|
54
|
+
add_rn_third_party_dependencies(s)
|
|
55
|
+
add_rncore_dependency(s)
|
|
56
|
+
|
|
57
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
58
|
+
|
|
59
|
+
s.dependency "React-Fabric"
|
|
60
|
+
s.dependency "React-Fabric/bridging"
|
|
61
|
+
s.dependency "React-Fabric/observers/mutation"
|
|
62
|
+
s.dependency "React-featureflags"
|
|
63
|
+
add_dependency(s, "React-RCTFBReactNativeSpec")
|
|
64
|
+
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
|
65
|
+
|
|
66
|
+
end
|
|
@@ -25,16 +25,21 @@ void PerformanceObserver::handleEntry(const PerformanceEntry& entry) {
|
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
{
|
|
29
|
+
std::lock_guard lock(bufferMutex_);
|
|
30
|
+
buffer_.push_back(entry);
|
|
31
|
+
}
|
|
29
32
|
scheduleFlushBuffer();
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
std::vector<PerformanceEntry> PerformanceObserver::takeRecords() {
|
|
34
37
|
std::vector<PerformanceEntry> result;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
{
|
|
39
|
+
std::lock_guard lock(bufferMutex_);
|
|
40
|
+
buffer_.swap(result);
|
|
41
|
+
didScheduleFlushBuffer_ = false;
|
|
42
|
+
}
|
|
38
43
|
|
|
39
44
|
return result;
|
|
40
45
|
}
|
|
@@ -87,9 +92,16 @@ void PerformanceObserver::disconnect() noexcept {
|
|
|
87
92
|
}
|
|
88
93
|
|
|
89
94
|
void PerformanceObserver::scheduleFlushBuffer() {
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
bool shouldSchedule = false;
|
|
96
|
+
{
|
|
97
|
+
std::lock_guard lock(bufferMutex_);
|
|
98
|
+
if (!didScheduleFlushBuffer_) {
|
|
99
|
+
didScheduleFlushBuffer_ = true;
|
|
100
|
+
shouldSchedule = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
92
103
|
|
|
104
|
+
if (shouldSchedule) {
|
|
93
105
|
callback_();
|
|
94
106
|
}
|
|
95
107
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
#include <functional>
|
|
16
16
|
#include <memory>
|
|
17
|
+
#include <mutex>
|
|
17
18
|
#include <unordered_set>
|
|
18
19
|
#include <vector>
|
|
19
20
|
|
|
@@ -126,6 +127,7 @@ class PerformanceObserver : public std::enable_shared_from_this<PerformanceObser
|
|
|
126
127
|
|
|
127
128
|
/// https://www.w3.org/TR/event-timing/#sec-modifications-perf-timeline
|
|
128
129
|
HighResDuration durationThreshold_ = DEFAULT_DURATION_THRESHOLD;
|
|
130
|
+
std::mutex bufferMutex_;
|
|
129
131
|
std::vector<PerformanceEntry> buffer_;
|
|
130
132
|
bool didScheduleFlushBuffer_ = false;
|
|
131
133
|
bool requiresDroppedEntries_ = false;
|
|
@@ -515,7 +515,10 @@ void NativeAnimatedNodesManager::handleAnimatedEvent(
|
|
|
515
515
|
// frames.
|
|
516
516
|
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
|
|
517
517
|
if (auto animationBackend = animationBackend_.lock()) {
|
|
518
|
-
animationBackend->
|
|
518
|
+
animationBackend->pushAnimationMutations(
|
|
519
|
+
[this](AnimationTimestamp timestamp) -> AnimationMutations {
|
|
520
|
+
return pullAnimationMutations(timestamp);
|
|
521
|
+
});
|
|
519
522
|
}
|
|
520
523
|
} else {
|
|
521
524
|
onRender();
|
|
@@ -24,10 +24,17 @@ static inline Props::Shared cloneProps(
|
|
|
24
24
|
shadowNode.getSurfaceId(), *shadowNode.getContextContainer()};
|
|
25
25
|
Props::Shared newProps;
|
|
26
26
|
if (animatedProps.rawProps) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if (ReactNativeFeatureFlags::enableFabricCommitBranching()) {
|
|
28
|
+
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
29
|
+
propsParserContext,
|
|
30
|
+
shadowNode.getProps(),
|
|
31
|
+
std::move(*animatedProps.rawProps));
|
|
32
|
+
} else {
|
|
33
|
+
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
34
|
+
propsParserContext,
|
|
35
|
+
shadowNode.getProps(),
|
|
36
|
+
RawProps(*animatedProps.rawProps));
|
|
37
|
+
}
|
|
31
38
|
} else {
|
|
32
39
|
newProps = shadowNode.getComponentDescriptor().cloneProps(
|
|
33
40
|
propsParserContext, shadowNode.getProps(), {});
|
|
@@ -51,31 +58,27 @@ AnimationBackend::AnimationBackend(
|
|
|
51
58
|
react_native_assert(uiManager_.expired() == false);
|
|
52
59
|
}
|
|
53
60
|
|
|
54
|
-
void AnimationBackend::
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
void AnimationBackend::unpackMutations(
|
|
62
|
+
AnimationMutations& mutations,
|
|
63
|
+
std::unordered_map<SurfaceId, SurfaceUpdates>& surfaceUpdates,
|
|
64
|
+
std::set<SurfaceId>& asyncFlushSurfaces) {
|
|
65
|
+
for (auto& mutation : mutations.batch) {
|
|
66
|
+
const auto family = mutation.family;
|
|
67
|
+
react_native_assert(family != nullptr);
|
|
58
68
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
auto& [families, updates, hasLayoutUpdates] =
|
|
70
|
+
surfaceUpdates[family->getSurfaceId()];
|
|
71
|
+
hasLayoutUpdates |= mutation.hasLayoutUpdates;
|
|
72
|
+
families.insert(family);
|
|
73
|
+
updates[mutation.tag] = std::move(mutation.props);
|
|
62
74
|
}
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
asyncFlushSurfaces.merge(mutations.asyncFlushSurfaces);
|
|
67
|
-
for (auto& mutation : mutations.batch) {
|
|
68
|
-
const auto family = mutation.family;
|
|
69
|
-
react_native_assert(family != nullptr);
|
|
70
|
-
|
|
71
|
-
auto& [families, updates, hasLayoutUpdates] =
|
|
72
|
-
surfaceUpdates[family->getSurfaceId()];
|
|
73
|
-
hasLayoutUpdates |= mutation.hasLayoutUpdates;
|
|
74
|
-
families.insert(family);
|
|
75
|
-
updates[mutation.tag] = std::move(mutation.props);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
76
|
+
asyncFlushSurfaces.merge(mutations.asyncFlushSurfaces);
|
|
77
|
+
}
|
|
78
78
|
|
|
79
|
+
void AnimationBackend::applySurfaceUpdates(
|
|
80
|
+
std::unordered_map<SurfaceId, SurfaceUpdates>& surfaceUpdates,
|
|
81
|
+
const std::set<SurfaceId>& asyncFlushSurfaces) {
|
|
79
82
|
animatedPropsRegistry_->update(surfaceUpdates);
|
|
80
83
|
|
|
81
84
|
for (auto& [surfaceId, updates] : surfaceUpdates) {
|
|
@@ -89,6 +92,30 @@ void AnimationBackend::onAnimationFrame(AnimationTimestamp timestamp) {
|
|
|
89
92
|
requestAsyncFlushForSurfaces(asyncFlushSurfaces);
|
|
90
93
|
}
|
|
91
94
|
|
|
95
|
+
void AnimationBackend::applyMutations(AnimationMutations mutations) {
|
|
96
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> surfaceUpdates;
|
|
97
|
+
std::set<SurfaceId> asyncFlushSurfaces;
|
|
98
|
+
unpackMutations(mutations, surfaceUpdates, asyncFlushSurfaces);
|
|
99
|
+
applySurfaceUpdates(surfaceUpdates, asyncFlushSurfaces);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void AnimationBackend::onAnimationFrame(AnimationTimestamp timestamp) {
|
|
103
|
+
std::vector<CallbackWithId> callbacksCopy;
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
std::lock_guard lock(mutex_);
|
|
107
|
+
callbacksCopy = callbacks;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> surfaceUpdates;
|
|
111
|
+
std::set<SurfaceId> asyncFlushSurfaces;
|
|
112
|
+
for (auto& callbackWithId : callbacksCopy) {
|
|
113
|
+
auto mutations = callbackWithId.callback(timestamp);
|
|
114
|
+
unpackMutations(mutations, surfaceUpdates, asyncFlushSurfaces);
|
|
115
|
+
}
|
|
116
|
+
applySurfaceUpdates(surfaceUpdates, asyncFlushSurfaces);
|
|
117
|
+
}
|
|
118
|
+
|
|
92
119
|
CallbackId AnimationBackend::start(const Callback& callback) {
|
|
93
120
|
std::lock_guard lock(mutex_);
|
|
94
121
|
|
|
@@ -123,6 +150,12 @@ void AnimationBackend::trigger() {
|
|
|
123
150
|
onAnimationFrame(std::chrono::steady_clock::now().time_since_epoch());
|
|
124
151
|
}
|
|
125
152
|
|
|
153
|
+
void AnimationBackend::pushAnimationMutations(const Callback& callback) {
|
|
154
|
+
auto timestamp = animationChoreographer_->now();
|
|
155
|
+
auto mutations = callback(timestamp);
|
|
156
|
+
applyMutations(std::move(mutations));
|
|
157
|
+
}
|
|
158
|
+
|
|
126
159
|
void AnimationBackend::commitUpdates(
|
|
127
160
|
SurfaceId surfaceId,
|
|
128
161
|
SurfaceUpdates& surfaceUpdates) {
|
|
@@ -60,10 +60,19 @@ class AnimationBackend : public UIManagerAnimationBackend {
|
|
|
60
60
|
|
|
61
61
|
void onAnimationFrame(AnimationTimestamp timestamp) override;
|
|
62
62
|
void trigger() override;
|
|
63
|
+
void pushAnimationMutations(const Callback &callback) override;
|
|
63
64
|
CallbackId start(const Callback &callback) override;
|
|
64
65
|
void stop(CallbackId callbackId) override;
|
|
65
66
|
|
|
66
67
|
private:
|
|
68
|
+
void unpackMutations(
|
|
69
|
+
AnimationMutations &mutations,
|
|
70
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> &surfaceUpdates,
|
|
71
|
+
std::set<SurfaceId> &asyncFlushSurfaces);
|
|
72
|
+
void applySurfaceUpdates(
|
|
73
|
+
std::unordered_map<SurfaceId, SurfaceUpdates> &surfaceUpdates,
|
|
74
|
+
const std::set<SurfaceId> &asyncFlushSurfaces);
|
|
75
|
+
void applyMutations(AnimationMutations mutations);
|
|
67
76
|
std::vector<CallbackWithId> callbacks;
|
|
68
77
|
std::shared_ptr<AnimatedPropsRegistry> animatedPropsRegistry_;
|
|
69
78
|
std::shared_ptr<AnimationChoreographer> animationChoreographer_;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
10
|
#include <react/renderer/uimanager/UIManagerAnimationBackend.h>
|
|
11
|
+
#include <react/timing/primitives.h>
|
|
11
12
|
|
|
12
13
|
namespace facebook::react {
|
|
13
14
|
|
|
@@ -21,6 +22,10 @@ class AnimationChoreographer {
|
|
|
21
22
|
|
|
22
23
|
virtual void resume() = 0;
|
|
23
24
|
virtual void pause() = 0;
|
|
25
|
+
virtual AnimationTimestamp now() const
|
|
26
|
+
{
|
|
27
|
+
return HighResTimeStamp::now().toChronoSteadyClockTimePoint().time_since_epoch();
|
|
28
|
+
}
|
|
24
29
|
void setAnimationBackend(std::weak_ptr<UIManagerAnimationBackend> animationBackend)
|
|
25
30
|
{
|
|
26
31
|
animationBackend_ = animationBackend;
|
|
@@ -31,6 +31,7 @@ class UIManagerAnimationBackend {
|
|
|
31
31
|
virtual void stop(CallbackId callbackId) = 0;
|
|
32
32
|
virtual void clearRegistry(SurfaceId surfaceId) = 0;
|
|
33
33
|
virtual void trigger() = 0;
|
|
34
|
+
virtual void pushAnimationMutations(const Callback &callback) = 0;
|
|
34
35
|
virtual void registerJSInvoker(std::shared_ptr<CallInvoker> jsInvoker) = 0;
|
|
35
36
|
};
|
|
36
37
|
|