react-native-windows 0.77.0 → 0.78.0-preview.2
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/.flowconfig +1 -1
- package/Chakra/ChakraTracing.cpp +1 -1
- package/Libraries/Animated/animations/Animation.js +22 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/nodes/AnimatedAddition.js +9 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +10 -2
- package/Libraries/Animated/nodes/AnimatedDivision.js +9 -2
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -1
- package/Libraries/Animated/nodes/AnimatedModulo.js +5 -2
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +9 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +25 -46
- package/Libraries/Animated/nodes/AnimatedObject.js +9 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +5 -1
- package/Libraries/Animated/nodes/AnimatedStyle.js +5 -1
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +9 -2
- package/Libraries/Animated/nodes/AnimatedTracking.js +5 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +49 -4
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/Animated/useAnimatedProps.js +0 -43
- package/Libraries/Components/Button.windows.js +3 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +1 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +3 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +21 -0
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +59 -0
- package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +29 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +3 -0
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
- package/Libraries/Components/TextInput/TextInput.js +6 -0
- package/Libraries/Components/TextInput/TextInput.windows.js +9 -0
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +2 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +3 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +7 -2
- package/Libraries/Components/View/ViewAccessibility.windows.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +0 -9
- package/Libraries/Components/View/ViewPropTypes.windows.js +1 -9
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +1 -16
- package/Libraries/EventEmitter/RCTEventEmitter.js +2 -6
- package/Libraries/Image/AssetSourceResolver.js +11 -0
- package/Libraries/Image/AssetSourceResolver.windows.js +11 -0
- package/Libraries/Image/Image.windows.js +2 -0
- package/Libraries/Inspector/BorderBox.js +26 -14
- package/Libraries/Inspector/BoxInspector.js +60 -42
- package/Libraries/Inspector/ElementBox.js +55 -48
- package/Libraries/Inspector/StyleInspector.js +36 -30
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Lists/FlatList.d.ts +1 -1
- package/Libraries/Modal/Modal.js +2 -0
- package/Libraries/Modal/Modal.windows.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -2
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -2
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +0 -2
- package/Libraries/Network/RCTNetworking.android.js +24 -16
- package/Libraries/Network/RCTNetworking.ios.js +1 -46
- package/Libraries/Network/RCTNetworking.windows.js +1 -46
- package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +57 -0
- package/Libraries/ReactNative/UIManagerProperties.js +3 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +15828 -26461
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +3907 -2560
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4399 -2878
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16102 -26908
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +4034 -2695
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4535 -3045
- package/Libraries/Renderer/shims/ReactNativeTypes.js +5 -6
- package/Libraries/StyleSheet/processTransform.js +6 -0
- package/Libraries/Text/Text.d.ts +6 -1
- package/Libraries/Text/Text.windows.js +4 -0
- package/Libraries/Text/TextProps.js +2 -2
- package/Libraries/Text/TextProps.windows.js +3 -2
- package/Libraries/Utilities/BackHandler.android.js +5 -4
- package/Libraries/Utilities/BackHandler.ios.js +4 -5
- package/Libraries/Utilities/BackHandler.windows.js +5 -4
- package/Microsoft.ReactNative/CompositionComponentView.idl +13 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +0 -1
- package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +0 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +92 -17
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +9 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +13 -33
- package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.cpp +43 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionRootAutomationProvider.h +2 -1
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +12 -10
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +11 -9
- package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +191 -329
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +3 -61
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.cpp +66 -0
- package/Microsoft.ReactNative/Fabric/Composition/PortalComponentView.h +52 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +21 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +7 -4
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +79 -19
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +12 -6
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +71 -17
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +16 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +5 -10
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +138 -110
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +27 -27
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +38 -33
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +0 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +5 -16
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +0 -3
- package/Microsoft.ReactNative/Fabric/ImageManager.cpp +9 -0
- package/Microsoft.ReactNative/Fabric/WindowsComponentDescriptorRegistry.cpp +0 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/PlatformColorUtils.cpp +1 -1
- package/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +5 -0
- package/Microsoft.ReactNative/IReactContext.cpp +2 -2
- package/Microsoft.ReactNative/IReactContext.h +1 -1
- package/Microsoft.ReactNative/IReactContext.idl +2 -2
- package/Microsoft.ReactNative/IReactPackageBuilder.idl +3 -3
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +97 -87
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +9 -4
- package/Microsoft.ReactNative/Modules/Animated/NativeAnimatedNodeManager.cpp +1 -1
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +32 -35
- package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.h +7 -4
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.cpp +2 -2
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +7 -5
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -1
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +10 -10
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +24 -24
- package/Microsoft.ReactNative/Modules/Timing.cpp +2 -2
- package/Microsoft.ReactNative/ReactHost/IReactInstance.h +5 -0
- package/Microsoft.ReactNative/ReactHost/React.h +0 -3
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +39 -16
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +4 -2
- package/Microsoft.ReactNative/ReactNativeHost.cpp +9 -4
- package/Microsoft.ReactNative/ReactNativeIsland.idl +5 -1
- package/Microsoft.ReactNative/ReactPackageBuilder.cpp +3 -3
- package/Microsoft.ReactNative/ReactPackageBuilder.h +4 -4
- package/Microsoft.ReactNative/Utils/Helpers.cpp +0 -2
- package/Microsoft.ReactNative/Views/DebuggingOverlayViewManager.cpp +0 -1
- package/Microsoft.ReactNative/Views/DevMenu.cpp +6 -6
- package/Microsoft.ReactNative/Views/DevMenu.h +1 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +2 -2
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +2 -2
- package/Microsoft.ReactNative/XamlUIService.cpp +13 -7
- package/Microsoft.ReactNative/XamlUIService.h +4 -1
- package/Microsoft.ReactNative/XamlUIService.idl +2 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +6 -2
- package/Microsoft.ReactNative.Cxx/ReactContext.h +1 -1
- package/Microsoft.ReactNative.Cxx/XamlUtils.h +12 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/React.Cpp.props +3 -0
- package/PropertySheets/WebView2.props +1 -1
- package/PropertySheets/WinUI.props +5 -4
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +3 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +91 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/componentregistry/ComponentDescriptorRegistry.cpp +1 -12
- package/{Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h → ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/textinput/TextInputState.h} +37 -35
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/accessibilityPropsConversions.h +4 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/imagemanager/ImageRequestParams.h +30 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/runtimescheduler/SchedulerPriorityUtils.h +4 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/uimanager/primitives.h +179 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +43 -57
- package/Shared/HermesRuntimeHolder.cpp +2 -2
- package/Shared/Shared.vcxitems +8 -14
- package/Shared/Shared.vcxitems.filters +4 -16
- package/Shared/Threading/BatchingQueueThread.cpp +3 -3
- package/codegen/NativeCPUTimeSpec.g.h +41 -0
- package/codegen/NativeFantomSpec.g.h +78 -0
- package/codegen/NativePerformanceSpec.g.h +31 -43
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +84 -84
- package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +212 -0
- package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +295 -0
- package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +200 -0
- package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +224 -0
- package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +250 -0
- package/codegen/react/components/rnwcore/AndroidSwitch.g.h +267 -0
- package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +234 -0
- package/codegen/react/components/rnwcore/InputAccessory.g.h +200 -0
- package/codegen/react/components/rnwcore/ModalHostView.g.h +283 -0
- package/codegen/react/components/rnwcore/PullToRefreshView.g.h +246 -0
- package/codegen/react/components/rnwcore/SafeAreaView.g.h +197 -0
- package/codegen/react/components/rnwcore/Switch.g.h +263 -0
- package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +200 -0
- package/codegen/rnwcoreJSI-generated.cpp +90 -57
- package/codegen/rnwcoreJSI.h +241 -104
- package/index.js +5 -0
- package/index.windows.js +5 -0
- package/just-task.js +1 -1
- package/package.json +25 -26
- package/src/private/animated/NativeAnimatedValidation.js +1 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +33 -27
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -5
- package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
- package/src/private/specs/modules/{NativeJSCSamplingProfiler.js → NativeCPUTime.js} +7 -2
- package/src/private/specs/modules/NativeFantom.js +37 -0
- package/src/private/utilities/ensureInstance.js +21 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +49 -6
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +17 -9
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/performance/Performance.js +0 -12
- package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
- package/types/index.d.ts +1 -0
- package/Libraries/HeapCapture/HeapCapture.js +0 -29
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -13
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -13
- package/Libraries/Performance/SamplingProfiler.js +0 -39
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentDescriptor.h +0 -39
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.cpp +0 -18
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewShadowNode.h +0 -39
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -34
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.cpp +0 -53
- package/Microsoft.ReactNative/Fabric/ReactNativeConfigProperties.h +0 -26
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +0 -363
- package/codegen/NativeJSCSamplingProfilerSpec.g.h +0 -35
- package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
- package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
|
@@ -124,7 +124,7 @@ void TimerRegistry::setTimerManager(std::weak_ptr<facebook::react::TimerManager>
|
|
|
124
124
|
void Timing::Initialize(winrt::Microsoft::ReactNative::ReactContext const &reactContext) noexcept {
|
|
125
125
|
m_context = reactContext;
|
|
126
126
|
m_properties = reactContext.Properties().Handle();
|
|
127
|
-
m_usePostForRendering = !xaml::
|
|
127
|
+
m_usePostForRendering = !xaml::TryGetCurrentUwpXamlApplication();
|
|
128
128
|
m_uiDispatcher = m_context.UIDispatcher().Handle();
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -133,7 +133,7 @@ void Timing::InitializeBridgeless(
|
|
|
133
133
|
const winrt::Microsoft::ReactNative::IReactPropertyBag &properties) noexcept {
|
|
134
134
|
m_timerRegistry = timerRegistry;
|
|
135
135
|
m_properties = properties;
|
|
136
|
-
m_usePostForRendering = !xaml::
|
|
136
|
+
m_usePostForRendering = !xaml::TryGetCurrentUwpXamlApplication();
|
|
137
137
|
m_uiDispatcher = {properties.Get(winrt::Microsoft::ReactNative::ReactDispatcherHelper::UIDispatcherProperty())
|
|
138
138
|
.try_as<winrt::Microsoft::ReactNative::IReactDispatcher>()};
|
|
139
139
|
}
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
#include <DevSettings.h>
|
|
8
8
|
#include <folly/dynamic.h>
|
|
9
|
+
|
|
10
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
9
11
|
#include "XamlView.h"
|
|
12
|
+
#endif
|
|
10
13
|
|
|
11
14
|
#include <functional>
|
|
12
15
|
#include <string>
|
|
@@ -15,7 +18,9 @@ namespace Microsoft::ReactNative {
|
|
|
15
18
|
|
|
16
19
|
struct INativeUIManager;
|
|
17
20
|
class ExpressionAnimationStore;
|
|
21
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
18
22
|
struct IXamlRootView;
|
|
23
|
+
#endif
|
|
19
24
|
|
|
20
25
|
typedef unsigned int LiveReloadCallbackCookie;
|
|
21
26
|
typedef unsigned int ErrorCallbackCookie;
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
#ifdef USE_FABRIC
|
|
56
56
|
#include <Fabric/Composition/UriImageManager.h>
|
|
57
57
|
#include <Fabric/FabricUIManagerModule.h>
|
|
58
|
-
#include <Fabric/ReactNativeConfigProperties.h>
|
|
59
58
|
#include <Fabric/WindowsComponentDescriptorRegistry.h>
|
|
60
59
|
#include <SchedulerSettings.h>
|
|
61
60
|
#include <jserrorhandler/JsErrorHandler.h>
|
|
@@ -67,11 +66,16 @@
|
|
|
67
66
|
#include <react/runtime/TimerManager.h>
|
|
68
67
|
#endif
|
|
69
68
|
|
|
70
|
-
#
|
|
69
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
71
70
|
#include <LayoutService.h>
|
|
71
|
+
#include <XamlUIService.h>
|
|
72
|
+
#include "Modules/NativeUIManager.h"
|
|
73
|
+
#include "Modules/PaperUIManagerModule.h"
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
#ifndef CORE_ABI
|
|
72
77
|
#include <Utils/UwpPreparedScriptStore.h>
|
|
73
78
|
#include <Utils/UwpScriptStore.h>
|
|
74
|
-
#include <XamlUIService.h>
|
|
75
79
|
#include "ConfigureBundlerDlg.h"
|
|
76
80
|
#include "Modules/AccessibilityInfoModule.h"
|
|
77
81
|
#include "Modules/AlertModule.h"
|
|
@@ -82,8 +86,6 @@
|
|
|
82
86
|
#include "Modules/I18nManagerModule.h"
|
|
83
87
|
#include "Modules/LinkingManagerModule.h"
|
|
84
88
|
#include "Modules/LogBoxModule.h"
|
|
85
|
-
#include "Modules/NativeUIManager.h"
|
|
86
|
-
#include "Modules/PaperUIManagerModule.h"
|
|
87
89
|
#else
|
|
88
90
|
#include "Modules/DesktopTimingModule.h"
|
|
89
91
|
#endif
|
|
@@ -164,7 +166,7 @@ struct BridgeUIBatchInstanceCallback final : public facebook::react::InstanceCal
|
|
|
164
166
|
UIBatchCompleteCallbackProperty())) {
|
|
165
167
|
(*callback)(instance->m_reactContext->Properties());
|
|
166
168
|
}
|
|
167
|
-
#
|
|
169
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
168
170
|
if (auto uiManager = Microsoft::ReactNative::GetNativeUIManager(*instance->m_reactContext).lock()) {
|
|
169
171
|
uiManager->onBatchComplete();
|
|
170
172
|
}
|
|
@@ -189,7 +191,7 @@ struct BridgeUIBatchInstanceCallback final : public facebook::react::InstanceCal
|
|
|
189
191
|
UIBatchCompleteCallbackProperty())) {
|
|
190
192
|
(*callback)(instance->m_reactContext->Properties());
|
|
191
193
|
}
|
|
192
|
-
#
|
|
194
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
193
195
|
if (auto uiManager = Microsoft::ReactNative::GetNativeUIManager(*instance->m_reactContext).lock()) {
|
|
194
196
|
uiManager->onBatchComplete();
|
|
195
197
|
}
|
|
@@ -347,15 +349,16 @@ void ReactInstanceWin::LoadModules(
|
|
|
347
349
|
}
|
|
348
350
|
#endif
|
|
349
351
|
|
|
350
|
-
#
|
|
351
|
-
|
|
352
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
352
353
|
if (!IsBridgeless()) {
|
|
353
354
|
registerTurboModule(
|
|
354
355
|
L"UIManager",
|
|
355
356
|
// TODO: Use MakeTurboModuleProvider after it satisfies ReactNativeSpecs::UIManagerSpec
|
|
356
357
|
winrt::Microsoft::ReactNative::MakeModuleProvider<::Microsoft::ReactNative::UIManager>());
|
|
357
358
|
}
|
|
359
|
+
#endif
|
|
358
360
|
|
|
361
|
+
#ifndef CORE_ABI
|
|
359
362
|
registerTurboModule(
|
|
360
363
|
L"AccessibilityInfo",
|
|
361
364
|
winrt::Microsoft::ReactNative::MakeTurboModuleProvider<::Microsoft::ReactNative::AccessibilityInfo>());
|
|
@@ -497,7 +500,7 @@ void ReactInstanceWin::Initialize() noexcept {
|
|
|
497
500
|
|
|
498
501
|
void ReactInstanceWin::InitDevMenu() noexcept {
|
|
499
502
|
Microsoft::ReactNative::DevMenuManager::InitDevMenu(m_reactContext, [weakReactHost = m_weakReactHost]() noexcept {
|
|
500
|
-
#
|
|
503
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
501
504
|
Microsoft::ReactNative::ShowConfigureBundlerDialog(weakReactHost);
|
|
502
505
|
#endif // CORE_ABI
|
|
503
506
|
});
|
|
@@ -585,6 +588,24 @@ std::unique_ptr<facebook::jsi::PreparedScriptStore> CreatePreparedScriptStore()
|
|
|
585
588
|
}
|
|
586
589
|
|
|
587
590
|
#ifdef USE_FABRIC
|
|
591
|
+
|
|
592
|
+
typedef HRESULT(__stdcall *SetThreadDescriptionFn)(HANDLE, PCWSTR);
|
|
593
|
+
void SetJSThreadDescription() noexcept {
|
|
594
|
+
// Office still supports Server 2016 so we need to use Run Time Dynamic Linking and cannot just use:
|
|
595
|
+
// ::SetThreadDescription(GetCurrentThread(), L"React-Native JavaScript Thread");
|
|
596
|
+
|
|
597
|
+
auto moduleHandle = GetModuleHandleW(L"kernelbase.dll");
|
|
598
|
+
// The description is just for developer experience, so we can skip it if kernelbase isn't already loaded
|
|
599
|
+
if (!moduleHandle)
|
|
600
|
+
return;
|
|
601
|
+
|
|
602
|
+
auto proc = GetProcAddress(moduleHandle, "SetThreadDescription");
|
|
603
|
+
if (!proc)
|
|
604
|
+
return;
|
|
605
|
+
|
|
606
|
+
reinterpret_cast<SetThreadDescriptionFn>(proc)(GetCurrentThread(), L"React-Native JavaScript Thread");
|
|
607
|
+
}
|
|
608
|
+
|
|
588
609
|
void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
589
610
|
InitUIQueue();
|
|
590
611
|
|
|
@@ -633,7 +654,7 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
633
654
|
Mso::Copy(m_whenDestroyed)));
|
|
634
655
|
|
|
635
656
|
m_jsMessageThread.Load()->runOnQueueSync([&]() {
|
|
636
|
-
|
|
657
|
+
SetJSThreadDescription();
|
|
637
658
|
auto timerRegistry =
|
|
638
659
|
::Microsoft::ReactNative::TimerRegistry::CreateTimerRegistry(m_reactContext->Properties());
|
|
639
660
|
auto timerRegistryRaw = timerRegistry.get();
|
|
@@ -643,7 +664,7 @@ void ReactInstanceWin::InitializeBridgeless() noexcept {
|
|
|
643
664
|
|
|
644
665
|
auto jsErrorHandlingFunc = [this](
|
|
645
666
|
facebook::jsi::Runtime &runtime,
|
|
646
|
-
const facebook::react::JsErrorHandler::
|
|
667
|
+
const facebook::react::JsErrorHandler::ProcessedError &error) noexcept {
|
|
647
668
|
OnJSError(runtime, std::move(error));
|
|
648
669
|
};
|
|
649
670
|
|
|
@@ -754,7 +775,7 @@ void ReactInstanceWin::InitializeWithBridge() noexcept {
|
|
|
754
775
|
InitUIQueue();
|
|
755
776
|
InitUIMessageThread();
|
|
756
777
|
|
|
757
|
-
#
|
|
778
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
758
779
|
// InitUIManager uses m_legacyReactInstance
|
|
759
780
|
InitUIManager();
|
|
760
781
|
#endif
|
|
@@ -1145,7 +1166,7 @@ bool ReactInstanceWin::IsBridgeless() noexcept {
|
|
|
1145
1166
|
winrt::Microsoft::ReactNative::ReactPropertyBag(m_reactContext->Properties()));
|
|
1146
1167
|
}
|
|
1147
1168
|
|
|
1148
|
-
#
|
|
1169
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
1149
1170
|
void ReactInstanceWin::InitUIManager() noexcept {
|
|
1150
1171
|
std::vector<std::unique_ptr<Microsoft::ReactNative::IViewManager>> viewManagers;
|
|
1151
1172
|
|
|
@@ -1267,12 +1288,12 @@ void ReactInstanceWin::OnError(const Mso::ErrorCode &errorCode) noexcept {
|
|
|
1267
1288
|
#ifdef USE_FABRIC
|
|
1268
1289
|
void ReactInstanceWin::OnJSError(
|
|
1269
1290
|
facebook::jsi::Runtime &runtime,
|
|
1270
|
-
const facebook::react::JsErrorHandler::
|
|
1291
|
+
const facebook::react::JsErrorHandler::ProcessedError &error) noexcept {
|
|
1271
1292
|
ErrorInfo errorInfo;
|
|
1272
1293
|
errorInfo.Message = error.message;
|
|
1273
1294
|
auto errorCode = Mso::React::ReactErrorProvider().MakeErrorCode(Mso::React::ReactError{errorInfo.Message.c_str()});
|
|
1274
1295
|
|
|
1275
|
-
for (const facebook::react::JsErrorHandler::
|
|
1296
|
+
for (const facebook::react::JsErrorHandler::ProcessedError::StackFrame &frame : error.stack) {
|
|
1276
1297
|
errorInfo.Callstack.push_back(
|
|
1277
1298
|
{frame.file.value(), frame.methodName, frame.lineNumber.value(), frame.column.value()});
|
|
1278
1299
|
}
|
|
@@ -1446,12 +1467,14 @@ void ReactInstanceWin::AttachMeasuredRootView(
|
|
|
1446
1467
|
if (!useFabric || m_useWebDebugger) {
|
|
1447
1468
|
int64_t rootTag = -1;
|
|
1448
1469
|
|
|
1470
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
1449
1471
|
if (auto uiManager = Microsoft::ReactNative::GetNativeUIManager(*m_reactContext).lock()) {
|
|
1450
1472
|
rootTag = uiManager->AddMeasuredRootView(rootView);
|
|
1451
1473
|
rootView->SetTag(rootTag);
|
|
1452
1474
|
} else {
|
|
1453
1475
|
assert(false);
|
|
1454
1476
|
}
|
|
1477
|
+
#endif
|
|
1455
1478
|
|
|
1456
1479
|
std::string jsMainModuleName = rootView->JSComponentName();
|
|
1457
1480
|
folly::dynamic params = folly::dynamic::array(
|
|
@@ -111,7 +111,7 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
111
111
|
void InitNativeMessageThread() noexcept;
|
|
112
112
|
void InitUIMessageThread() noexcept;
|
|
113
113
|
void SetupHMRClient() noexcept;
|
|
114
|
-
#
|
|
114
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
115
115
|
void InitUIManager() noexcept;
|
|
116
116
|
#endif
|
|
117
117
|
|
|
@@ -141,7 +141,9 @@ class ReactInstanceWin final : public Mso::ActiveObject<IReactInstanceInternal>
|
|
|
141
141
|
void OnError(const Mso::ErrorCode &errorcode) noexcept;
|
|
142
142
|
void OnErrorWithMessage(const std::string &errorMessage) noexcept;
|
|
143
143
|
#ifdef USE_FABRIC
|
|
144
|
-
void OnJSError(
|
|
144
|
+
void OnJSError(
|
|
145
|
+
facebook::jsi::Runtime &runtime,
|
|
146
|
+
const facebook::react::JsErrorHandler::ProcessedError &error) noexcept;
|
|
145
147
|
#endif
|
|
146
148
|
void OnLiveReload() noexcept;
|
|
147
149
|
void OnWaitingForDebugger() noexcept;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
#include "ReactInstanceSettings.h"
|
|
16
16
|
|
|
17
17
|
#ifdef USE_FABRIC
|
|
18
|
+
#include <Fabric/Composition/Modal/WindowsModalHostViewComponentView.h>
|
|
18
19
|
#include <Fabric/WindowsComponentDescriptorRegistry.h>
|
|
19
20
|
#include <ReactPackageBuilder.h>
|
|
20
21
|
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
@@ -24,7 +25,7 @@ using namespace winrt;
|
|
|
24
25
|
using namespace Windows::Foundation;
|
|
25
26
|
using namespace Windows::Foundation::Collections;
|
|
26
27
|
|
|
27
|
-
#
|
|
28
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
28
29
|
using namespace xaml;
|
|
29
30
|
using namespace xaml::Controls;
|
|
30
31
|
#endif
|
|
@@ -87,7 +88,7 @@ ReactNativeHostProperty() noexcept {
|
|
|
87
88
|
IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
|
|
88
89
|
auto modulesProvider = std::make_shared<NativeModulesProvider>();
|
|
89
90
|
|
|
90
|
-
#
|
|
91
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
91
92
|
auto viewManagersProvider = std::make_shared<ViewManagersProvider>();
|
|
92
93
|
#endif
|
|
93
94
|
|
|
@@ -105,7 +106,7 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
|
|
|
105
106
|
|
|
106
107
|
m_packageBuilder = make<ReactPackageBuilder>(
|
|
107
108
|
modulesProvider,
|
|
108
|
-
#
|
|
109
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
109
110
|
viewManagersProvider,
|
|
110
111
|
#endif
|
|
111
112
|
turboModulesProvider,
|
|
@@ -115,6 +116,10 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
|
|
|
115
116
|
#endif
|
|
116
117
|
m_instanceSettings.UseWebDebugger());
|
|
117
118
|
|
|
119
|
+
#ifdef USE_FABRIC
|
|
120
|
+
winrt::Microsoft::ReactNative::Composition::implementation::RegisterWindowsModalHostNativeComponent(m_packageBuilder);
|
|
121
|
+
#endif
|
|
122
|
+
|
|
118
123
|
if (auto packageProviders = InstanceSettings().PackageProviders()) {
|
|
119
124
|
for (auto const &packageProvider : packageProviders) {
|
|
120
125
|
packageProvider.CreatePackage(m_packageBuilder);
|
|
@@ -163,7 +168,7 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {
|
|
|
163
168
|
reactOptions.SetJsiEngine(static_cast<Mso::React::JSIEngine>(m_instanceSettings.JSIEngineOverride()));
|
|
164
169
|
|
|
165
170
|
reactOptions.ModuleProvider = modulesProvider;
|
|
166
|
-
#
|
|
171
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
167
172
|
reactOptions.ViewManagerProvider = viewManagersProvider;
|
|
168
173
|
#endif
|
|
169
174
|
reactOptions.TurboModuleProvider = turboModulesProvider;
|
|
@@ -6,6 +6,8 @@ import "ReactCoreInjection.idl";
|
|
|
6
6
|
import "ReactNativeHost.idl";
|
|
7
7
|
import "Theme.idl";
|
|
8
8
|
import "IReactViewComponentBuilder.idl";
|
|
9
|
+
import "CompositionComponentView.idl";
|
|
10
|
+
|
|
9
11
|
#include "NamespaceRedirect.h"
|
|
10
12
|
#include "DocString.h"
|
|
11
13
|
|
|
@@ -83,7 +85,9 @@ namespace Microsoft.ReactNative
|
|
|
83
85
|
|
|
84
86
|
#ifdef USE_WINUI3
|
|
85
87
|
ReactNativeIsland(Microsoft.UI.Composition.Compositor compositor);
|
|
86
|
-
|
|
88
|
+
|
|
89
|
+
DOC_STRING("Used to create react portals, such as a native modal component.")
|
|
90
|
+
static ReactNativeIsland CreatePortal(Microsoft.ReactNative.Composition.PortalComponentView portal);
|
|
87
91
|
#endif
|
|
88
92
|
|
|
89
93
|
DOC_STRING(
|
|
@@ -16,7 +16,7 @@ namespace winrt::Microsoft::ReactNative {
|
|
|
16
16
|
|
|
17
17
|
ReactPackageBuilder::ReactPackageBuilder(
|
|
18
18
|
std::shared_ptr<NativeModulesProvider> const &modulesProvider,
|
|
19
|
-
#
|
|
19
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
20
20
|
std::shared_ptr<ViewManagersProvider> const &viewManagersProvider,
|
|
21
21
|
#endif
|
|
22
22
|
std::shared_ptr<TurboModulesProvider> const &turboModulesProvider,
|
|
@@ -26,7 +26,7 @@ ReactPackageBuilder::ReactPackageBuilder(
|
|
|
26
26
|
#endif
|
|
27
27
|
bool isWebDebugging) noexcept
|
|
28
28
|
: m_modulesProvider{modulesProvider},
|
|
29
|
-
#
|
|
29
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
30
30
|
m_viewManagersProvider{viewManagersProvider},
|
|
31
31
|
#endif
|
|
32
32
|
m_turboModulesProvider{turboModulesProvider},
|
|
@@ -42,7 +42,7 @@ void ReactPackageBuilder::AddModule(hstring const &moduleName, ReactModuleProvid
|
|
|
42
42
|
m_modulesProvider->AddModuleProvider(moduleName, moduleProvider);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
#
|
|
45
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
46
46
|
void ReactPackageBuilder::AddViewManager(
|
|
47
47
|
hstring const &viewManagerName,
|
|
48
48
|
ReactViewManagerProvider const &viewManagerProvider) noexcept {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
#include "NativeModulesProvider.h"
|
|
6
6
|
#include "TurboModulesProvider.h"
|
|
7
|
-
#
|
|
7
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
8
8
|
#include "ViewManagersProvider.h"
|
|
9
9
|
#endif
|
|
10
10
|
#include "winrt/Microsoft.ReactNative.h"
|
|
@@ -26,7 +26,7 @@ struct ReactPackageBuilder : winrt::implements<
|
|
|
26
26
|
> {
|
|
27
27
|
ReactPackageBuilder(
|
|
28
28
|
std::shared_ptr<NativeModulesProvider> const &modulesProvider,
|
|
29
|
-
#
|
|
29
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
30
30
|
std::shared_ptr<ViewManagersProvider> const &viewManagersProvider,
|
|
31
31
|
#endif
|
|
32
32
|
std::shared_ptr<TurboModulesProvider> const &turboModulesProvider,
|
|
@@ -39,7 +39,7 @@ struct ReactPackageBuilder : winrt::implements<
|
|
|
39
39
|
|
|
40
40
|
public: // IReactPackageBuilder
|
|
41
41
|
void AddModule(hstring const &moduleName, ReactModuleProvider const &moduleProvider) noexcept;
|
|
42
|
-
#
|
|
42
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
43
43
|
void AddViewManager(hstring const &viewManagerName, ReactViewManagerProvider const &viewManagerProvider) noexcept;
|
|
44
44
|
#endif
|
|
45
45
|
void AddTurboModule(hstring const &moduleName, ReactModuleProvider const &moduleProvider) noexcept;
|
|
@@ -52,7 +52,7 @@ struct ReactPackageBuilder : winrt::implements<
|
|
|
52
52
|
|
|
53
53
|
private:
|
|
54
54
|
std::shared_ptr<NativeModulesProvider> m_modulesProvider;
|
|
55
|
-
#
|
|
55
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
56
56
|
std::shared_ptr<ViewManagersProvider> m_viewManagersProvider;
|
|
57
57
|
#endif
|
|
58
58
|
std::shared_ptr<TurboModulesProvider> m_turboModulesProvider;
|
|
@@ -48,7 +48,6 @@ void DebuggingOverlayViewManager::DispatchCommand(
|
|
|
48
48
|
// There is little point in attempting to implement these commands until then.
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
Super::DispatchCommand(viewToUpdate, commandId, std::move(commandArgs));
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
} // namespace Microsoft::ReactNative
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
#include "IReactDispatcher.h"
|
|
11
11
|
#include "Modules/DevSettingsModule.h"
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
14
14
|
#include <XamlUtils.h>
|
|
15
15
|
#include "DevMenuControl.h"
|
|
16
16
|
#include "UI.Xaml.Controls.Primitives.h"
|
|
@@ -37,7 +37,7 @@ struct IDevMenu {
|
|
|
37
37
|
virtual void Show() noexcept = 0;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
#
|
|
40
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
41
41
|
bool IsCtrlShiftD(winrt::Windows::System::VirtualKey key) noexcept {
|
|
42
42
|
return (
|
|
43
43
|
key == winrt::Windows::System::VirtualKey::D &&
|
|
@@ -116,7 +116,7 @@ const wchar_t *HermesProfilerLabel(Mso::CntPtr<Mso::React::IReactContext> const
|
|
|
116
116
|
: L"Stop and copy trace path to clipboard";
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
#
|
|
119
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
120
120
|
struct InAppXamlDevMenu : public IDevMenu, public std::enable_shared_from_this<InAppXamlDevMenu> {
|
|
121
121
|
InAppXamlDevMenu(Mso::CntPtr<Mso::React::IReactContext> const &reactContext) : m_context(reactContext) {}
|
|
122
122
|
|
|
@@ -348,7 +348,7 @@ struct WindowsPopupMenuDevMenu : public IDevMenu, public std::enable_shared_from
|
|
|
348
348
|
DevMenuManager::DevMenuManager(Mso::CntPtr<Mso::React::IReactContext> const &reactContext) : m_context(reactContext) {}
|
|
349
349
|
|
|
350
350
|
void DevMenuManager::Init() noexcept {
|
|
351
|
-
#
|
|
351
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
352
352
|
auto uiDispatcher = React::implementation::ReactDispatcher::GetUIDispatcher(m_context->Properties());
|
|
353
353
|
uiDispatcher.Post([weakThis = weak_from_this()]() {
|
|
354
354
|
if (auto strongThis = weakThis.lock()) {
|
|
@@ -396,8 +396,8 @@ std::shared_ptr<IDevMenu> GetOrCreateDevMenu(Mso::CntPtr<Mso::React::IReactConte
|
|
|
396
396
|
.GetOrCreate(
|
|
397
397
|
DevMenuImplProperty(),
|
|
398
398
|
[reactContext]() -> std::shared_ptr<IDevMenu> {
|
|
399
|
-
#
|
|
400
|
-
if (xaml::
|
|
399
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
400
|
+
if (xaml::TryGetCurrentUwpXamlApplication()) {
|
|
401
401
|
auto devMenu = std::make_shared<InAppXamlDevMenu>(reactContext);
|
|
402
402
|
return devMenu;
|
|
403
403
|
} else
|
|
@@ -21,7 +21,7 @@ struct DevMenuManager : public std::enable_shared_from_this<DevMenuManager> {
|
|
|
21
21
|
private:
|
|
22
22
|
void Init() noexcept;
|
|
23
23
|
const Mso::CntPtr<Mso::React::IReactContext> m_context;
|
|
24
|
-
#
|
|
24
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC)
|
|
25
25
|
winrt::CoreDispatcher::AcceleratorKeyActivated_revoker m_coreDispatcherAKARevoker{};
|
|
26
26
|
xaml::UIElement::KeyDown_revoker m_keyDownRevoker;
|
|
27
27
|
#endif
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
#include <Utils/PropertyUtils.h>
|
|
20
20
|
#include <Views/ExpressionAnimationStore.h>
|
|
21
21
|
#include <Views/ShadowNodeBase.h>
|
|
22
|
-
#include <cxxreact/
|
|
22
|
+
#include <cxxreact/TraceSection.h>
|
|
23
23
|
|
|
24
24
|
namespace winrt {
|
|
25
25
|
using namespace xaml;
|
|
@@ -308,7 +308,7 @@ void ViewManagerBase::UpdateProperties(
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
{
|
|
311
|
-
|
|
311
|
+
TraceSection s("ViewManagerBase::OnPropertiesUpdated");
|
|
312
312
|
OnPropertiesUpdated(nodeToUpdate);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
#include <UI.Xaml.Media.h>
|
|
10
10
|
#include <Utils/PropertyUtils.h>
|
|
11
11
|
#include <Utils/ResourceBrushUtils.h>
|
|
12
|
-
#include <cxxreact/
|
|
12
|
+
#include <cxxreact/TraceSection.h>
|
|
13
13
|
#include <winrt/Windows.Foundation.h>
|
|
14
14
|
#include <winrt/Windows.UI.Xaml.Interop.h>
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
#include <INativeUIManager.h>
|
|
20
20
|
#include <IReactInstance.h>
|
|
21
21
|
|
|
22
|
-
#include <cxxreact/
|
|
22
|
+
#include <cxxreact/TraceSection.h>
|
|
23
23
|
#include <inspectable.h>
|
|
24
24
|
#include <unicode.h>
|
|
25
25
|
#include <winrt/Windows.System.h>
|
|
@@ -419,7 +419,7 @@ void ViewViewManager::TryUpdateView(
|
|
|
419
419
|
// 2. Transfer needed properties from old to new view
|
|
420
420
|
//
|
|
421
421
|
{
|
|
422
|
-
|
|
422
|
+
TraceSection s("ViewViewManager::TransferProperties");
|
|
423
423
|
// Transfer properties from old XamlView to the new one
|
|
424
424
|
TransferProperties(oldXamlView, newXamlView);
|
|
425
425
|
}
|
|
@@ -4,17 +4,28 @@
|
|
|
4
4
|
#include "pch.h"
|
|
5
5
|
#include "XamlUIService.h"
|
|
6
6
|
#include "XamlUIService.g.cpp"
|
|
7
|
+
|
|
8
|
+
#ifndef USE_FABRIC
|
|
7
9
|
#include <Modules/NativeUIManager.h>
|
|
8
10
|
#include <Modules/PaperUIManagerModule.h>
|
|
9
|
-
#include "DynamicWriter.h"
|
|
10
11
|
#include "ShadowNodeBase.h"
|
|
11
12
|
#include "Views/ShadowNodeBase.h"
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
#include "DynamicWriter.h"
|
|
12
16
|
#include "XamlView.h"
|
|
13
17
|
|
|
14
18
|
namespace winrt::Microsoft::ReactNative::implementation {
|
|
15
19
|
|
|
16
20
|
XamlUIService::XamlUIService(Mso::CntPtr<Mso::React::IReactContext> &&context) noexcept : m_context(context) {}
|
|
17
21
|
|
|
22
|
+
/*static*/ winrt::Microsoft::ReactNative::XamlUIService XamlUIService::FromContext(IReactContext context) {
|
|
23
|
+
return context.Properties()
|
|
24
|
+
.Get(XamlUIService::XamlUIServiceProperty().Handle())
|
|
25
|
+
.try_as<winrt::Microsoft::ReactNative::XamlUIService>();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#ifndef USE_FABRIC
|
|
18
29
|
xaml::DependencyObject XamlUIService::ElementFromReactTag(int64_t reactTag) noexcept {
|
|
19
30
|
if (auto uiManager = ::Microsoft::ReactNative::GetNativeUIManager(*m_context).lock()) {
|
|
20
31
|
auto shadowNode = uiManager->getHost()->FindShadowNodeForTag(reactTag);
|
|
@@ -26,12 +37,6 @@ xaml::DependencyObject XamlUIService::ElementFromReactTag(int64_t reactTag) noex
|
|
|
26
37
|
return nullptr;
|
|
27
38
|
}
|
|
28
39
|
|
|
29
|
-
/*static*/ winrt::Microsoft::ReactNative::XamlUIService XamlUIService::FromContext(IReactContext context) {
|
|
30
|
-
return context.Properties()
|
|
31
|
-
.Get(XamlUIService::XamlUIServiceProperty().Handle())
|
|
32
|
-
.try_as<winrt::Microsoft::ReactNative::XamlUIService>();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
40
|
void XamlUIService::DispatchEvent(
|
|
36
41
|
xaml::FrameworkElement const &view,
|
|
37
42
|
hstring const &eventName,
|
|
@@ -64,6 +69,7 @@ winrt::Microsoft::ReactNative::ReactRootView XamlUIService::GetReactRootView(
|
|
|
64
69
|
}
|
|
65
70
|
return nullptr;
|
|
66
71
|
}
|
|
72
|
+
#endif
|
|
67
73
|
|
|
68
74
|
/*static*/ ReactPropertyId<XamlUIService> XamlUIService::XamlUIServiceProperty() noexcept {
|
|
69
75
|
static ReactPropertyId<XamlUIService> uiManagerProperty{L"ReactNative.UIManager", L"XamlUIManager"};
|
|
@@ -15,14 +15,17 @@ struct XamlUIService : XamlUIServiceT<XamlUIService> {
|
|
|
15
15
|
XamlUIService(Mso::CntPtr<Mso::React::IReactContext> &&context) noexcept;
|
|
16
16
|
static ReactPropertyId<XamlUIService> XamlUIServiceProperty() noexcept;
|
|
17
17
|
|
|
18
|
-
xaml::DependencyObject ElementFromReactTag(int64_t reactTag) noexcept;
|
|
19
18
|
static winrt::Microsoft::ReactNative::XamlUIService FromContext(IReactContext context);
|
|
19
|
+
|
|
20
|
+
#ifndef USE_FABRIC
|
|
21
|
+
xaml::DependencyObject ElementFromReactTag(int64_t reactTag) noexcept;
|
|
20
22
|
void DispatchEvent(
|
|
21
23
|
xaml::FrameworkElement const &view,
|
|
22
24
|
hstring const &eventName,
|
|
23
25
|
JSValueArgWriter const &eventDataArgWriter) noexcept;
|
|
24
26
|
|
|
25
27
|
winrt::Microsoft::ReactNative::ReactRootView GetReactRootView(xaml::FrameworkElement const &view) noexcept;
|
|
28
|
+
#endif
|
|
26
29
|
|
|
27
30
|
static void SetXamlRoot(IReactPropertyBag const &properties, xaml::XamlRoot const &xamlRoot) noexcept;
|
|
28
31
|
static void SetAccessibleRoot(
|
|
@@ -19,6 +19,7 @@ namespace Microsoft.ReactNative
|
|
|
19
19
|
DOC_STRING("Use this method to get access to the @XamlUIService associated with the @IReactContext.")
|
|
20
20
|
static XamlUIService FromContext(IReactContext context);
|
|
21
21
|
|
|
22
|
+
#ifndef USE_FABRIC
|
|
22
23
|
DOC_STRING("Gets the backing XAML element from a react tag.")
|
|
23
24
|
XAML_NAMESPACE.DependencyObject ElementFromReactTag(Int64 reactTag);
|
|
24
25
|
|
|
@@ -27,6 +28,7 @@ namespace Microsoft.ReactNative
|
|
|
27
28
|
|
|
28
29
|
DOC_STRING("Gets the @ReactRootView view for a given element.")
|
|
29
30
|
ReactRootView GetReactRootView(XAML_NAMESPACE.FrameworkElement view);
|
|
31
|
+
#endif
|
|
30
32
|
|
|
31
33
|
DOC_STRING(
|
|
32
34
|
"Sets the @Windows.UI.Xaml.XamlRoot element for the app. "
|
|
@@ -283,7 +283,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
283
283
|
~ValueRef() noexcept;
|
|
284
284
|
operator facebook::jsi::Value const &() const noexcept;
|
|
285
285
|
|
|
286
|
-
|
|
286
|
+
struct alignas(std::max_align_t) StoreType {
|
|
287
|
+
std::byte buffer[sizeof(DataPointerValue)];
|
|
288
|
+
};
|
|
287
289
|
static void InitValueRef(JsiValueRef const &data, facebook::jsi::Value *value, StoreType *store) noexcept;
|
|
288
290
|
|
|
289
291
|
private:
|
|
@@ -307,7 +309,9 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
307
309
|
~PropNameIDRef() noexcept;
|
|
308
310
|
operator facebook::jsi::PropNameID const &() const noexcept;
|
|
309
311
|
|
|
310
|
-
|
|
312
|
+
struct alignas(std::max_align_t) StoreType {
|
|
313
|
+
std::byte buffer[sizeof(DataPointerValue)];
|
|
314
|
+
};
|
|
311
315
|
|
|
312
316
|
private:
|
|
313
317
|
StoreType m_pointerStore{};
|
|
@@ -65,7 +65,7 @@ struct ReactContext {
|
|
|
65
65
|
m_handle.EmitJSEvent(eventEmitterName, eventName, MakeJSValueWriter(std::forward<TArgs>(args)...));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
#if !defined(CORE_ABI) && !defined(__APPLE__) && !defined(CXXUNITTESTS)
|
|
68
|
+
#if !defined(CORE_ABI) && !defined(USE_FABRIC) && !defined(__APPLE__) && !defined(CXXUNITTESTS)
|
|
69
69
|
// Dispatch eventName event to the view.
|
|
70
70
|
// args are either function arguments or a single lambda with 'IJSValueWriter const&' argument.
|
|
71
71
|
template <class... TArgs>
|
|
@@ -54,6 +54,18 @@ inline Application TryGetCurrentApplication() noexcept {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// In the legacy architecture, RNW uses a Uwp Xaml app as the groundwork for the UI.
|
|
58
|
+
// In the new architecture, WinUI3 Xaml may be involved, but only as XamlIslands -- leaf nodes in the RNW content.
|
|
59
|
+
// This function returns the Uwp/System Xaml Application if we're running in the legacy architecture and Xaml is
|
|
60
|
+
// running, and null if otherwise.
|
|
61
|
+
inline Application TryGetCurrentUwpXamlApplication() noexcept {
|
|
62
|
+
#ifdef USE_WINUI3
|
|
63
|
+
return nullptr;
|
|
64
|
+
#else
|
|
65
|
+
return TryGetCurrentApplication();
|
|
66
|
+
#endif
|
|
67
|
+
}
|
|
68
|
+
|
|
57
69
|
// Using Windows::UI::ColorHelper causes the process to load Windows.UI.Xaml.dll which is not needed just to fill a
|
|
58
70
|
// Color struct
|
|
59
71
|
inline winrt::Windows::UI::Color FromArgb(uint8_t a, uint8_t r, uint8_t g, uint8_t b) {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.
|
|
13
|
+
<ReactNativeWindowsVersion>0.78.0-preview.2</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
|
-
<ReactNativeWindowsMinor>
|
|
15
|
+
<ReactNativeWindowsMinor>78</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>7d40b7f8f49e828878f3715995fa32237a3505bc</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|