react-native 0.84.0-nightly-20251106-de5141a3d → 0.84.0-nightly-20251108-7486a2bc5
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/Blob/RCTBlobManager.mm +1 -4
- package/Libraries/Blob/RCTBlobPlugins.mm +14 -14
- package/Libraries/Blob/RCTFileReaderModule.mm +1 -4
- package/Libraries/Components/Button.js +0 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTBundleAssetImageLoader.mm +1 -4
- package/Libraries/Image/RCTGIFImageDecoder.mm +1 -4
- package/Libraries/Image/RCTImageEditingManager.mm +1 -4
- package/Libraries/Image/RCTImageLoader.mm +1 -4
- package/Libraries/Image/RCTImagePlugins.h +1 -0
- package/Libraries/Image/RCTImagePlugins.mm +30 -17
- package/Libraries/Image/RCTImageStoreManager.mm +1 -4
- package/Libraries/Image/RCTImageViewManager.mm +1 -4
- package/Libraries/Image/RCTLocalAssetImageLoader.mm +1 -4
- package/Libraries/LinkingIOS/RCTLinkingManager.mm +1 -4
- package/Libraries/LinkingIOS/RCTLinkingPlugins.mm +10 -13
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/NativeAnimation/RCTAnimationPlugins.mm +14 -14
- package/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +1 -4
- package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +1 -4
- package/Libraries/Network/RCTDataRequestHandler.mm +1 -4
- package/Libraries/Network/RCTFileRequestHandler.mm +1 -4
- package/Libraries/Network/RCTHTTPRequestHandler.mm +1 -4
- package/Libraries/Network/RCTNetworkPlugins.mm +22 -16
- package/Libraries/Network/RCTNetworking.mm +1 -4
- package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +1 -4
- package/Libraries/PushNotificationIOS/RCTPushNotificationPlugins.mm +10 -13
- package/Libraries/Settings/RCTSettingsManager.mm +1 -4
- package/Libraries/Settings/RCTSettingsPlugins.mm +10 -13
- 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/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +1 -4
- package/Libraries/Text/RawText/RCTRawTextViewManager.mm +1 -4
- package/Libraries/Text/Text/RCTTextViewManager.mm +1 -4
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +1 -4
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +1 -4
- package/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +1 -4
- package/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +1 -4
- package/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +1 -4
- package/Libraries/Vibration/RCTVibration.mm +1 -4
- package/Libraries/Vibration/RCTVibrationPlugins.mm +10 -13
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/CoreModulesPlugins.mm +98 -35
- package/React/CoreModules/RCTAccessibilityManager.mm +1 -4
- package/React/CoreModules/RCTActionSheetManager.mm +1 -4
- package/React/CoreModules/RCTAlertManager.mm +1 -4
- package/React/CoreModules/RCTAppState.mm +1 -4
- package/React/CoreModules/RCTAppearance.mm +1 -4
- package/React/CoreModules/RCTClipboard.mm +1 -4
- package/React/CoreModules/RCTDevLoadingView.mm +1 -4
- package/React/CoreModules/RCTDevMenu.mm +1 -4
- package/React/CoreModules/RCTDevSettings.mm +1 -4
- package/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm +1 -5
- package/React/CoreModules/RCTDeviceInfo.mm +1 -4
- package/React/CoreModules/RCTEventDispatcher.mm +1 -4
- package/React/CoreModules/RCTExceptionsManager.mm +1 -4
- package/React/CoreModules/RCTI18nManager.mm +1 -4
- package/React/CoreModules/RCTKeyboardObserver.mm +1 -4
- package/React/CoreModules/RCTLogBox.mm +1 -4
- package/React/CoreModules/RCTPerfMonitor.mm +1 -4
- package/React/CoreModules/RCTPlatform.mm +1 -4
- package/React/CoreModules/RCTRedBox.mm +1 -4
- package/React/CoreModules/RCTSourceCode.mm +1 -4
- package/React/CoreModules/RCTStatusBarManager.mm +1 -4
- package/React/CoreModules/RCTTiming.mm +1 -4
- package/React/CoreModules/RCTWebSocketModule.mm +1 -4
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +16 -0
- package/React/Modules/RCTUIManager.mm +1 -4
- package/React/Views/RCTActivityIndicatorViewManager.m +1 -4
- package/React/Views/RCTDebuggingOverlayManager.m +1 -4
- package/React/Views/RCTModalHostViewManager.m +1 -4
- package/React/Views/RCTModalManager.m +1 -4
- package/React/Views/RCTSwitchManager.m +1 -4
- package/React/Views/RCTViewManager.m +1 -4
- package/React/Views/RefreshControl/RCTRefreshControlManager.m +1 -4
- package/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +1 -4
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +1 -4
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -4
- 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/fabric/FabricUIManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/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/BaseViewManager.java +4 -5
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +7 -0
- package/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +12 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
- package/ReactAndroid/src/main/jni/react/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/JReactHostInspectorTarget.cpp +8 -1
- 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/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +1 -0
- package/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm +29 -4
- 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 +2 -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/HostTarget.h +8 -2
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.cpp +6 -2
- package/ReactCommon/jsinspector-modern/HostTargetTraceRecording.h +15 -5
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +9 -5
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +3 -2
- 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/TracingAgent.cpp +19 -2
- package/ReactCommon/jsinspector-modern/tests/ConsoleCreateTaskTest.cpp +131 -0
- package/ReactCommon/jsinspector-modern/tests/ReactInstanceIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +59 -0
- package/ReactCommon/jsinspector-modern/tests/TracingTest.h +20 -7
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.cpp +32 -20
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h +6 -2
- package/ReactCommon/jsinspector-modern/tracing/TargetTracingAgent.h +5 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEvent.h +2 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +2 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceRecordingState.h +3 -0
- package/ReactCommon/jsinspector-modern/tracing/TracingCategory.h +126 -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 +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +113 -77
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +0 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
- package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +1 -4
- 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 +24 -19
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManagerProvider.cpp +11 -6
- 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/runtime/ReactInstance.cpp +8 -6
- package/ReactCommon/react/runtime/ReactInstance.h +0 -1
- package/ReactCommon/react/runtime/TimerManager.cpp +0 -54
- package/ReactCommon/react/runtime/TimerManager.h +0 -12
- package/flow/bom.js.flow +7 -0
- package/package.json +8 -8
- package/scripts/ios-configure-glog.sh +6 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +11 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
- 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<<95ebd4929bf0f98aa059ad4b8139f7b3>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -75,6 +75,12 @@ class ReactNativeFeatureFlagsJavaProvider
|
|
|
75
75
|
return method(javaProvider_);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
bool disableImageViewPreallocationAndroid() override {
|
|
79
|
+
static const auto method =
|
|
80
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("disableImageViewPreallocationAndroid");
|
|
81
|
+
return method(javaProvider_);
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
bool disableMountItemReorderingAndroid() override {
|
|
79
85
|
static const auto method =
|
|
80
86
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("disableMountItemReorderingAndroid");
|
|
@@ -99,6 +105,12 @@ class ReactNativeFeatureFlagsJavaProvider
|
|
|
99
105
|
return method(javaProvider_);
|
|
100
106
|
}
|
|
101
107
|
|
|
108
|
+
bool disableViewPreallocationAndroid() override {
|
|
109
|
+
static const auto method =
|
|
110
|
+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("disableViewPreallocationAndroid");
|
|
111
|
+
return method(javaProvider_);
|
|
112
|
+
}
|
|
113
|
+
|
|
102
114
|
bool enableAccessibilityOrder() override {
|
|
103
115
|
static const auto method =
|
|
104
116
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableAccessibilityOrder");
|
|
@@ -565,6 +577,11 @@ bool JReactNativeFeatureFlagsCxxInterop::disableFabricCommitInCXXAnimated(
|
|
|
565
577
|
return ReactNativeFeatureFlags::disableFabricCommitInCXXAnimated();
|
|
566
578
|
}
|
|
567
579
|
|
|
580
|
+
bool JReactNativeFeatureFlagsCxxInterop::disableImageViewPreallocationAndroid(
|
|
581
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
582
|
+
return ReactNativeFeatureFlags::disableImageViewPreallocationAndroid();
|
|
583
|
+
}
|
|
584
|
+
|
|
568
585
|
bool JReactNativeFeatureFlagsCxxInterop::disableMountItemReorderingAndroid(
|
|
569
586
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
570
587
|
return ReactNativeFeatureFlags::disableMountItemReorderingAndroid();
|
|
@@ -585,6 +602,11 @@ bool JReactNativeFeatureFlagsCxxInterop::disableTextLayoutManagerCacheAndroid(
|
|
|
585
602
|
return ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid();
|
|
586
603
|
}
|
|
587
604
|
|
|
605
|
+
bool JReactNativeFeatureFlagsCxxInterop::disableViewPreallocationAndroid(
|
|
606
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
607
|
+
return ReactNativeFeatureFlags::disableViewPreallocationAndroid();
|
|
608
|
+
}
|
|
609
|
+
|
|
588
610
|
bool JReactNativeFeatureFlagsCxxInterop::enableAccessibilityOrder(
|
|
589
611
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
590
612
|
return ReactNativeFeatureFlags::enableAccessibilityOrder();
|
|
@@ -994,6 +1016,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
994
1016
|
makeNativeMethod(
|
|
995
1017
|
"disableFabricCommitInCXXAnimated",
|
|
996
1018
|
JReactNativeFeatureFlagsCxxInterop::disableFabricCommitInCXXAnimated),
|
|
1019
|
+
makeNativeMethod(
|
|
1020
|
+
"disableImageViewPreallocationAndroid",
|
|
1021
|
+
JReactNativeFeatureFlagsCxxInterop::disableImageViewPreallocationAndroid),
|
|
997
1022
|
makeNativeMethod(
|
|
998
1023
|
"disableMountItemReorderingAndroid",
|
|
999
1024
|
JReactNativeFeatureFlagsCxxInterop::disableMountItemReorderingAndroid),
|
|
@@ -1006,6 +1031,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
1006
1031
|
makeNativeMethod(
|
|
1007
1032
|
"disableTextLayoutManagerCacheAndroid",
|
|
1008
1033
|
JReactNativeFeatureFlagsCxxInterop::disableTextLayoutManagerCacheAndroid),
|
|
1034
|
+
makeNativeMethod(
|
|
1035
|
+
"disableViewPreallocationAndroid",
|
|
1036
|
+
JReactNativeFeatureFlagsCxxInterop::disableViewPreallocationAndroid),
|
|
1009
1037
|
makeNativeMethod(
|
|
1010
1038
|
"enableAccessibilityOrder",
|
|
1011
1039
|
JReactNativeFeatureFlagsCxxInterop::enableAccessibilityOrder),
|
|
@@ -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<<155f615584a7738dc5b89205c2ecad8b>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -48,6 +48,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
48
48
|
static bool disableFabricCommitInCXXAnimated(
|
|
49
49
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
50
50
|
|
|
51
|
+
static bool disableImageViewPreallocationAndroid(
|
|
52
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
53
|
+
|
|
51
54
|
static bool disableMountItemReorderingAndroid(
|
|
52
55
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
53
56
|
|
|
@@ -60,6 +63,9 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
60
63
|
static bool disableTextLayoutManagerCacheAndroid(
|
|
61
64
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
62
65
|
|
|
66
|
+
static bool disableViewPreallocationAndroid(
|
|
67
|
+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
68
|
+
|
|
63
69
|
static bool enableAccessibilityOrder(
|
|
64
70
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
65
71
|
|
|
@@ -164,8 +164,6 @@ void CatalystInstanceImpl::initializeBridge(
|
|
|
164
164
|
jni::alias_ref<JavaMessageQueueThread::javaobject> nativeModulesQueue,
|
|
165
165
|
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject>
|
|
166
166
|
javaModules,
|
|
167
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject>
|
|
168
|
-
cxxModules,
|
|
169
167
|
jni::alias_ref<ReactInstanceManagerInspectorTarget::javaobject>
|
|
170
168
|
inspectorTarget) {
|
|
171
169
|
set_react_native_logfunc(&log);
|
|
@@ -194,10 +192,7 @@ void CatalystInstanceImpl::initializeBridge(
|
|
|
194
192
|
// stack.
|
|
195
193
|
|
|
196
194
|
moduleRegistry_ = std::make_shared<ModuleRegistry>(buildNativeModuleList(
|
|
197
|
-
std::weak_ptr<Instance>(instance_),
|
|
198
|
-
javaModules,
|
|
199
|
-
cxxModules,
|
|
200
|
-
moduleMessageQueue_));
|
|
195
|
+
std::weak_ptr<Instance>(instance_), javaModules, moduleMessageQueue_));
|
|
201
196
|
|
|
202
197
|
instance_->initializeBridge(
|
|
203
198
|
std::make_unique<InstanceCallbackImpl>(callback),
|
|
@@ -211,14 +206,9 @@ void CatalystInstanceImpl::initializeBridge(
|
|
|
211
206
|
|
|
212
207
|
void CatalystInstanceImpl::extendNativeModules(
|
|
213
208
|
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject>
|
|
214
|
-
javaModules
|
|
215
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject>
|
|
216
|
-
cxxModules) {
|
|
209
|
+
javaModules) {
|
|
217
210
|
moduleRegistry_->registerModules(buildNativeModuleList(
|
|
218
|
-
std::weak_ptr<Instance>(instance_),
|
|
219
|
-
javaModules,
|
|
220
|
-
cxxModules,
|
|
221
|
-
moduleMessageQueue_));
|
|
211
|
+
std::weak_ptr<Instance>(instance_), javaModules, moduleMessageQueue_));
|
|
222
212
|
}
|
|
223
213
|
|
|
224
214
|
void CatalystInstanceImpl::jniSetSourceURL(const std::string& sourceURL) {
|
|
@@ -60,12 +60,9 @@ class [[deprecated("This API will be removed along with the legacy architecture.
|
|
|
60
60
|
jni::alias_ref<JavaMessageQueueThread::javaobject> jsQueue,
|
|
61
61
|
jni::alias_ref<JavaMessageQueueThread::javaobject> nativeModulesQueue,
|
|
62
62
|
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,
|
|
63
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules,
|
|
64
63
|
jni::alias_ref<ReactInstanceManagerInspectorTarget::javaobject> inspectorTarget);
|
|
65
64
|
|
|
66
|
-
void extendNativeModules(
|
|
67
|
-
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,
|
|
68
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules);
|
|
65
|
+
void extendNativeModules(jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules);
|
|
69
66
|
|
|
70
67
|
/**
|
|
71
68
|
* Sets the source URL of the underlying bridge without loading any JS code.
|
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <memory>
|
|
11
|
-
#include <string>
|
|
12
|
-
|
|
13
|
-
#include <cxxreact/CxxModule.h>
|
|
14
10
|
#include <fbjni/fbjni.h>
|
|
15
11
|
|
|
16
12
|
namespace facebook::react {
|
|
@@ -19,24 +15,4 @@ struct JNativeModule : jni::JavaClass<JNativeModule> {
|
|
|
19
15
|
constexpr static const char *const kJavaDescriptor = "Lcom/facebook/react/bridge/NativeModule;";
|
|
20
16
|
};
|
|
21
17
|
|
|
22
|
-
/**
|
|
23
|
-
* The C++ part of a CxxModuleWrapper is not a unique class, but it
|
|
24
|
-
* must extend this base class.
|
|
25
|
-
*/
|
|
26
|
-
class CxxModuleWrapperBase : public jni::HybridClass<CxxModuleWrapperBase, JNativeModule> {
|
|
27
|
-
public:
|
|
28
|
-
constexpr static const char *const kJavaDescriptor = "Lcom/facebook/react/bridge/CxxModuleWrapperBase;";
|
|
29
|
-
|
|
30
|
-
static void registerNatives()
|
|
31
|
-
{
|
|
32
|
-
registerHybrid({makeNativeMethod("getName", CxxModuleWrapperBase::getName)});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// JNI method
|
|
36
|
-
virtual std::string getName() = 0;
|
|
37
|
-
|
|
38
|
-
// Called by ModuleRegistryBuilder
|
|
39
|
-
virtual std::unique_ptr<xplat::module::CxxModule> getModule() = 0;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
18
|
} // namespace facebook::react
|
|
@@ -24,30 +24,13 @@ std::string ModuleHolder::getName() const {
|
|
|
24
24
|
|
|
25
25
|
xplat::module::CxxModule::Provider ModuleHolder::getProvider(
|
|
26
26
|
const std::string& moduleName) const {
|
|
27
|
-
return [self = jni::make_global(self()), moduleName] {
|
|
28
|
-
static auto getModule =
|
|
29
|
-
ModuleHolder::javaClassStatic()->getMethod<JNativeModule::javaobject()>(
|
|
30
|
-
"getModule");
|
|
31
|
-
// This is the call which uses the lazy Java Provider to instantiate the
|
|
32
|
-
// Java CxxModuleWrapper which contains the CxxModule.
|
|
33
|
-
auto module = getModule(self);
|
|
34
|
-
|
|
35
|
-
CHECK(module->isInstanceOf(CxxModuleWrapperBase::javaClassStatic()))
|
|
36
|
-
<< "NativeModule '" << moduleName << "' isn't a C++ module";
|
|
37
|
-
|
|
38
|
-
auto cxxModule =
|
|
39
|
-
jni::static_ref_cast<CxxModuleWrapperBase::javaobject>(module);
|
|
40
|
-
// Then, we grab the CxxModule from the wrapper, which is no longer needed.
|
|
41
|
-
return cxxModule->cthis()->getModule();
|
|
42
|
-
};
|
|
27
|
+
return [self = jni::make_global(self()), moduleName] { return nullptr; };
|
|
43
28
|
}
|
|
44
29
|
|
|
45
30
|
std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
|
|
46
31
|
std::weak_ptr<Instance> winstance,
|
|
47
32
|
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject>
|
|
48
33
|
javaModules,
|
|
49
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject>
|
|
50
|
-
cxxModules,
|
|
51
34
|
std::shared_ptr<MessageQueueThread> moduleMessageQueue) {
|
|
52
35
|
std::vector<std::unique_ptr<NativeModule>> modules;
|
|
53
36
|
if (javaModules) {
|
|
@@ -57,17 +40,6 @@ std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
|
|
|
57
40
|
winstance, jm, moduleMessageQueue));
|
|
58
41
|
}
|
|
59
42
|
}
|
|
60
|
-
if (cxxModules) {
|
|
61
|
-
for (const auto& cm : *cxxModules) {
|
|
62
|
-
std::string moduleName = cm->getName();
|
|
63
|
-
modules.emplace_back(
|
|
64
|
-
std::make_unique<CxxNativeModule>(
|
|
65
|
-
winstance,
|
|
66
|
-
moduleName,
|
|
67
|
-
cm->getProvider(moduleName),
|
|
68
|
-
moduleMessageQueue));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
43
|
return modules;
|
|
72
44
|
}
|
|
73
45
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#include <cxxreact/ModuleRegistry.h>
|
|
12
12
|
#include <fbjni/fbjni.h>
|
|
13
13
|
|
|
14
|
-
#include "
|
|
14
|
+
#include "CxxModuleWrapperBase.h"
|
|
15
15
|
#include "JavaModuleWrapper.h"
|
|
16
16
|
|
|
17
17
|
#ifndef RCT_REMOVE_LEGACY_ARCH
|
|
@@ -33,7 +33,6 @@ class [[deprecated("This API will be removed along with the legacy architecture.
|
|
|
33
33
|
std::vector<std::unique_ptr<NativeModule>> buildNativeModuleList(
|
|
34
34
|
std::weak_ptr<Instance> winstance,
|
|
35
35
|
jni::alias_ref<jni::JCollection<JavaModuleWrapper::javaobject>::javaobject> javaModules,
|
|
36
|
-
jni::alias_ref<jni::JCollection<ModuleHolder::javaobject>::javaobject> cxxModules,
|
|
37
36
|
std::shared_ptr<MessageQueueThread> moduleMessageQueue);
|
|
38
37
|
} // namespace facebook::react
|
|
39
38
|
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
#include <fbjni/fbjni.h>
|
|
12
12
|
|
|
13
13
|
#include "CatalystInstanceImpl.h"
|
|
14
|
-
#include "CxxModuleWrapperBase.h"
|
|
15
14
|
#include "InspectorNetworkRequestListener.h"
|
|
16
15
|
#include "JavaScriptExecutorHolder.h"
|
|
17
16
|
#include "ReactInstanceManagerInspectorTarget.h"
|
|
@@ -42,7 +41,6 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
|
|
42
41
|
CatalystInstanceImpl::registerNatives();
|
|
43
42
|
#pragma clang diagnostic pop
|
|
44
43
|
#endif
|
|
45
|
-
CxxModuleWrapperBase::registerNatives();
|
|
46
44
|
ReactInstanceManagerInspectorTarget::registerNatives();
|
|
47
45
|
InspectorNetworkRequestListener::registerNatives();
|
|
48
46
|
});
|
|
@@ -146,7 +146,14 @@ HostTarget* JReactHostInspectorTarget::getInspectorTarget() {
|
|
|
146
146
|
|
|
147
147
|
bool JReactHostInspectorTarget::startBackgroundTrace() {
|
|
148
148
|
if (inspectorTarget_) {
|
|
149
|
-
return inspectorTarget_->startTracing(
|
|
149
|
+
return inspectorTarget_->startTracing(
|
|
150
|
+
tracing::Mode::Background,
|
|
151
|
+
{
|
|
152
|
+
tracing::Category::HiddenTimeline,
|
|
153
|
+
tracing::Category::RuntimeExecution,
|
|
154
|
+
tracing::Category::Timeline,
|
|
155
|
+
tracing::Category::UserTiming,
|
|
156
|
+
});
|
|
150
157
|
} else {
|
|
151
158
|
jni::throwNewJavaException(
|
|
152
159
|
"java/lang/IllegalStateException",
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
#include <glog/logging.h>
|
|
14
14
|
#include <jni.h>
|
|
15
15
|
#include <jsi/jsi.h>
|
|
16
|
-
#include <jsireact/JSIExecutor.h>
|
|
17
16
|
#include <react/jni/JRuntimeExecutor.h>
|
|
18
17
|
#include <react/jni/JSLogging.h>
|
|
19
18
|
#include <react/renderer/runtimescheduler/RuntimeSchedulerCallInvoker.h>
|
|
20
19
|
#include <react/runtime/BridgelessNativeMethodCallInvoker.h>
|
|
20
|
+
#include <react/runtime/JSRuntimeBindings.h>
|
|
21
|
+
|
|
21
22
|
#include "JavaTimerRegistry.h"
|
|
22
23
|
|
|
23
24
|
namespace facebook::react {
|
|
@@ -17,10 +17,9 @@
|
|
|
17
17
|
#include <ReactCommon/BindingsInstallerHolder.h>
|
|
18
18
|
#include <ReactCommon/CxxTurboModuleUtils.h>
|
|
19
19
|
#include <ReactCommon/JavaInteropTurboModule.h>
|
|
20
|
-
#include <ReactCommon/TurboCxxModule.h>
|
|
21
20
|
#include <ReactCommon/TurboModuleBinding.h>
|
|
22
21
|
#include <ReactCommon/TurboModulePerfLogger.h>
|
|
23
|
-
#include <react/jni/
|
|
22
|
+
#include <react/jni/CxxModuleWrapperBase.h>
|
|
24
23
|
|
|
25
24
|
namespace facebook::react {
|
|
26
25
|
|
|
@@ -208,22 +207,6 @@ std::shared_ptr<TurboModule> TurboModuleManager::getTurboModule(
|
|
|
208
207
|
return turboModule;
|
|
209
208
|
}
|
|
210
209
|
|
|
211
|
-
static auto getTurboLegacyCxxModule =
|
|
212
|
-
javaPart->getClass()
|
|
213
|
-
->getMethod<jni::alias_ref<CxxModuleWrapper::javaobject>(
|
|
214
|
-
const std::string&)>("getTurboLegacyCxxModule");
|
|
215
|
-
auto legacyCxxModule = getTurboLegacyCxxModule(javaPart.get(), name);
|
|
216
|
-
if (legacyCxxModule) {
|
|
217
|
-
TurboModulePerfLogger::moduleJSRequireEndingStart(moduleName);
|
|
218
|
-
|
|
219
|
-
auto turboModule = std::make_shared<react::TurboCxxModule>(
|
|
220
|
-
legacyCxxModule->cthis()->getModule(), jsCallInvoker_);
|
|
221
|
-
turboModuleCache_.insert({name, turboModule});
|
|
222
|
-
|
|
223
|
-
TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName);
|
|
224
|
-
return turboModule;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
210
|
return nullptr;
|
|
228
211
|
}
|
|
229
212
|
|
|
@@ -260,23 +243,6 @@ std::shared_ptr<TurboModule> TurboModuleManager::getLegacyModule(
|
|
|
260
243
|
|
|
261
244
|
TurboModulePerfLogger::moduleJSRequireBeginningEnd(moduleName);
|
|
262
245
|
|
|
263
|
-
static auto getLegacyCxxModule =
|
|
264
|
-
javaPart->getClass()
|
|
265
|
-
->getMethod<jni::alias_ref<CxxModuleWrapper::javaobject>(
|
|
266
|
-
const std::string&)>("getLegacyCxxModule");
|
|
267
|
-
auto legacyCxxModule = getLegacyCxxModule(javaPart.get(), name);
|
|
268
|
-
|
|
269
|
-
if (legacyCxxModule) {
|
|
270
|
-
TurboModulePerfLogger::moduleJSRequireEndingStart(moduleName);
|
|
271
|
-
|
|
272
|
-
auto turboModule = std::make_shared<react::TurboCxxModule>(
|
|
273
|
-
legacyCxxModule->cthis()->getModule(), jsCallInvoker_);
|
|
274
|
-
legacyModuleCache_.insert({name, turboModule});
|
|
275
|
-
|
|
276
|
-
TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName);
|
|
277
|
-
return turboModule;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
246
|
static auto getLegacyJavaModule =
|
|
281
247
|
javaPart->getClass()
|
|
282
248
|
->getMethod<jni::alias_ref<JNativeModule>(const std::string&)>(
|
|
@@ -26,6 +26,26 @@
|
|
|
26
26
|
std::function<void()> _onRender;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
- (void)dealloc
|
|
30
|
+
{
|
|
31
|
+
if (_displayLink != nil) {
|
|
32
|
+
#if TARGET_OS_OSX
|
|
33
|
+
RCTPlatformDisplayLink *displayLink = _displayLink;
|
|
34
|
+
#else
|
|
35
|
+
CADisplayLink *displayLink = _displayLink;
|
|
36
|
+
#endif
|
|
37
|
+
_displayLink = nil;
|
|
38
|
+
if ([NSThread isMainThread]) {
|
|
39
|
+
[displayLink invalidate];
|
|
40
|
+
} else {
|
|
41
|
+
dispatch_sync(dispatch_get_main_queue(), ^{
|
|
42
|
+
[displayLink invalidate];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
_onRender = nullptr;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
- (void)_onDisplayLinkTick
|
|
30
50
|
{
|
|
31
51
|
if (_displayLink != nullptr && _onRender != nullptr) {
|
|
@@ -69,11 +89,16 @@
|
|
|
69
89
|
const auto stop_render = [weakSelf]() {
|
|
70
90
|
RCTAnimatedModuleProvider *strongSelf = weakSelf;
|
|
71
91
|
if (strongSelf) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
#if TARGET_OS_OSX
|
|
93
|
+
RCTPlatformDisplayLink *displayLink = strongSelf->_displayLink;
|
|
94
|
+
#else
|
|
95
|
+
CADisplayLink *displayLink = strongSelf->_displayLink;
|
|
96
|
+
#endif
|
|
97
|
+
strongSelf->_displayLink = nil;
|
|
98
|
+
if (displayLink != nil) {
|
|
99
|
+
[displayLink invalidate];
|
|
76
100
|
}
|
|
101
|
+
strongSelf->_onRender = nullptr;
|
|
77
102
|
}
|
|
78
103
|
};
|
|
79
104
|
|
|
@@ -22,7 +22,7 @@ constexpr struct {
|
|
|
22
22
|
int32_t Major = 0;
|
|
23
23
|
int32_t Minor = 84;
|
|
24
24
|
int32_t Patch = 0;
|
|
25
|
-
std::string_view Prerelease = "nightly-
|
|
25
|
+
std::string_view Prerelease = "nightly-20251108-7486a2bc5";
|
|
26
26
|
} ReactNativeVersion;
|
|
27
27
|
|
|
28
28
|
} // namespace facebook::react
|
|
@@ -30,7 +30,9 @@ Pod::Spec.new do |s|
|
|
|
30
30
|
s.header_dir = "jsireact"
|
|
31
31
|
|
|
32
32
|
s.dependency "React-cxxreact"
|
|
33
|
+
s.dependency "React-jserrorhandler"
|
|
33
34
|
s.dependency "React-jsi"
|
|
35
|
+
s.dependency "React-jsitooling"
|
|
34
36
|
s.dependency "React-perflogger"
|
|
35
37
|
add_dependency(s, "React-debug")
|
|
36
38
|
add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
|
|
@@ -576,44 +576,4 @@ void JSIExecutor::flush() {}
|
|
|
576
576
|
|
|
577
577
|
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
578
578
|
|
|
579
|
-
void bindNativeLogger(Runtime& runtime, Logger logger) {
|
|
580
|
-
runtime.global().setProperty(
|
|
581
|
-
runtime,
|
|
582
|
-
"nativeLoggingHook",
|
|
583
|
-
Function::createFromHostFunction(
|
|
584
|
-
runtime,
|
|
585
|
-
PropNameID::forAscii(runtime, "nativeLoggingHook"),
|
|
586
|
-
2,
|
|
587
|
-
[logger = std::move(logger)](
|
|
588
|
-
jsi::Runtime& runtime,
|
|
589
|
-
const jsi::Value&,
|
|
590
|
-
const jsi::Value* args,
|
|
591
|
-
size_t count) {
|
|
592
|
-
if (count != 2) {
|
|
593
|
-
throw std::invalid_argument(
|
|
594
|
-
"nativeLoggingHook takes 2 arguments");
|
|
595
|
-
}
|
|
596
|
-
logger(
|
|
597
|
-
args[0].asString(runtime).utf8(runtime),
|
|
598
|
-
static_cast<unsigned int>(args[1].asNumber()));
|
|
599
|
-
return Value::undefined();
|
|
600
|
-
}));
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
void bindNativePerformanceNow(Runtime& runtime) {
|
|
604
|
-
runtime.global().setProperty(
|
|
605
|
-
runtime,
|
|
606
|
-
"nativePerformanceNow",
|
|
607
|
-
Function::createFromHostFunction(
|
|
608
|
-
runtime,
|
|
609
|
-
PropNameID::forAscii(runtime, "nativePerformanceNow"),
|
|
610
|
-
0,
|
|
611
|
-
[](jsi::Runtime& runtime,
|
|
612
|
-
const jsi::Value&,
|
|
613
|
-
const jsi::Value* args,
|
|
614
|
-
size_t /*count*/) {
|
|
615
|
-
return HighResTimeStamp::now().toDOMHighResTimeStamp();
|
|
616
|
-
}));
|
|
617
|
-
}
|
|
618
|
-
|
|
619
579
|
} // namespace facebook::react
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include <cxxreact/RAMBundleRegistry.h>
|
|
13
13
|
#include <jsi/jsi.h>
|
|
14
14
|
#include <jsireact/JSINativeModules.h>
|
|
15
|
+
#include <react/runtime/JSRuntimeBindings.h>
|
|
15
16
|
#include <functional>
|
|
16
17
|
#include <mutex>
|
|
17
18
|
#include <optional>
|
|
@@ -127,10 +128,4 @@ class [[deprecated("This API will be removed along with the legacy architecture.
|
|
|
127
128
|
#endif // RCT_REMOVE_LEGACY_ARCH
|
|
128
129
|
};
|
|
129
130
|
|
|
130
|
-
using Logger = std::function<void(const std::string &message, unsigned int logLevel)>;
|
|
131
|
-
void bindNativeLogger(jsi::Runtime &runtime, Logger logger);
|
|
132
|
-
|
|
133
|
-
void bindNativePerformanceNow(jsi::Runtime &runtime);
|
|
134
|
-
|
|
135
|
-
double performanceNow();
|
|
136
131
|
} // namespace facebook::react
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "ConsoleTask.h"
|
|
9
|
+
#include "ConsoleTaskOrchestrator.h"
|
|
10
|
+
|
|
11
|
+
namespace facebook::react::jsinspector_modern {
|
|
12
|
+
|
|
13
|
+
ConsoleTask::ConsoleTask(std::shared_ptr<ConsoleTaskContext> taskContext)
|
|
14
|
+
: taskContext_(std::move(taskContext)),
|
|
15
|
+
orchestrator_(ConsoleTaskOrchestrator::getInstance()) {
|
|
16
|
+
if (taskContext_) {
|
|
17
|
+
orchestrator_.startTask(taskContext_->id());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ConsoleTask::~ConsoleTask() {
|
|
22
|
+
if (taskContext_) {
|
|
23
|
+
orchestrator_.finishTask(taskContext_->id());
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
} // namespace facebook::react::jsinspector_modern
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <memory>
|
|
11
|
+
|
|
12
|
+
namespace facebook::react::jsinspector_modern {
|
|
13
|
+
|
|
14
|
+
class ConsoleTaskContext;
|
|
15
|
+
class RuntimeTargetDelegate;
|
|
16
|
+
class ConsoleTaskOrchestrator;
|
|
17
|
+
|
|
18
|
+
class ConsoleTask {
|
|
19
|
+
public:
|
|
20
|
+
/**
|
|
21
|
+
* \param runtimeTargetDelegate The delegate to the corresponding runtime.
|
|
22
|
+
* \param taskContext The context that tracks the task.
|
|
23
|
+
*/
|
|
24
|
+
explicit ConsoleTask(std::shared_ptr<ConsoleTaskContext> taskContext);
|
|
25
|
+
~ConsoleTask();
|
|
26
|
+
|
|
27
|
+
ConsoleTask(const ConsoleTask &) = default;
|
|
28
|
+
ConsoleTask &operator=(const ConsoleTask &) = delete;
|
|
29
|
+
|
|
30
|
+
ConsoleTask(ConsoleTask &&) = default;
|
|
31
|
+
ConsoleTask &operator=(ConsoleTask &&) = delete;
|
|
32
|
+
|
|
33
|
+
private:
|
|
34
|
+
std::shared_ptr<ConsoleTaskContext> taskContext_;
|
|
35
|
+
ConsoleTaskOrchestrator &orchestrator_;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
} // namespace facebook::react::jsinspector_modern
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#include "ConsoleTaskContext.h"
|
|
9
|
+
#include "ConsoleTaskOrchestrator.h"
|
|
10
|
+
#include "RuntimeTarget.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react::jsinspector_modern {
|
|
13
|
+
|
|
14
|
+
ConsoleTaskContext::ConsoleTaskContext(
|
|
15
|
+
jsi::Runtime& runtime,
|
|
16
|
+
RuntimeTargetDelegate& runtimeTargetDelegate,
|
|
17
|
+
std::string name)
|
|
18
|
+
: runtimeTargetDelegate_(runtimeTargetDelegate),
|
|
19
|
+
name_(std::move(name)),
|
|
20
|
+
orchestrator_(ConsoleTaskOrchestrator::getInstance()) {
|
|
21
|
+
stackTrace_ = runtimeTargetDelegate_.captureStackTrace(runtime);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
ConsoleTaskContext::~ConsoleTaskContext() {
|
|
25
|
+
orchestrator_.cancelTask(id());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ConsoleTaskId ConsoleTaskContext::id() const {
|
|
29
|
+
return ConsoleTaskId{(void*)this};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
std::optional<folly::dynamic> ConsoleTaskContext::getSerializedStackTrace()
|
|
33
|
+
const {
|
|
34
|
+
auto maybeValue = runtimeTargetDelegate_.serializeStackTrace(*stackTrace_);
|
|
35
|
+
if (maybeValue) {
|
|
36
|
+
maybeValue.value()["description"] = name_;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return maybeValue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
void ConsoleTaskContext::schedule() {
|
|
43
|
+
orchestrator_.scheduleTask(id(), weak_from_this());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
} // namespace facebook::react::jsinspector_modern
|