react-native 0.84.0-nightly-20251105-5ec5cc3a3 → 0.84.0-nightly-20251107-f8198f662
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/Animated/createAnimatedComponent.js +1 -0
- package/Libraries/Components/Button.js +0 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.android.js +2 -2
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.js.flow +4 -2
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +8 -8
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- package/React/Runtime/React-RCTRuntime.podspec +1 -0
- package/ReactAndroid/api/ReactAndroid.api +0 -13
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.kt +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +2 -6
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.kt +1 -16
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +7 -7
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +11 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +12 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.kt +2 -35
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt +3 -36
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +7 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt +11 -1
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +36 -26
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +15 -15
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +4 -4
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +3 -13
- package/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.h +1 -4
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapperBase.h +0 -24
- package/ReactAndroid/src/main/jni/react/jni/JavaModuleWrapper.cpp +0 -1
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.cpp +1 -29
- package/ReactAndroid/src/main/jni/react/jni/ModuleRegistryBuilder.h +1 -2
- package/ReactAndroid/src/main/jni/react/jni/OnLoad.cpp +0 -2
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactInstance.cpp +2 -1
- package/ReactAndroid/src/main/jni/react/turbomodule/ReactCommon/TurboModuleManager.cpp +1 -35
- package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
- package/ReactCommon/cxxreact/ReactMarker.cpp +0 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsiexecutor/CMakeLists.txt +3 -1
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +3 -0
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.cpp +0 -40
- package/ReactCommon/jsiexecutor/jsireact/JSIExecutor.h +1 -6
- package/ReactCommon/jsinspector-modern/ConsoleTask.cpp +27 -0
- package/ReactCommon/jsinspector-modern/ConsoleTask.h +38 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskContext.cpp +46 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskContext.h +102 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.cpp +55 -0
- package/ReactCommon/jsinspector-modern/ConsoleTaskOrchestrator.h +48 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +12 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +16 -13
- package/ReactCommon/jsinspector-modern/RuntimeTargetConsole.cpp +106 -1
- package/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp +131 -0
- package/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +13 -2
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +6 -2
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +4 -0
- package/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h +5 -0
- package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -0
- package/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.cpp +54 -0
- package/ReactCommon/jsitooling/react/runtime/JSRuntimeBindings.h +20 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +5 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +6 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +83 -83
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +3 -3
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +5 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +10 -10
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +2 -2
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +6 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +3 -3
- package/ReactCommon/react/performance/timeline/CMakeLists.txt +1 -0
- package/ReactCommon/react/performance/timeline/PerformanceEntryReporter.cpp +9 -1
- package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -0
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +21 -16
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +9 -5
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +67 -32
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +14 -2
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +1 -1
- package/ReactCommon/react/renderer/core/EventQueueProcessor.cpp +3 -3
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp +0 -20
- package/ReactCommon/react/renderer/scheduler/SurfaceHandler.h +3 -3
- package/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp +2 -3
- package/ReactCommon/react/runtime/ReactInstance.cpp +8 -6
- package/ReactCommon/react/runtime/ReactInstance.h +0 -1
- package/ReactCommon/react/utils/React-utils.podspec +3 -1
- package/flow/bom.js.flow +7 -0
- package/package.json +9 -8
- package/scripts/ios-configure-glog.sh +6 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +6 -6
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -2
- package/types_generated/Libraries/Components/Button.d.ts +1 -4
- package/types_generated/Libraries/StyleSheet/PlatformColorValueTypes.d.ts +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapper.kt +0 -25
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CxxModuleWrapperBase.kt +0 -61
- package/ReactAndroid/src/main/jni/react/jni/CxxModuleWrapper.h +0 -37
|
@@ -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<<85c260dcb8eb9209a53207c3c54183f0>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -59,6 +59,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
|
|
59
59
|
return true;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
bool disableSubviewClippingAndroid() override {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
62
66
|
bool disableTextLayoutManagerCacheAndroid() override {
|
|
63
67
|
return false;
|
|
64
68
|
}
|
|
@@ -315,10 +319,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
|
|
315
319
|
return false;
|
|
316
320
|
}
|
|
317
321
|
|
|
318
|
-
bool useOptimizedEventBatchingOnAndroid() override {
|
|
319
|
-
return false;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
322
|
bool useRawPropsJsiValue() override {
|
|
323
323
|
return true;
|
|
324
324
|
}
|
|
@@ -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<<0224a638fbec556a62c58f5d84c4c662>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -117,6 +117,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
117
117
|
return ReactNativeFeatureFlagsDefaults::disableOldAndroidAttachmentMetricsWorkarounds();
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
bool disableSubviewClippingAndroid() override {
|
|
121
|
+
auto value = values_["disableSubviewClippingAndroid"];
|
|
122
|
+
if (!value.isNull()) {
|
|
123
|
+
return value.getBool();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return ReactNativeFeatureFlagsDefaults::disableSubviewClippingAndroid();
|
|
127
|
+
}
|
|
128
|
+
|
|
120
129
|
bool disableTextLayoutManagerCacheAndroid() override {
|
|
121
130
|
auto value = values_["disableTextLayoutManagerCacheAndroid"];
|
|
122
131
|
if (!value.isNull()) {
|
|
@@ -693,15 +702,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
|
|
|
693
702
|
return ReactNativeFeatureFlagsDefaults::useNativeViewConfigsInBridgelessMode();
|
|
694
703
|
}
|
|
695
704
|
|
|
696
|
-
bool useOptimizedEventBatchingOnAndroid() override {
|
|
697
|
-
auto value = values_["useOptimizedEventBatchingOnAndroid"];
|
|
698
|
-
if (!value.isNull()) {
|
|
699
|
-
return value.getBool();
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
return ReactNativeFeatureFlagsDefaults::useOptimizedEventBatchingOnAndroid();
|
|
703
|
-
}
|
|
704
|
-
|
|
705
705
|
bool useRawPropsJsiValue() override {
|
|
706
706
|
auto value = values_["useRawPropsJsiValue"];
|
|
707
707
|
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<<a50e4901fa5524066608b64929744dd8>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -33,6 +33,7 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
33
33
|
virtual bool disableFabricCommitInCXXAnimated() = 0;
|
|
34
34
|
virtual bool disableMountItemReorderingAndroid() = 0;
|
|
35
35
|
virtual bool disableOldAndroidAttachmentMetricsWorkarounds() = 0;
|
|
36
|
+
virtual bool disableSubviewClippingAndroid() = 0;
|
|
36
37
|
virtual bool disableTextLayoutManagerCacheAndroid() = 0;
|
|
37
38
|
virtual bool enableAccessibilityOrder() = 0;
|
|
38
39
|
virtual bool enableAccumulatedUpdatesInRawPropsAndroid() = 0;
|
|
@@ -97,7 +98,6 @@ class ReactNativeFeatureFlagsProvider {
|
|
|
97
98
|
virtual bool useNativeEqualsInNativeReadableArrayAndroid() = 0;
|
|
98
99
|
virtual bool useNativeTransformHelperAndroid() = 0;
|
|
99
100
|
virtual bool useNativeViewConfigsInBridgelessMode() = 0;
|
|
100
|
-
virtual bool useOptimizedEventBatchingOnAndroid() = 0;
|
|
101
101
|
virtual bool useRawPropsJsiValue() = 0;
|
|
102
102
|
virtual bool useShadowNodeStateOnClone() = 0;
|
|
103
103
|
virtual bool useSharedAnimatedBackend() = 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<<bd66756451b25d73717a5907e6789a77>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -84,6 +84,11 @@ bool NativeReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkaround
|
|
|
84
84
|
return ReactNativeFeatureFlags::disableOldAndroidAttachmentMetricsWorkarounds();
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
bool NativeReactNativeFeatureFlags::disableSubviewClippingAndroid(
|
|
88
|
+
jsi::Runtime& /*runtime*/) {
|
|
89
|
+
return ReactNativeFeatureFlags::disableSubviewClippingAndroid();
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
bool NativeReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid(
|
|
88
93
|
jsi::Runtime& /*runtime*/) {
|
|
89
94
|
return ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid();
|
|
@@ -404,11 +409,6 @@ bool NativeReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode(
|
|
|
404
409
|
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
|
|
405
410
|
}
|
|
406
411
|
|
|
407
|
-
bool NativeReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid(
|
|
408
|
-
jsi::Runtime& /*runtime*/) {
|
|
409
|
-
return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid();
|
|
410
|
-
}
|
|
411
|
-
|
|
412
412
|
bool NativeReactNativeFeatureFlags::useRawPropsJsiValue(
|
|
413
413
|
jsi::Runtime& /*runtime*/) {
|
|
414
414
|
return ReactNativeFeatureFlags::useRawPropsJsiValue();
|
|
@@ -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<<0d898a94decb43e191a343676c8afb91>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -52,6 +52,8 @@ class NativeReactNativeFeatureFlags
|
|
|
52
52
|
|
|
53
53
|
bool disableOldAndroidAttachmentMetricsWorkarounds(jsi::Runtime& runtime);
|
|
54
54
|
|
|
55
|
+
bool disableSubviewClippingAndroid(jsi::Runtime& runtime);
|
|
56
|
+
|
|
55
57
|
bool disableTextLayoutManagerCacheAndroid(jsi::Runtime& runtime);
|
|
56
58
|
|
|
57
59
|
bool enableAccessibilityOrder(jsi::Runtime& runtime);
|
|
@@ -180,8 +182,6 @@ class NativeReactNativeFeatureFlags
|
|
|
180
182
|
|
|
181
183
|
bool useNativeViewConfigsInBridgelessMode(jsi::Runtime& runtime);
|
|
182
184
|
|
|
183
|
-
bool useOptimizedEventBatchingOnAndroid(jsi::Runtime& runtime);
|
|
184
|
-
|
|
185
185
|
bool useRawPropsJsiValue(jsi::Runtime& runtime);
|
|
186
186
|
|
|
187
187
|
bool useShadowNodeStateOnClone(jsi::Runtime& runtime);
|
|
@@ -16,6 +16,7 @@ target_compile_options(react_performance_timeline PRIVATE -Wpedantic)
|
|
|
16
16
|
|
|
17
17
|
target_include_directories(react_performance_timeline PUBLIC ${REACT_COMMON_DIR})
|
|
18
18
|
target_link_libraries(react_performance_timeline
|
|
19
|
+
jsinspector
|
|
19
20
|
jsinspector_tracing
|
|
20
21
|
reactperflogger
|
|
21
22
|
react_featureflags
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#include "PerformanceEntryReporter.h"
|
|
9
9
|
|
|
10
|
+
#include <jsinspector-modern/ConsoleTaskOrchestrator.h>
|
|
10
11
|
#include <jsinspector-modern/tracing/PerformanceTracer.h>
|
|
11
12
|
#include <react/featureflags/ReactNativeFeatureFlags.h>
|
|
12
13
|
#include <react/timing/primitives.h>
|
|
@@ -381,8 +382,15 @@ void PerformanceEntryReporter::traceMeasure(
|
|
|
381
382
|
}
|
|
382
383
|
|
|
383
384
|
if (performanceTracer.isTracing()) {
|
|
385
|
+
auto taskContext =
|
|
386
|
+
jsinspector_modern::ConsoleTaskOrchestrator::getInstance().top();
|
|
387
|
+
|
|
384
388
|
performanceTracer.reportMeasure(
|
|
385
|
-
entry.name,
|
|
389
|
+
entry.name,
|
|
390
|
+
entry.startTime,
|
|
391
|
+
entry.duration,
|
|
392
|
+
std::move(detail),
|
|
393
|
+
taskContext ? taskContext->getSerializedStackTrace() : nullptr);
|
|
386
394
|
}
|
|
387
395
|
}
|
|
388
396
|
}
|
|
@@ -41,6 +41,7 @@ Pod::Spec.new do |s|
|
|
|
41
41
|
resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancetimeline")
|
|
42
42
|
|
|
43
43
|
s.dependency "React-featureflags"
|
|
44
|
+
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
|
|
44
45
|
add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
|
|
45
46
|
s.dependency "React-timing"
|
|
46
47
|
s.dependency "React-perflogger"
|
|
@@ -519,6 +519,17 @@ NativeAnimatedNodesManager::ensureEventEmitterListener() noexcept {
|
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) {
|
|
522
|
+
// This method can be called from either the UI thread or JavaScript thread.
|
|
523
|
+
// It ensures `startOnRenderCallback_` is called exactly once using atomic
|
|
524
|
+
// operations. We use std::atomic_bool rather than std::mutex to avoid
|
|
525
|
+
// potential deadlocks that could occur if we called external code while
|
|
526
|
+
// holding a mutex.
|
|
527
|
+
auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(true);
|
|
528
|
+
if (isRenderCallbackStarted) {
|
|
529
|
+
// onRender callback is already started.
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
|
|
522
533
|
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
|
|
523
534
|
#ifdef RN_USE_ANIMATION_BACKEND
|
|
524
535
|
if (auto animationBackend = animationBackend_.lock()) {
|
|
@@ -531,16 +542,6 @@ void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) {
|
|
|
531
542
|
|
|
532
543
|
return;
|
|
533
544
|
}
|
|
534
|
-
// This method can be called from either the UI thread or JavaScript thread.
|
|
535
|
-
// It ensures `startOnRenderCallback_` is called exactly once using atomic
|
|
536
|
-
// operations. We use std::atomic_bool rather than std::mutex to avoid
|
|
537
|
-
// potential deadlocks that could occur if we called external code while
|
|
538
|
-
// holding a mutex.
|
|
539
|
-
auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(true);
|
|
540
|
-
if (isRenderCallbackStarted) {
|
|
541
|
-
// onRender callback is already started.
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
545
|
|
|
545
546
|
if (startOnRenderCallback_) {
|
|
546
547
|
startOnRenderCallback_([this]() { onRender(); }, isAsync);
|
|
@@ -549,18 +550,21 @@ void NativeAnimatedNodesManager::startRenderCallbackIfNeeded(bool isAsync) {
|
|
|
549
550
|
|
|
550
551
|
void NativeAnimatedNodesManager::stopRenderCallbackIfNeeded(
|
|
551
552
|
bool isAsync) noexcept {
|
|
552
|
-
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
|
|
553
|
-
if (auto animationBackend = animationBackend_.lock()) {
|
|
554
|
-
animationBackend->stop(isAsync);
|
|
555
|
-
}
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
553
|
// When multiple threads reach this point, only one thread should call
|
|
559
554
|
// stopOnRenderCallback_. This synchronization is primarily needed during
|
|
560
555
|
// destruction of NativeAnimatedNodesManager. In normal operation,
|
|
561
556
|
// stopRenderCallbackIfNeeded is always called from the UI thread.
|
|
562
557
|
auto isRenderCallbackStarted = isRenderCallbackStarted_.exchange(false);
|
|
563
558
|
|
|
559
|
+
if (ReactNativeFeatureFlags::useSharedAnimatedBackend()) {
|
|
560
|
+
if (isRenderCallbackStarted) {
|
|
561
|
+
if (auto animationBackend = animationBackend_.lock()) {
|
|
562
|
+
animationBackend->stop(isAsync);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
|
|
564
568
|
if (isRenderCallbackStarted) {
|
|
565
569
|
if (stopOnRenderCallback_) {
|
|
566
570
|
stopOnRenderCallback_(isAsync);
|
|
@@ -988,6 +992,7 @@ AnimationMutations NativeAnimatedNodesManager::pullAnimationMutations() {
|
|
|
988
992
|
AnimationMutation{tag, nullptr, propsBuilder.get()});
|
|
989
993
|
containsChange = true;
|
|
990
994
|
}
|
|
995
|
+
updateViewPropsDirect_.clear();
|
|
991
996
|
}
|
|
992
997
|
|
|
993
998
|
if (!containsChange) {
|
|
@@ -80,12 +80,16 @@ NativeAnimatedNodesManagerProvider::getOrCreate(
|
|
|
80
80
|
std::move(directManipulationCallback),
|
|
81
81
|
std::move(fabricCommitCallback),
|
|
82
82
|
uiManager);
|
|
83
|
-
#endif
|
|
84
83
|
|
|
85
84
|
nativeAnimatedNodesManager_ =
|
|
86
85
|
std::make_shared<NativeAnimatedNodesManager>(animationBackend_);
|
|
87
86
|
|
|
87
|
+
nativeAnimatedDelegate_ =
|
|
88
|
+
std::make_shared<UIManagerNativeAnimatedDelegateBackendImpl>(
|
|
89
|
+
animationBackend_);
|
|
90
|
+
|
|
88
91
|
uiManager->unstable_setAnimationBackend(animationBackend_);
|
|
92
|
+
#endif
|
|
89
93
|
} else {
|
|
90
94
|
nativeAnimatedNodesManager_ =
|
|
91
95
|
std::make_shared<NativeAnimatedNodesManager>(
|
|
@@ -93,6 +97,10 @@ NativeAnimatedNodesManagerProvider::getOrCreate(
|
|
|
93
97
|
std::move(fabricCommitCallback),
|
|
94
98
|
std::move(startOnRenderCallback_),
|
|
95
99
|
std::move(stopOnRenderCallback_));
|
|
100
|
+
|
|
101
|
+
nativeAnimatedDelegate_ =
|
|
102
|
+
std::make_shared<UIManagerNativeAnimatedDelegateImpl>(
|
|
103
|
+
nativeAnimatedNodesManager_);
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
addEventEmitterListener(
|
|
@@ -117,10 +125,6 @@ NativeAnimatedNodesManagerProvider::getOrCreate(
|
|
|
117
125
|
return false;
|
|
118
126
|
}));
|
|
119
127
|
|
|
120
|
-
nativeAnimatedDelegate_ =
|
|
121
|
-
std::make_shared<UIManagerNativeAnimatedDelegateImpl>(
|
|
122
|
-
nativeAnimatedNodesManager_);
|
|
123
|
-
|
|
124
128
|
uiManager->setNativeAnimatedDelegate(nativeAnimatedDelegate_);
|
|
125
129
|
|
|
126
130
|
// TODO: remove force casting.
|
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
namespace facebook::react {
|
|
12
12
|
|
|
13
|
+
UIManagerNativeAnimatedDelegateBackendImpl::
|
|
14
|
+
UIManagerNativeAnimatedDelegateBackendImpl(
|
|
15
|
+
std::weak_ptr<UIManagerAnimationBackend> animationBackend)
|
|
16
|
+
: animationBackend_(std::move(animationBackend)) {}
|
|
17
|
+
|
|
18
|
+
void UIManagerNativeAnimatedDelegateBackendImpl::runAnimationFrame() {
|
|
19
|
+
if (auto animationBackendStrong = animationBackend_.lock()) {
|
|
20
|
+
animationBackendStrong->onAnimationFrame(
|
|
21
|
+
std::chrono::steady_clock::now().time_since_epoch().count() / 1000);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
static inline Props::Shared cloneProps(
|
|
14
26
|
AnimatedProps& animatedProps,
|
|
15
27
|
const ShadowNode& shadowNode) {
|
|
@@ -87,19 +99,23 @@ AnimationBackend::AnimationBackend(
|
|
|
87
99
|
|
|
88
100
|
void AnimationBackend::onAnimationFrame(double timestamp) {
|
|
89
101
|
std::unordered_map<Tag, AnimatedProps> updates;
|
|
90
|
-
std::unordered_set<const ShadowNodeFamily
|
|
102
|
+
std::unordered_map<SurfaceId, std::unordered_set<const ShadowNodeFamily*>>
|
|
103
|
+
surfaceToFamilies;
|
|
91
104
|
bool hasAnyLayoutUpdates = false;
|
|
92
105
|
for (auto& callback : callbacks) {
|
|
93
106
|
auto muatations = callback(static_cast<float>(timestamp));
|
|
94
107
|
for (auto& mutation : muatations) {
|
|
95
108
|
hasAnyLayoutUpdates |= mutationHasLayoutUpdates(mutation);
|
|
96
|
-
|
|
109
|
+
const auto family = mutation.family;
|
|
110
|
+
if (family != nullptr) {
|
|
111
|
+
surfaceToFamilies[family->getSurfaceId()].insert(family);
|
|
112
|
+
}
|
|
97
113
|
updates[mutation.tag] = std::move(mutation.props);
|
|
98
114
|
}
|
|
99
115
|
}
|
|
100
116
|
|
|
101
117
|
if (hasAnyLayoutUpdates) {
|
|
102
|
-
|
|
118
|
+
commitUpdates(surfaceToFamilies, updates);
|
|
103
119
|
} else {
|
|
104
120
|
synchronouslyUpdateProps(updates);
|
|
105
121
|
}
|
|
@@ -108,41 +124,60 @@ void AnimationBackend::onAnimationFrame(double timestamp) {
|
|
|
108
124
|
void AnimationBackend::start(const Callback& callback, bool isAsync) {
|
|
109
125
|
callbacks.push_back(callback);
|
|
110
126
|
// TODO: startOnRenderCallback_ should provide the timestamp from the platform
|
|
111
|
-
startOnRenderCallback_
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
127
|
+
if (startOnRenderCallback_) {
|
|
128
|
+
startOnRenderCallback_(
|
|
129
|
+
[this]() {
|
|
130
|
+
onAnimationFrame(
|
|
131
|
+
std::chrono::steady_clock::now().time_since_epoch().count() /
|
|
132
|
+
1000);
|
|
133
|
+
},
|
|
134
|
+
isAsync);
|
|
135
|
+
}
|
|
117
136
|
}
|
|
118
137
|
void AnimationBackend::stop(bool isAsync) {
|
|
119
|
-
stopOnRenderCallback_
|
|
138
|
+
if (stopOnRenderCallback_) {
|
|
139
|
+
stopOnRenderCallback_(isAsync);
|
|
140
|
+
}
|
|
120
141
|
callbacks.clear();
|
|
121
142
|
}
|
|
122
143
|
|
|
123
|
-
void AnimationBackend::
|
|
124
|
-
const std::
|
|
144
|
+
void AnimationBackend::commitUpdates(
|
|
145
|
+
const std::unordered_map<
|
|
146
|
+
SurfaceId,
|
|
147
|
+
std::unordered_set<const ShadowNodeFamily*>>& surfaceToFamilies,
|
|
125
148
|
std::unordered_map<Tag, AnimatedProps>& updates) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
for (const auto& surfaceEntry : surfaceToFamilies) {
|
|
150
|
+
const auto& surfaceId = surfaceEntry.first;
|
|
151
|
+
const auto& surfaceFamilies = surfaceEntry.second;
|
|
152
|
+
uiManager_->getShadowTreeRegistry().visit(
|
|
153
|
+
surfaceId, [&surfaceFamilies, &updates](const ShadowTree& shadowTree) {
|
|
154
|
+
shadowTree.commit(
|
|
155
|
+
[&surfaceFamilies,
|
|
156
|
+
&updates](const RootShadowNode& oldRootShadowNode) {
|
|
157
|
+
return std::static_pointer_cast<RootShadowNode>(
|
|
158
|
+
oldRootShadowNode.cloneMultiple(
|
|
159
|
+
surfaceFamilies,
|
|
160
|
+
[&surfaceFamilies, &updates](
|
|
161
|
+
const ShadowNode& shadowNode,
|
|
162
|
+
const ShadowNodeFragment& fragment) {
|
|
163
|
+
auto newProps =
|
|
164
|
+
ShadowNodeFragment::propsPlaceholder();
|
|
165
|
+
if (surfaceFamilies.contains(
|
|
166
|
+
&shadowNode.getFamily())) {
|
|
167
|
+
auto& animatedProps =
|
|
168
|
+
updates.at(shadowNode.getTag());
|
|
169
|
+
newProps = cloneProps(animatedProps, shadowNode);
|
|
170
|
+
}
|
|
171
|
+
return shadowNode.clone(
|
|
172
|
+
{.props = newProps,
|
|
173
|
+
.children = fragment.children,
|
|
174
|
+
.state = shadowNode.getState(),
|
|
175
|
+
.runtimeShadowNodeReference = false});
|
|
176
|
+
}));
|
|
177
|
+
},
|
|
178
|
+
{.mountSynchronously = true});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
146
181
|
}
|
|
147
182
|
|
|
148
183
|
void AnimationBackend::synchronouslyUpdateProps(
|
|
@@ -18,6 +18,18 @@
|
|
|
18
18
|
|
|
19
19
|
namespace facebook::react {
|
|
20
20
|
|
|
21
|
+
class AnimationBackend;
|
|
22
|
+
|
|
23
|
+
class UIManagerNativeAnimatedDelegateBackendImpl : public UIManagerNativeAnimatedDelegate {
|
|
24
|
+
public:
|
|
25
|
+
explicit UIManagerNativeAnimatedDelegateBackendImpl(std::weak_ptr<UIManagerAnimationBackend> animationBackend);
|
|
26
|
+
|
|
27
|
+
void runAnimationFrame() override;
|
|
28
|
+
|
|
29
|
+
private:
|
|
30
|
+
std::weak_ptr<UIManagerAnimationBackend> animationBackend_;
|
|
31
|
+
};
|
|
32
|
+
|
|
21
33
|
struct AnimationMutation {
|
|
22
34
|
Tag tag;
|
|
23
35
|
const ShadowNodeFamily *family;
|
|
@@ -47,8 +59,8 @@ class AnimationBackend : public UIManagerAnimationBackend {
|
|
|
47
59
|
DirectManipulationCallback &&directManipulationCallback,
|
|
48
60
|
FabricCommitCallback &&fabricCommitCallback,
|
|
49
61
|
UIManager *uiManager);
|
|
50
|
-
void
|
|
51
|
-
const std::unordered_set<const ShadowNodeFamily
|
|
62
|
+
void commitUpdates(
|
|
63
|
+
const std::unordered_map<SurfaceId, std::unordered_set<const ShadowNodeFamily *>> &surfaceToFamilies,
|
|
52
64
|
std::unordered_map<Tag, AnimatedProps> &updates);
|
|
53
65
|
void synchronouslyUpdateProps(const std::unordered_map<Tag, AnimatedProps> &updates);
|
|
54
66
|
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#include
|
|
8
|
+
#include "EventQueueProcessor.h"
|
|
9
|
+
|
|
9
10
|
#include <logger/react_native_log.h>
|
|
10
11
|
#include <react/featureflags/ReactNativeFeatureFlags.h>
|
|
12
|
+
|
|
11
13
|
#include "EventEmitter.h"
|
|
12
14
|
#include "EventLogger.h"
|
|
13
|
-
#include "EventQueue.h"
|
|
14
|
-
#include "ShadowNodeFamily.h"
|
|
15
15
|
|
|
16
16
|
namespace facebook::react {
|
|
17
17
|
|
|
@@ -23,26 +23,6 @@ SurfaceHandler::SurfaceHandler(
|
|
|
23
23
|
parameters_.surfaceId = surfaceId;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
SurfaceHandler::SurfaceHandler(SurfaceHandler&& other) noexcept {
|
|
27
|
-
operator=(std::move(other));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
SurfaceHandler& SurfaceHandler::operator=(SurfaceHandler&& other) noexcept {
|
|
31
|
-
std::unique_lock lock1(linkMutex_, std::defer_lock);
|
|
32
|
-
std::unique_lock lock2(parametersMutex_, std::defer_lock);
|
|
33
|
-
std::unique_lock lock3(other.linkMutex_, std::defer_lock);
|
|
34
|
-
std::unique_lock lock4(other.parametersMutex_, std::defer_lock);
|
|
35
|
-
std::lock(lock1, lock2, lock3, lock4);
|
|
36
|
-
|
|
37
|
-
link_ = other.link_;
|
|
38
|
-
parameters_ = other.parameters_;
|
|
39
|
-
|
|
40
|
-
other.link_ = Link{};
|
|
41
|
-
other.parameters_ = Parameters{};
|
|
42
|
-
other.parameters_.contextContainer = parameters_.contextContainer;
|
|
43
|
-
return *this;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
26
|
#pragma mark - Surface Life-Cycle Management
|
|
47
27
|
|
|
48
28
|
void SurfaceHandler::setContextContainer(
|
|
@@ -67,11 +67,11 @@ class SurfaceHandler {
|
|
|
67
67
|
virtual ~SurfaceHandler() noexcept;
|
|
68
68
|
|
|
69
69
|
/*
|
|
70
|
-
*
|
|
70
|
+
* Not moveable or copyable
|
|
71
71
|
*/
|
|
72
|
-
SurfaceHandler(SurfaceHandler &&other) noexcept;
|
|
72
|
+
SurfaceHandler(SurfaceHandler &&other) noexcept = delete;
|
|
73
73
|
SurfaceHandler(const SurfaceHandler &SurfaceHandler) noexcept = delete;
|
|
74
|
-
SurfaceHandler &operator=(SurfaceHandler &&other) noexcept;
|
|
74
|
+
SurfaceHandler &operator=(SurfaceHandler &&other) noexcept = delete;
|
|
75
75
|
SurfaceHandler &operator=(const SurfaceHandler &other) noexcept = delete;
|
|
76
76
|
|
|
77
77
|
#pragma mark - Surface Life-Cycle Management
|
|
@@ -29,9 +29,8 @@ void SurfaceManager::startSurface(
|
|
|
29
29
|
const LayoutContext& layoutContext) noexcept {
|
|
30
30
|
{
|
|
31
31
|
std::unique_lock lock(mutex_);
|
|
32
|
-
auto
|
|
33
|
-
|
|
34
|
-
registry_.emplace(surfaceId, std::move(surfaceHandler));
|
|
32
|
+
auto [it, _] = registry_.try_emplace(surfaceId, moduleName, surfaceId);
|
|
33
|
+
it->second.setContextContainer(scheduler_.getContextContainer());
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
#include <jsi/hermes.h>
|
|
19
19
|
#include <jsi/instrumentation.h>
|
|
20
20
|
#include <jsinspector-modern/HostTarget.h>
|
|
21
|
-
#include <jsireact/JSIExecutor.h>
|
|
22
21
|
#include <react/featureflags/ReactNativeFeatureFlags.h>
|
|
23
22
|
#include <react/renderer/core/ShadowNode.h>
|
|
24
23
|
#include <react/renderer/runtimescheduler/RuntimeSchedulerBinding.h>
|
|
24
|
+
#include <react/runtime/JSRuntimeBindings.h>
|
|
25
25
|
#include <react/timing/primitives.h>
|
|
26
26
|
#include <react/utils/jsi-utils.h>
|
|
27
27
|
#include <iostream>
|
|
@@ -48,6 +48,12 @@ std::shared_ptr<RuntimeScheduler> createRuntimeScheduler(
|
|
|
48
48
|
return scheduler;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
std::string getSyntheticBundlePath(uint32_t bundleId) {
|
|
52
|
+
std::array<char, 32> buffer{};
|
|
53
|
+
std::snprintf(buffer.data(), buffer.size(), "seg-%u.js", bundleId);
|
|
54
|
+
return buffer.data();
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
} // namespace
|
|
52
58
|
|
|
53
59
|
ReactInstance::ReactInstance(
|
|
@@ -365,12 +371,8 @@ void ReactInstance::registerSegment(
|
|
|
365
371
|
}
|
|
366
372
|
LOG(WARNING) << "Starting to evaluate segment " << segmentId
|
|
367
373
|
<< " in ReactInstance::registerSegment";
|
|
368
|
-
#pragma clang diagnostic push
|
|
369
|
-
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
370
374
|
runtime.evaluateJavaScript(
|
|
371
|
-
std::move(script),
|
|
372
|
-
JSExecutor::getSyntheticBundlePath(segmentId, segmentPath));
|
|
373
|
-
#pragma clang diagnostic pop
|
|
375
|
+
std::move(script), getSyntheticBundlePath(segmentId));
|
|
374
376
|
LOG(WARNING) << "Finished evaluating segment " << segmentId
|
|
375
377
|
<< " in ReactInstance::registerSegment";
|
|
376
378
|
if (hasLogger) {
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
#include <jserrorhandler/JsErrorHandler.h>
|
|
14
14
|
#include <jsi/jsi.h>
|
|
15
15
|
#include <jsinspector-modern/ReactCdp.h>
|
|
16
|
-
#include <jsireact/JSIExecutor.h>
|
|
17
16
|
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
|
18
17
|
#include <react/runtime/BufferedRuntimeExecutor.h>
|
|
19
18
|
#include <react/runtime/JSRuntimeFactory.h>
|
package/flow/bom.js.flow
CHANGED
|
@@ -25,6 +25,10 @@ type DevToolsColor =
|
|
|
25
25
|
| 'warning'
|
|
26
26
|
| 'error';
|
|
27
27
|
|
|
28
|
+
declare interface ConsoleTask {
|
|
29
|
+
run<T>(f: () => T): T;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
// $FlowExpectedError[libdef-override] Flow core definitions are incomplete.
|
|
29
33
|
declare var console: {
|
|
30
34
|
// Logging
|
|
@@ -75,6 +79,9 @@ declare var console: {
|
|
|
75
79
|
detail?: {[string]: mixed},
|
|
76
80
|
): void,
|
|
77
81
|
|
|
82
|
+
// Stack tagging
|
|
83
|
+
createTask(label: string): ConsoleTask,
|
|
84
|
+
|
|
78
85
|
...
|
|
79
86
|
};
|
|
80
87
|
|