react-native-windows 0.69.4 → 0.70.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flowconfig +5 -1
- package/Chakra/ChakraHelpers.cpp +1 -1
- package/Chakra/ChakraPlatform.cpp +1 -1
- package/Chakra/ChakraValue.cpp +6 -3
- package/Chakra/ChakraValue.h +1 -1
- package/Directory.Build.props +7 -7
- package/Folly/Folly.vcxproj +20 -13
- package/Folly/cgmanifest.json +14 -0
- package/Libraries/Alert/Alert.js +18 -4
- package/Libraries/Alert/Alert.windows.js +4 -0
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +7 -4
- package/Libraries/Animated/AnimatedImplementation.js +17 -3
- package/Libraries/Animated/AnimatedMock.js +7 -2
- package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
- package/Libraries/Animated/NativeAnimatedModule.js +3 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
- package/Libraries/Animated/animations/SpringAnimation.js +3 -3
- package/Libraries/Animated/animations/TimingAnimation.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
- package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
- package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -0
- package/Libraries/AppState/AppState.js +0 -32
- package/Libraries/AppTheme/AppTheme.js +14 -8
- package/Libraries/AppTheme/AppThemeTypes.d.ts +0 -3
- package/Libraries/BatchedBridge/MessageQueue.js +21 -15
- package/Libraries/BatchedBridge/NativeModules.js +3 -4
- package/Libraries/Blob/FileReader.js +0 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.windows.js +0 -20
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +0 -11
- package/Libraries/Components/Pressable/Pressable.js +2 -0
- package/Libraries/Components/Pressable/Pressable.windows.js +2 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
- package/Libraries/Components/SafeAreaView/SafeAreaView.windows.js +4 -30
- package/Libraries/Components/ScrollView/ScrollView.js +13 -11
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
- package/Libraries/Components/StatusBar/StatusBar.js +10 -7
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
- package/Libraries/Components/TextInput/TextInput.js +12 -2
- package/Libraries/Components/TextInput/TextInput.windows.js +12 -2
- package/Libraries/Components/Touchable/PooledClass.js +16 -4
- package/Libraries/Components/Touchable/Touchable.js +50 -1
- package/Libraries/Components/Touchable/Touchable.windows.js +972 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +3 -8
- package/Libraries/Components/View/ViewPropTypes.windows.js +3 -8
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/polyfillPromise.js +0 -32
- package/Libraries/Core/setUpBatchedBridge.js +5 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/Image.android.js +5 -3
- package/Libraries/Image/Image.ios.js +6 -3
- package/Libraries/Image/Image.windows.js +6 -3
- package/Libraries/Image/ImageSource.js +7 -5
- package/Libraries/Inspector/ElementBox.js +2 -2
- package/Libraries/Inspector/NetworkOverlay.js +13 -8
- package/Libraries/Interaction/PanResponder.js +16 -14
- package/Libraries/Linking/Linking.js +0 -11
- package/Libraries/Lists/FlatList.js +3 -2
- package/Libraries/Lists/SectionList.js +2 -0
- package/Libraries/Lists/ViewabilityHelper.js +7 -3
- package/Libraries/Lists/VirtualizeUtils.js +33 -20
- package/Libraries/Lists/VirtualizedList.js +93 -47
- package/Libraries/Lists/VirtualizedListContext.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +14 -9
- package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
- package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +3 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +26 -12
- package/Libraries/Network/XMLHttpRequest.js +9 -11
- package/Libraries/Performance/PureComponentDebug.js +1 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
- package/Libraries/Pressability/Pressability.js +26 -16
- package/Libraries/Pressability/Pressability.windows.js +30 -17
- package/Libraries/Promise.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +16 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
- package/Libraries/ReactNative/PaperUIManager.js +9 -9
- package/Libraries/ReactNative/PaperUIManager.windows.js +7 -8
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
- package/Libraries/Storage/AsyncStorage.js +7 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +2 -0
- package/Libraries/StyleSheet/processTransform.windows.js +2 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
- package/Libraries/Text/Text.js +15 -7
- package/Libraries/Text/Text.windows.js +14 -7
- package/Libraries/Types/CoreEventTypes.js +137 -11
- package/Libraries/Types/CoreEventTypes.windows.js +147 -22
- package/Libraries/Utilities/Dimensions.js +0 -13
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +0 -7
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
- package/Libraries/Utilities/codegenNativeCommands.js +11 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/stringifySafe.js +3 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +105 -12
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
- package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +24 -12
- package/Microsoft.ReactNative/CoreApp.cpp +303 -0
- package/Microsoft.ReactNative/CoreAppPage.cpp +21 -0
- package/Microsoft.ReactNative/CoreAppPage.h +15 -0
- package/Microsoft.ReactNative/CoreAppPage.idl +12 -0
- package/Microsoft.ReactNative/CoreAppPage.xaml +14 -0
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/ActivityIndicatorComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ImageComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ParagraphComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SliderComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/SwitchComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/ViewComponentView.h +1 -1
- package/Microsoft.ReactNative/GlyphViewManager.cpp +1 -0
- package/Microsoft.ReactNative/IReactDispatcher.cpp +18 -0
- package/Microsoft.ReactNative/IReactDispatcher.h +18 -3
- package/Microsoft.ReactNative/IReactDispatcher.idl +15 -0
- package/Microsoft.ReactNative/IReactNotificationService.cpp +197 -70
- package/Microsoft.ReactNative/IReactNotificationService.h +11 -30
- package/Microsoft.ReactNative/IReactPropertyBag.cpp +9 -0
- package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
- package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
- package/Microsoft.ReactNative/JsiApi.cpp +41 -1
- package/Microsoft.ReactNative/JsiApi.h +3 -0
- package/Microsoft.ReactNative/JsiApi.idl +19 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +18 -2
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +7 -7
- package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +15 -12
- package/Microsoft.ReactNative/Modules/AlertModule.h +1 -1
- package/Microsoft.ReactNative/Modules/AppStateModule.cpp +45 -9
- package/Microsoft.ReactNative/Modules/AppStateModule.h +9 -3
- package/Microsoft.ReactNative/Modules/AppThemeModuleUwp.h +1 -1
- package/Microsoft.ReactNative/Modules/ClipboardModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +1 -1
- package/Microsoft.ReactNative/Modules/I18nManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +66 -39
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +41 -11
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.h +1 -1
- package/Microsoft.ReactNative/QuirkSettings.cpp +22 -0
- package/Microsoft.ReactNative/QuirkSettings.h +10 -0
- package/Microsoft.ReactNative/QuirkSettings.idl +7 -0
- package/Microsoft.ReactNative/ReactApplication.cpp +44 -0
- package/Microsoft.ReactNative/ReactApplication.h +40 -5
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.cpp +5 -2
- package/Microsoft.ReactNative/ReactHost/JSCallInvokerScheduler.h +1 -0
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +23 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -0
- package/Microsoft.ReactNative/Utils/Helpers.cpp +1 -1
- package/Microsoft.ReactNative/Utils/Helpers.h +1 -1
- package/Microsoft.ReactNative/Utils/PropertyUtils.h +1 -1
- package/Microsoft.ReactNative/Utils/TransformableText.h +1 -1
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +12 -8
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +9 -7
- package/Microsoft.ReactNative/Views/DynamicAutomationProperties.cpp +3 -3
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +13 -1
- package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +1 -1
- package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +63 -13
- package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +2 -2
- package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +5 -6
- package/Microsoft.ReactNative/Views/Image/ReactImage.h +4 -4
- package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +1 -1
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +21 -2
- package/Microsoft.ReactNative/Views/TextViewManager.cpp +6 -3
- package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +1 -1
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +7 -1
- package/Microsoft.ReactNative/Views/ViewPanel.cpp +4 -0
- package/Microsoft.ReactNative/Views/ViewViewManager.cpp +8 -3
- package/Microsoft.ReactNative/Views/cppwinrt/DynamicAutomationPeer.idl +2 -0
- package/Microsoft.ReactNative/microsoft.reactnative.def +4 -1
- package/Microsoft.ReactNative.Cxx/AppModelHelpers.h +17 -0
- package/Microsoft.ReactNative.Cxx/CoreApp.h +60 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.cpp +65 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiAbiApi.h +13 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.cpp +53 -0
- package/Microsoft.ReactNative.Cxx/JSI/JsiValueHelpers.h +32 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +7 -0
- package/Microsoft.ReactNative.Managed/packages.lock.json +1 -24
- package/Mso/dispatchQueue/dispatchQueue.h +12 -4
- package/Mso/src/dispatchQueue/looperScheduler.cpp +36 -9
- package/Mso/src/dispatchQueue/queueService.cpp +2 -2
- package/Mso/src/dispatchQueue/queueService.h +2 -2
- package/Mso/src/memoryApi/memoryApi.cpp +3 -0
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/PropertySheets/JSEngine.props +1 -1
- package/PropertySheets/Release.props +6 -0
- package/ReactCommon/ReactCommon.vcxproj +11 -21
- package/ReactCommon/ReactCommon.vcxproj.filters +64 -46
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +145 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +344 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/BaseTextProps.cpp +313 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/ViewProps.cpp +455 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/ConcreteComponentDescriptor.h +216 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/PropsMacros.h +91 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/graphics/RectangleEdges.h +100 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/CompactValue.h +3 -1
- package/Scripts/Microsoft.ReactNative.nuspec +6 -0
- package/Scripts/Microsoft.ReactNative.targets +7 -0
- package/Shared/DevSettings.h +4 -0
- package/Shared/JSI/ChakraRuntime.cpp +11 -2
- package/Shared/JSI/ChakraRuntime.h +2 -0
- package/Shared/Modules/BlobModule.cpp +4 -4
- package/Shared/Modules/BlobModule.h +1 -1
- package/Shared/Modules/FileReaderModule.cpp +3 -2
- package/Shared/Modules/IBlobPersistor.h +1 -1
- package/Shared/Networking/IHttpResource.h +1 -0
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +16 -10
- package/Shared/Networking/WinRTHttpResource.cpp +34 -2
- package/Shared/OInstance.cpp +14 -6
- package/Shared/Threading/BatchingQueueThread.cpp +23 -12
- package/Shared/Utils.cpp +2 -5
- package/codegen/NativeAlertManagerSpec.g.h +2 -0
- package/codegen/NativeAnimatedModuleSpec.g.h +6 -0
- package/codegen/NativeAnimatedTurboModuleSpec.g.h +6 -0
- package/codegen/react/components/rnwcore/Props.cpp +2 -2
- package/codegen/react/components/rnwcore/Props.h +1 -1
- package/fmt/cgmanifest.json +14 -0
- package/fmt/fmt.vcxproj +25 -11
- package/jest/assetFileTransformer.js +3 -2
- package/jest/setup.js +4 -0
- package/package.json +27 -28
- package/rntypes/index.d.ts +0 -1
- package/template/cs-app-WinAppSDK/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/metro.devMode.config.js +49 -2
- package/template/shared-app/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/template/shared-lib/proj/{NuGet.Config → NuGet_Config} +0 -0
- package/Libraries/vendor/emitter/EventSubscription.js +0 -19
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +0 -87
- package/Scripts/copyRNLibraries.js +0 -99
- package/jest/preprocessor.js +0 -40
- package/jest/preprocessor_DO_NOT_USE.js +0 -122
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#include "pch.h"
|
|
4
|
+
#include "CoreApp.h"
|
|
5
|
+
#include <winrt/Microsoft.ReactNative.h>
|
|
6
|
+
#include <winrt/Microsoft.UI.Xaml.Controls.h>
|
|
7
|
+
#include <winrt/Windows.ApplicationModel.Activation.h>
|
|
8
|
+
#include <winrt/Windows.Data.Json.h>
|
|
9
|
+
#include <winrt/Windows.UI.ViewManagement.h>
|
|
10
|
+
#include <winrt/Windows.UI.Xaml.Interop.h>
|
|
11
|
+
#include <fstream>
|
|
12
|
+
#include <string_view>
|
|
13
|
+
#include "ReactApplication.h"
|
|
14
|
+
#include "UI.Xaml.Controls.h"
|
|
15
|
+
|
|
16
|
+
namespace react = winrt::Microsoft::ReactNative;
|
|
17
|
+
using namespace winrt::Windows::Data::Json;
|
|
18
|
+
using namespace std::literals;
|
|
19
|
+
|
|
20
|
+
void RNCoreAppSetDefaults(RNCoreApp *appSettings) {
|
|
21
|
+
/// Set default values
|
|
22
|
+
appSettings->jsBundleFile = L"index.windows";
|
|
23
|
+
appSettings->bundleRootPath = L"ms-appx:///Bundle/";
|
|
24
|
+
appSettings->componentName = L"";
|
|
25
|
+
appSettings->useWebDebugger = true;
|
|
26
|
+
appSettings->useFastRefresh = true;
|
|
27
|
+
appSettings->useDeveloperSupport = true;
|
|
28
|
+
appSettings->useDirectDebugger = false;
|
|
29
|
+
appSettings->enableDefaultCrashHandler = false;
|
|
30
|
+
appSettings->debuggerPort = 9229;
|
|
31
|
+
appSettings->sourceBundlePort = 8081;
|
|
32
|
+
appSettings->sourceBundleHost = L"localhost";
|
|
33
|
+
appSettings->requestInlineSourceMap = true;
|
|
34
|
+
appSettings->jsEngine = L"chakra";
|
|
35
|
+
appSettings->viewName = nullptr;
|
|
36
|
+
|
|
37
|
+
appSettings->resourcesAbi = nullptr;
|
|
38
|
+
appSettings->args = nullptr;
|
|
39
|
+
appSettings->packageProvidersAbi = nullptr;
|
|
40
|
+
appSettings->packageProvidersAbiCount = 0;
|
|
41
|
+
appSettings->propertiesAbi = nullptr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
NORETURN void RNCoreAppStartInternal(RNCoreApp *appSettings, RNCoreAppCallback launched, void *data) {
|
|
45
|
+
xaml::Application::Start([appSettings, launched, data](auto &&) {
|
|
46
|
+
winrt::Windows::Foundation::IInspectable outer{nullptr};
|
|
47
|
+
const auto app = winrt::make<react::implementation::ReactApplication>(outer);
|
|
48
|
+
|
|
49
|
+
const auto implApp = winrt::get_self<react::implementation::ReactApplication>(app);
|
|
50
|
+
|
|
51
|
+
implApp->LaunchedInternal([appSettings, launched, data](
|
|
52
|
+
react::ReactApplication const &app,
|
|
53
|
+
winrt::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const &args) {
|
|
54
|
+
appSettings->args = args.Arguments().c_str();
|
|
55
|
+
if (launched) {
|
|
56
|
+
launched(appSettings, data);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
for (auto i = 0; i < appSettings->packageProvidersAbiCount; i++) {
|
|
60
|
+
auto provider = winrt::Microsoft::ReactNative::IReactPackageProvider(
|
|
61
|
+
appSettings->packageProvidersAbi[i], winrt::take_ownership_from_abi);
|
|
62
|
+
app.PackageProviders().Append(provider);
|
|
63
|
+
}
|
|
64
|
+
CoTaskMemFree(appSettings->packageProvidersAbi);
|
|
65
|
+
|
|
66
|
+
if (appSettings->viewName) {
|
|
67
|
+
auto view = winrt::Windows::UI::ViewManagement::ApplicationView::GetForCurrentView();
|
|
68
|
+
view.Title(appSettings->viewName);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
app.JavaScriptBundleFile(appSettings->jsBundleFile);
|
|
72
|
+
|
|
73
|
+
auto settings = app.InstanceSettings();
|
|
74
|
+
constexpr std::pair<std::wstring_view, react::JSIEngine> engines[] = {
|
|
75
|
+
{L"chakra"sv, react::JSIEngine::Chakra},
|
|
76
|
+
{L"hermes"sv, react::JSIEngine::Hermes},
|
|
77
|
+
{L"v8"sv, react::JSIEngine::V8}};
|
|
78
|
+
|
|
79
|
+
if (auto it = std::find_if(std::begin(engines), std::end(engines), [appSettings](const auto &c) {
|
|
80
|
+
return c.first == appSettings->jsEngine;
|
|
81
|
+
})) {
|
|
82
|
+
settings.JSIEngineOverride(it->second);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
settings.BundleRootPath(appSettings->bundleRootPath);
|
|
86
|
+
|
|
87
|
+
settings.UseWebDebugger(appSettings->useWebDebugger);
|
|
88
|
+
settings.UseFastRefresh(appSettings->useFastRefresh);
|
|
89
|
+
settings.UseDeveloperSupport(appSettings->useDeveloperSupport);
|
|
90
|
+
settings.UseDirectDebugger(appSettings->useDirectDebugger);
|
|
91
|
+
settings.RequestInlineSourceMap(appSettings->requestInlineSourceMap);
|
|
92
|
+
|
|
93
|
+
settings.EnableDefaultCrashHandler(appSettings->enableDefaultCrashHandler);
|
|
94
|
+
settings.DebuggerPort(appSettings->debuggerPort);
|
|
95
|
+
settings.SourceBundlePort(appSettings->sourceBundlePort);
|
|
96
|
+
settings.SourceBundleHost(appSettings->sourceBundleHost);
|
|
97
|
+
|
|
98
|
+
if (appSettings->propertiesAbi) {
|
|
99
|
+
if (auto props = react::IReactPropertyBag(appSettings->propertiesAbi, winrt::take_ownership_from_abi)) {
|
|
100
|
+
settings.Properties().CopyFrom(props);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (auto res = xaml::ResourceDictionary(appSettings->resourcesAbi, winrt::take_ownership_from_abi)) {
|
|
105
|
+
app.Resources(res);
|
|
106
|
+
} else {
|
|
107
|
+
try {
|
|
108
|
+
auto xcr = winrt::Microsoft::UI::Xaml::Controls::XamlControlsResources();
|
|
109
|
+
app.Resources(xcr);
|
|
110
|
+
} catch (...) {
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
implApp->ViewCreatedInternal([](react::ReactApplication const &app, winrt::hstring const &args) {
|
|
115
|
+
auto rootFrame = xaml::Window::Current().Content().as<xaml::Controls::Frame>();
|
|
116
|
+
rootFrame.Navigate(winrt::xaml_typename<react::CoreAppPage>(), winrt::box_value(args));
|
|
117
|
+
});
|
|
118
|
+
implApp->PageNavigatedInternal(
|
|
119
|
+
[appSettings](react::ReactApplication const & /*appSettings*/, react::ReactRootView const &view) {
|
|
120
|
+
view.ComponentName(appSettings->componentName);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
void SetFromJson(JsonObject json, wchar_t const *key, wchar_t const *&appValue) {
|
|
126
|
+
if (auto v = json.TryLookup(key); v && v.ValueType() == JsonValueType::String) {
|
|
127
|
+
appValue = _wcsdup(v.GetString().c_str());
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
void SetFromJson(JsonObject json, wchar_t const *key, bool &appValue) {
|
|
132
|
+
if (auto v = json.TryLookup(key); v && v.ValueType() == JsonValueType::Boolean) {
|
|
133
|
+
appValue = v.GetBoolean();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
template <typename T>
|
|
138
|
+
std::enable_if_t<std::is_arithmetic_v<T>> SetFromJson(JsonObject json, wchar_t const *key, T &appValue) {
|
|
139
|
+
if (auto v = json.TryLookup(key); v && v.ValueType() == JsonValueType::Number) {
|
|
140
|
+
appValue = static_cast<T>(v.GetNumber());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#define SET_FROM_JSON(key) SetFromJson(json, L#key, appSettings->key)
|
|
145
|
+
|
|
146
|
+
JsonObject LoadJsonFromFile(wchar_t const *jsoncPath) {
|
|
147
|
+
std::wifstream appConfigJson(jsoncPath);
|
|
148
|
+
winrt::check_bool(appConfigJson.good());
|
|
149
|
+
std::wostringstream out;
|
|
150
|
+
out << appConfigJson.rdbuf();
|
|
151
|
+
auto input = out.str();
|
|
152
|
+
|
|
153
|
+
// strip comments from jsonc since WinRT's JsonObject doesn't support them
|
|
154
|
+
// see
|
|
155
|
+
// https://github.com/microsoft/vscode/blob/432349e1eb4a90eccd1039c61f719e6f54c77607/src/vs/base/common/stripComments.js
|
|
156
|
+
auto comments = std::wregex(
|
|
157
|
+
LR"(("[^"\\]*(?:\\.[^"\\]*)*")|('[^'\\]*(?:\\.[^'\\]*)*')|(\/\*[^\/\*]*(?:(?:\*|\/)[^\/\*]*)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$)))");
|
|
158
|
+
std::wstring stripped;
|
|
159
|
+
std::size_t previous = 0;
|
|
160
|
+
for (auto it = std::wsregex_iterator(input.begin(), input.end(), comments); it != std::wsregex_iterator(); ++it) {
|
|
161
|
+
auto match = *it;
|
|
162
|
+
stripped += input.substr(previous, match.position() - previous);
|
|
163
|
+
if (match[3].matched) {
|
|
164
|
+
// do nothing
|
|
165
|
+
} else if (match[4].matched) {
|
|
166
|
+
if (*(match[4].second - 1) == L'\n') {
|
|
167
|
+
stripped += *(match[4].second - 2) == L'\r' ? L"\r\n" : L"\n";
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
stripped += match.str();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
previous = match.position() + match.length();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
stripped += input.substr(previous);
|
|
177
|
+
|
|
178
|
+
auto json = JsonObject::Parse(stripped);
|
|
179
|
+
return json;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
static void SetPackageProviders(JsonObject const &json, RNCoreApp *app) {
|
|
183
|
+
if (auto v = json.TryLookup(L"nativeModules"); v && v.ValueType() == JsonValueType::Array) {
|
|
184
|
+
auto nativeModules = v.GetArray();
|
|
185
|
+
decltype(app->packageProvidersAbiCount) countAdded = 0;
|
|
186
|
+
const auto count = static_cast<decltype(countAdded)>(nativeModules.Size());
|
|
187
|
+
|
|
188
|
+
app->packageProvidersAbi = reinterpret_cast<void **>(CoTaskMemAlloc(sizeof(void *) * count));
|
|
189
|
+
for (std::remove_const_t<decltype(count)> index = 0; index < count; index++) {
|
|
190
|
+
if (auto nm_value = nativeModules.GetAt(index); nm_value.ValueType() == JsonValueType::Object) {
|
|
191
|
+
auto nm = nm_value.GetObject();
|
|
192
|
+
|
|
193
|
+
wchar_t const *container{nullptr};
|
|
194
|
+
SetFromJson(nm, L"moduleContainer", container);
|
|
195
|
+
|
|
196
|
+
wchar_t const *factoryName{nullptr};
|
|
197
|
+
SetFromJson(nm, L"factory", factoryName);
|
|
198
|
+
|
|
199
|
+
HMODULE mod{};
|
|
200
|
+
if (container != nullptr) {
|
|
201
|
+
mod = reinterpret_cast<HMODULE>(WINRT_IMPL_LoadLibraryW(container));
|
|
202
|
+
} else {
|
|
203
|
+
mod = GetModuleHandle(nullptr);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (mod) {
|
|
207
|
+
if (auto factory = reinterpret_cast<void *(__cdecl *)()>(
|
|
208
|
+
WINRT_IMPL_GetProcAddress(mod, winrt::to_string(factoryName).c_str()))) {
|
|
209
|
+
auto packageProviderAbi = factory();
|
|
210
|
+
app->packageProvidersAbi[countAdded++] = packageProviderAbi;
|
|
211
|
+
} else {
|
|
212
|
+
assert(false && "Could not find native module factory function");
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
assert(false && "Could not find native module library");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
app->packageProvidersAbiCount = countAdded;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static void SetProperties(JsonObject const &json, RNCoreApp *app) {
|
|
224
|
+
react::IReactPropertyBag bag{nullptr};
|
|
225
|
+
if (auto v = json.TryLookup(L"properties"); v && v.ValueType() == JsonValueType::Object) {
|
|
226
|
+
auto props = v.GetObject();
|
|
227
|
+
bag = react::ReactPropertyBagHelper::CreatePropertyBag();
|
|
228
|
+
for (const auto &prop : props) {
|
|
229
|
+
auto name = prop.Key();
|
|
230
|
+
auto lastDot = std::find(name.rbegin(), name.rend(), L'.');
|
|
231
|
+
std::wstring nsName;
|
|
232
|
+
std::wstring localName;
|
|
233
|
+
if (lastDot != name.rend()) {
|
|
234
|
+
nsName = std::wstring{name.begin(), static_cast<uint64_t>(name.rend() - lastDot - 1)};
|
|
235
|
+
localName = std::wstring{lastDot.base()};
|
|
236
|
+
} else {
|
|
237
|
+
localName = name;
|
|
238
|
+
}
|
|
239
|
+
winrt::hstring nsNameH(nsName);
|
|
240
|
+
winrt::hstring localNameH(localName);
|
|
241
|
+
auto propName = react::ReactPropertyName{nsNameH, localNameH};
|
|
242
|
+
auto value = prop.Value();
|
|
243
|
+
switch (value.ValueType()) {
|
|
244
|
+
case JsonValueType::String:
|
|
245
|
+
bag.Set(propName.Handle(), winrt::box_value(value.GetString()));
|
|
246
|
+
break;
|
|
247
|
+
case JsonValueType::Boolean:
|
|
248
|
+
bag.Set(propName.Handle(), winrt::box_value(value.GetBoolean()));
|
|
249
|
+
break;
|
|
250
|
+
case JsonValueType::Number:
|
|
251
|
+
bag.Set(propName.Handle(), winrt::box_value(value.GetNumber()));
|
|
252
|
+
break;
|
|
253
|
+
case JsonValueType::Null:
|
|
254
|
+
bag.Set(propName.Handle(), nullptr);
|
|
255
|
+
break;
|
|
256
|
+
default:
|
|
257
|
+
assert(false && "not yet implemented");
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (bag) {
|
|
264
|
+
winrt::copy_to_abi(bag, app->propertiesAbi);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
extern "C" NORETURN void __cdecl RNCoreAppStartFromConfigJson(
|
|
269
|
+
wchar_t const *configJson,
|
|
270
|
+
RNCoreAppCallback launched,
|
|
271
|
+
void *data) {
|
|
272
|
+
auto appSettings = std::make_shared<RNCoreApp>();
|
|
273
|
+
RNCoreAppSetDefaults(appSettings.get());
|
|
274
|
+
|
|
275
|
+
auto json = LoadJsonFromFile(configJson);
|
|
276
|
+
SET_FROM_JSON(jsBundleFile);
|
|
277
|
+
SET_FROM_JSON(bundleRootPath);
|
|
278
|
+
SET_FROM_JSON(componentName);
|
|
279
|
+
SET_FROM_JSON(useWebDebugger);
|
|
280
|
+
SET_FROM_JSON(useFastRefresh);
|
|
281
|
+
SET_FROM_JSON(useDeveloperSupport);
|
|
282
|
+
SET_FROM_JSON(useDirectDebugger);
|
|
283
|
+
SET_FROM_JSON(requestInlineSourceMap);
|
|
284
|
+
|
|
285
|
+
SET_FROM_JSON(enableDefaultCrashHandler);
|
|
286
|
+
SET_FROM_JSON(debuggerPort);
|
|
287
|
+
SET_FROM_JSON(sourceBundlePort);
|
|
288
|
+
SET_FROM_JSON(sourceBundleHost);
|
|
289
|
+
SET_FROM_JSON(jsEngine);
|
|
290
|
+
|
|
291
|
+
SET_FROM_JSON(viewName);
|
|
292
|
+
|
|
293
|
+
SetPackageProviders(json, appSettings.get());
|
|
294
|
+
SetProperties(json, appSettings.get());
|
|
295
|
+
RNCoreAppStartInternal(appSettings.get(), launched, data);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
extern "C" NORETURN void __cdecl RNCoreAppStart(RNCoreAppCallback launched, void *data) {
|
|
299
|
+
auto appSettings = std::make_shared<RNCoreApp>();
|
|
300
|
+
|
|
301
|
+
RNCoreAppSetDefaults(appSettings.get());
|
|
302
|
+
RNCoreAppStartInternal(appSettings.get(), launched, data);
|
|
303
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#include "pch.h"
|
|
4
|
+
#include "CoreAppPage.h"
|
|
5
|
+
#include "ReactApplication.h"
|
|
6
|
+
|
|
7
|
+
#if __has_include("CoreAppPage.g.cpp")
|
|
8
|
+
#include "CoreAppPage.g.cpp"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
12
|
+
CoreAppPage::CoreAppPage() {
|
|
13
|
+
InitializeComponent();
|
|
14
|
+
auto app = xaml::Application::Current().as<winrt::Microsoft::ReactNative::ReactApplication>();
|
|
15
|
+
auto implApp = winrt::get_self<winrt::Microsoft::ReactNative::implementation::ReactApplication>(app);
|
|
16
|
+
auto pageNavigated = implApp->PageNavigatedInternal();
|
|
17
|
+
pageNavigated(app, ReactRootView());
|
|
18
|
+
ReactRootView().ReactNativeHost(app.Host());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#pragma once
|
|
4
|
+
#include "CoreAppPage.g.h"
|
|
5
|
+
#include <UI.Xaml.Markup.h>
|
|
6
|
+
|
|
7
|
+
namespace winrt::Microsoft::ReactNative::implementation {
|
|
8
|
+
struct CoreAppPage : CoreAppPageT<CoreAppPage> {
|
|
9
|
+
CoreAppPage();
|
|
10
|
+
};
|
|
11
|
+
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
12
|
+
|
|
13
|
+
namespace winrt::Microsoft::ReactNative::factory_implementation {
|
|
14
|
+
struct CoreAppPage : CoreAppPageT<CoreAppPage, implementation::CoreAppPage> {};
|
|
15
|
+
} // namespace winrt::Microsoft::ReactNative::factory_implementation
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#include "NamespaceRedirect.h"
|
|
4
|
+
|
|
5
|
+
namespace Microsoft.ReactNative
|
|
6
|
+
{
|
|
7
|
+
[default_interface]
|
|
8
|
+
runtimeclass CoreAppPage : XAML_NAMESPACE.Controls.Page
|
|
9
|
+
{
|
|
10
|
+
CoreAppPage();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<Page
|
|
2
|
+
x:Class="Microsoft.ReactNative.CoreAppPage"
|
|
3
|
+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
4
|
+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
5
|
+
xmlns:react="using:Microsoft.ReactNative"
|
|
6
|
+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
7
|
+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
8
|
+
mc:Ignorable="d">
|
|
9
|
+
|
|
10
|
+
<react:ReactRootView
|
|
11
|
+
x:Name="ReactRootView"
|
|
12
|
+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
|
13
|
+
MinHeight="400"/>
|
|
14
|
+
</Page>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
// Copyright (c) Microsoft Corporation.
|
|
3
2
|
// Licensed under the MIT License.
|
|
4
3
|
|
|
@@ -70,7 +69,7 @@ void ActivityIndicatorComponentView::updateLayoutMetrics(
|
|
|
70
69
|
}
|
|
71
70
|
void ActivityIndicatorComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {}
|
|
72
71
|
void ActivityIndicatorComponentView::prepareForRecycle() noexcept {}
|
|
73
|
-
facebook::react::
|
|
72
|
+
facebook::react::Props::Shared ActivityIndicatorComponentView::props() noexcept {
|
|
74
73
|
assert(false);
|
|
75
74
|
return {};
|
|
76
75
|
}
|
|
@@ -33,7 +33,7 @@ struct ActivityIndicatorComponentView : BaseComponentView {
|
|
|
33
33
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
34
34
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
35
35
|
void prepareForRecycle() noexcept override;
|
|
36
|
-
facebook::react::
|
|
36
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
37
37
|
|
|
38
38
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
39
39
|
|
|
@@ -38,7 +38,7 @@ struct IComponentView {
|
|
|
38
38
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept = 0;
|
|
39
39
|
virtual void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept = 0;
|
|
40
40
|
virtual void prepareForRecycle() noexcept = 0;
|
|
41
|
-
virtual facebook::react::
|
|
41
|
+
virtual facebook::react::Props::Shared props() noexcept = 0;
|
|
42
42
|
virtual void handleCommand(std::string const &commandName, folly::dynamic const &arg) noexcept = 0;
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -126,7 +126,7 @@ void ImageComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) n
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
void ImageComponentView::prepareForRecycle() noexcept {}
|
|
129
|
-
facebook::react::
|
|
129
|
+
facebook::react::Props::Shared ImageComponentView::props() noexcept {
|
|
130
130
|
assert(false);
|
|
131
131
|
return {};
|
|
132
132
|
}
|
|
@@ -33,7 +33,7 @@ struct ImageComponentView : BaseComponentView {
|
|
|
33
33
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
34
34
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
35
35
|
void prepareForRecycle() noexcept override;
|
|
36
|
-
facebook::react::
|
|
36
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
37
37
|
|
|
38
38
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
39
39
|
|
|
@@ -148,7 +148,7 @@ void ParagraphComponentView::updateLayoutMetrics(
|
|
|
148
148
|
}
|
|
149
149
|
void ParagraphComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {}
|
|
150
150
|
void ParagraphComponentView::prepareForRecycle() noexcept {}
|
|
151
|
-
facebook::react::
|
|
151
|
+
facebook::react::Props::Shared ParagraphComponentView::props() noexcept {
|
|
152
152
|
assert(false);
|
|
153
153
|
return {};
|
|
154
154
|
}
|
|
@@ -27,7 +27,7 @@ struct ParagraphComponentView : BaseComponentView {
|
|
|
27
27
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
28
28
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
29
29
|
void prepareForRecycle() noexcept override;
|
|
30
|
-
facebook::react::
|
|
30
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
31
31
|
|
|
32
32
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
33
33
|
|
|
@@ -188,7 +188,7 @@ void ScrollViewComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMa
|
|
|
188
188
|
// m_element.FinalizeProperties();
|
|
189
189
|
}
|
|
190
190
|
void ScrollViewComponentView::prepareForRecycle() noexcept {}
|
|
191
|
-
facebook::react::
|
|
191
|
+
facebook::react::Props::Shared ScrollViewComponentView::props() noexcept {
|
|
192
192
|
assert(false);
|
|
193
193
|
return {};
|
|
194
194
|
}
|
|
@@ -32,7 +32,7 @@ struct ScrollViewComponentView : BaseComponentView {
|
|
|
32
32
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
33
33
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
34
34
|
void prepareForRecycle() noexcept override;
|
|
35
|
-
facebook::react::
|
|
35
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
36
36
|
|
|
37
37
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
38
38
|
|
|
@@ -95,7 +95,7 @@ void SliderComponentView::updateLayoutMetrics(
|
|
|
95
95
|
void SliderComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {}
|
|
96
96
|
|
|
97
97
|
void SliderComponentView::prepareForRecycle() noexcept {}
|
|
98
|
-
facebook::react::
|
|
98
|
+
facebook::react::Props::Shared SliderComponentView::props() noexcept {
|
|
99
99
|
assert(false);
|
|
100
100
|
return {};
|
|
101
101
|
}
|
|
@@ -35,7 +35,7 @@ struct SliderComponentView : BaseComponentView {
|
|
|
35
35
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
36
36
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
37
37
|
void prepareForRecycle() noexcept override;
|
|
38
|
-
facebook::react::
|
|
38
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
39
39
|
|
|
40
40
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
41
41
|
|
|
@@ -97,7 +97,7 @@ void SwitchComponentView::updateLayoutMetrics(
|
|
|
97
97
|
void SwitchComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept {}
|
|
98
98
|
|
|
99
99
|
void SwitchComponentView::prepareForRecycle() noexcept {}
|
|
100
|
-
facebook::react::
|
|
100
|
+
facebook::react::Props::Shared SwitchComponentView::props() noexcept {
|
|
101
101
|
assert(false);
|
|
102
102
|
return {};
|
|
103
103
|
}
|
|
@@ -35,7 +35,7 @@ struct SwitchComponentView : BaseComponentView {
|
|
|
35
35
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
36
36
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
37
37
|
void prepareForRecycle() noexcept override;
|
|
38
|
-
facebook::react::
|
|
38
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
39
39
|
void handleCommand(std::string const &commandName, folly::dynamic const &arg) noexcept override;
|
|
40
40
|
|
|
41
41
|
const xaml::FrameworkElement Element() const noexcept override;
|
|
@@ -86,7 +86,7 @@ void TextComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) no
|
|
|
86
86
|
// m_element.FinalizeProperties();
|
|
87
87
|
}
|
|
88
88
|
void TextComponentView::prepareForRecycle() noexcept {}
|
|
89
|
-
facebook::react::
|
|
89
|
+
facebook::react::Props::Shared TextComponentView::props() noexcept {
|
|
90
90
|
assert(false);
|
|
91
91
|
return {};
|
|
92
92
|
}
|
|
@@ -27,7 +27,7 @@ struct TextComponentView : BaseComponentView {
|
|
|
27
27
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
28
28
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
29
29
|
void prepareForRecycle() noexcept override;
|
|
30
|
-
facebook::react::
|
|
30
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
31
31
|
|
|
32
32
|
virtual const xaml::FrameworkElement Element() const noexcept override;
|
|
33
33
|
|
|
@@ -296,7 +296,7 @@ void WindowsTextInputComponentView::finalizeUpdates(RNComponentViewUpdateMask up
|
|
|
296
296
|
// m_element.FinalizeProperties();
|
|
297
297
|
}
|
|
298
298
|
void WindowsTextInputComponentView::prepareForRecycle() noexcept {}
|
|
299
|
-
facebook::react::
|
|
299
|
+
facebook::react::Props::Shared WindowsTextInputComponentView::props() noexcept {
|
|
300
300
|
assert(false);
|
|
301
301
|
return {};
|
|
302
302
|
}
|
|
@@ -28,7 +28,7 @@ struct WindowsTextInputComponentView : BaseComponentView {
|
|
|
28
28
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
29
29
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
30
30
|
void prepareForRecycle() noexcept override;
|
|
31
|
-
facebook::react::
|
|
31
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
32
32
|
void handleCommand(std::string const &commandName, folly::dynamic const &arg) noexcept override;
|
|
33
33
|
|
|
34
34
|
virtual const xaml::FrameworkElement Element() const noexcept override;
|
|
@@ -209,7 +209,7 @@ void ViewComponentView::finalizeUpdates(RNComponentViewUpdateMask updateMask) no
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
void ViewComponentView::prepareForRecycle() noexcept {}
|
|
212
|
-
facebook::react::
|
|
212
|
+
facebook::react::Props::Shared ViewComponentView::props() noexcept {
|
|
213
213
|
assert(false);
|
|
214
214
|
return {};
|
|
215
215
|
}
|
|
@@ -36,7 +36,7 @@ struct ViewComponentView : BaseComponentView {
|
|
|
36
36
|
facebook::react::LayoutMetrics const &oldLayoutMetrics) noexcept override;
|
|
37
37
|
void finalizeUpdates(RNComponentViewUpdateMask updateMask) noexcept override;
|
|
38
38
|
void prepareForRecycle() noexcept override;
|
|
39
|
-
facebook::react::
|
|
39
|
+
facebook::react::Props::Shared props() noexcept override;
|
|
40
40
|
|
|
41
41
|
virtual const xaml::FrameworkElement Element() const noexcept;
|
|
42
42
|
|
|
@@ -124,4 +124,22 @@ void ReactDispatcher::InvokeElsePost(Mso::DispatchTask &&task) const noexcept {
|
|
|
124
124
|
return jsThreadDispatcherProperty;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/*static*/ IReactPropertyName ReactDispatcher::JSDispatcherTaskStartingEventName() noexcept {
|
|
128
|
+
static IReactPropertyName jsThreadDispatcherProperty{ReactPropertyBagHelper::GetName(
|
|
129
|
+
ReactPropertyBagHelper::GetNamespace(L"ReactNative.Dispatcher"), L"JSDispatcherTaskStartingEventName")};
|
|
130
|
+
return jsThreadDispatcherProperty;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/*static*/ IReactPropertyName ReactDispatcher::JSDispatcherIdleWaitStartingEventName() noexcept {
|
|
134
|
+
static IReactPropertyName jsThreadDispatcherProperty{ReactPropertyBagHelper::GetName(
|
|
135
|
+
ReactPropertyBagHelper::GetNamespace(L"ReactNative.Dispatcher"), L"JSDispatcherIdleWaitStartingEventName")};
|
|
136
|
+
return jsThreadDispatcherProperty;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/*static*/ IReactPropertyName ReactDispatcher::JSDispatcherIdleWaitCompletedEventName() noexcept {
|
|
140
|
+
static IReactPropertyName jsThreadDispatcherProperty{ReactPropertyBagHelper::GetName(
|
|
141
|
+
ReactPropertyBagHelper::GetNamespace(L"ReactNative.Dispatcher"), L"JSDispatcherIdleWaitCompletedEventName")};
|
|
142
|
+
return jsThreadDispatcherProperty;
|
|
143
|
+
}
|
|
144
|
+
|
|
127
145
|
} // namespace winrt::Microsoft::ReactNative::implementation
|
|
@@ -31,16 +31,19 @@ struct ReactDispatcher : implements<ReactDispatcher, IReactDispatcher, Mso::Reac
|
|
|
31
31
|
|
|
32
32
|
static IReactDispatcher CreateSerialDispatcher() noexcept;
|
|
33
33
|
|
|
34
|
-
static Mso::CntPtr<IDispatchQueue2> GetUIDispatchQueue2(IReactPropertyBag const &properties) noexcept;
|
|
34
|
+
static Mso::CntPtr<Mso::React::IDispatchQueue2> GetUIDispatchQueue2(IReactPropertyBag const &properties) noexcept;
|
|
35
35
|
static IReactDispatcher UIThreadDispatcher() noexcept;
|
|
36
36
|
static IReactPropertyName UIDispatcherProperty() noexcept;
|
|
37
37
|
static IReactDispatcher GetUIDispatcher(IReactPropertyBag const &properties) noexcept;
|
|
38
38
|
static void SetUIThreadDispatcher(IReactPropertyBag const &properties) noexcept;
|
|
39
39
|
|
|
40
40
|
static IReactPropertyName JSDispatcherProperty() noexcept;
|
|
41
|
+
static IReactPropertyName JSDispatcherTaskStartingEventName() noexcept;
|
|
42
|
+
static IReactPropertyName JSDispatcherIdleWaitStartingEventName() noexcept;
|
|
43
|
+
static IReactPropertyName JSDispatcherIdleWaitCompletedEventName() noexcept;
|
|
41
44
|
|
|
42
|
-
void Post(Mso::DispatchTask &&task) const noexcept
|
|
43
|
-
void InvokeElsePost(Mso::DispatchTask &&task) const noexcept
|
|
45
|
+
void Post(Mso::DispatchTask &&task) const noexcept;
|
|
46
|
+
void InvokeElsePost(Mso::DispatchTask &&task) const noexcept;
|
|
44
47
|
|
|
45
48
|
private:
|
|
46
49
|
Mso::DispatchQueue m_queue;
|
|
@@ -64,6 +67,18 @@ struct ReactDispatcherHelper {
|
|
|
64
67
|
static IReactPropertyName JSDispatcherProperty() noexcept {
|
|
65
68
|
return ReactDispatcher::JSDispatcherProperty();
|
|
66
69
|
}
|
|
70
|
+
|
|
71
|
+
static IReactPropertyName JSDispatcherTaskStartingEventName() noexcept {
|
|
72
|
+
return ReactDispatcher::JSDispatcherTaskStartingEventName();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static IReactPropertyName JSDispatcherIdleWaitStartingEventName() noexcept {
|
|
76
|
+
return ReactDispatcher::JSDispatcherIdleWaitStartingEventName();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static IReactPropertyName JSDispatcherIdleWaitCompletedEventName() noexcept {
|
|
80
|
+
return ReactDispatcher::JSDispatcherIdleWaitCompletedEventName();
|
|
81
|
+
}
|
|
67
82
|
};
|
|
68
83
|
|
|
69
84
|
} // namespace winrt::Microsoft::ReactNative::implementation
|