react-native-windows 0.69.6 → 0.70.0
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 +1 -1
- 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/IReactPropertyBag.cpp +9 -0
- package/Microsoft.ReactNative/IReactPropertyBag.h +3 -0
- package/Microsoft.ReactNative/IReactPropertyBag.idl +3 -0
- package/Microsoft.ReactNative/JSDispatcherWriter.cpp +60 -22
- package/Microsoft.ReactNative/JSDispatcherWriter.h +5 -3
- 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 +24 -4
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +12 -2
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +146 -84
- package/Microsoft.ReactNative/TurboModulesProvider.h +5 -0
- 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 +0 -1
- 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 +1 -1
- 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/LongLivedJsiValue.h +84 -0
- package/Microsoft.ReactNative.Cxx/JSI/NodeApiJsiRuntime.cpp +14 -2
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +4 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +10 -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/dispatchQueue/uiScheduler_winrt.cpp +6 -1
- 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/InstanceManager.cpp +29 -0
- package/Shared/InstanceManager.h +14 -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 +29 -6
- package/Shared/OInstance.h +4 -13
- 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 +25 -26
- 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
|
@@ -92,6 +92,7 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
92
92
|
|
|
93
93
|
protected:
|
|
94
94
|
PointerValue *cloneSymbol(const PointerValue *pv) override;
|
|
95
|
+
PointerValue *cloneBigInt(const PointerValue *pv) override;
|
|
95
96
|
PointerValue *cloneString(const PointerValue *pv) override;
|
|
96
97
|
PointerValue *cloneObject(const PointerValue *pv) override;
|
|
97
98
|
PointerValue *clonePropNameID(const PointerValue *pv) override;
|
|
@@ -161,6 +162,7 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
161
162
|
void popScope(ScopeState *scope) override;
|
|
162
163
|
|
|
163
164
|
bool strictEquals(const facebook::jsi::Symbol &a, const facebook::jsi::Symbol &b) const override;
|
|
165
|
+
bool strictEquals(const facebook::jsi::BigInt &a, const facebook::jsi::BigInt &b) const override;
|
|
164
166
|
bool strictEquals(const facebook::jsi::String &a, const facebook::jsi::String &b) const override;
|
|
165
167
|
bool strictEquals(const facebook::jsi::Object &a, const facebook::jsi::Object &b) const override;
|
|
166
168
|
bool instanceOf(const facebook::jsi::Object &o, const facebook::jsi::Function &f) override;
|
|
@@ -172,11 +174,13 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
172
174
|
|
|
173
175
|
private: // Convert JSI to ABI-safe JSI values
|
|
174
176
|
static JsiSymbolRef const &AsJsiSymbolRef(PointerValue const *pv) noexcept;
|
|
177
|
+
static JsiBigIntRef const &AsJsiBigIntRef(PointerValue const *pv) noexcept;
|
|
175
178
|
static JsiStringRef const &AsJsiStringRef(PointerValue const *pv) noexcept;
|
|
176
179
|
static JsiObjectRef const &AsJsiObjectRef(PointerValue const *pv) noexcept;
|
|
177
180
|
static JsiPropertyIdRef const &AsJsiPropertyIdRef(PointerValue const *pv) noexcept;
|
|
178
181
|
|
|
179
182
|
static JsiSymbolRef const &AsJsiSymbolRef(facebook::jsi::Symbol const &symbol) noexcept;
|
|
183
|
+
static JsiBigIntRef const &AsJsiBigIntRef(facebook::jsi::BigInt const &bigInt) noexcept;
|
|
180
184
|
static JsiStringRef const &AsJsiStringRef(facebook::jsi::String const &str) noexcept;
|
|
181
185
|
static JsiObjectRef const &AsJsiObjectRef(facebook::jsi::Object const &obj) noexcept;
|
|
182
186
|
static JsiPropertyIdRef const &AsJsiPropertyIdRef(facebook::jsi::PropNameID const &propertyId) noexcept;
|
|
@@ -188,11 +192,13 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
188
192
|
|
|
189
193
|
private: // Convert ABI-safe JSI to JSI values
|
|
190
194
|
PointerValue *MakeSymbolValue(JsiSymbolRef &&symbol) const noexcept;
|
|
195
|
+
PointerValue *MakeBigIntValue(JsiBigIntRef &&bigInt) const noexcept;
|
|
191
196
|
PointerValue *MakeStringValue(JsiStringRef &&str) const noexcept;
|
|
192
197
|
PointerValue *MakeObjectValue(JsiObjectRef &&obj) const noexcept;
|
|
193
198
|
PointerValue *MakePropNameIDValue(JsiPropertyIdRef &&propertyId) const noexcept;
|
|
194
199
|
|
|
195
200
|
facebook::jsi::Symbol MakeSymbol(JsiSymbolRef &&symbol) const noexcept;
|
|
201
|
+
facebook::jsi::BigInt MakeBigInt(JsiBigIntRef &&bigInt) const noexcept;
|
|
196
202
|
facebook::jsi::String MakeString(JsiStringRef &&str) const noexcept;
|
|
197
203
|
facebook::jsi::Object MakeObject(JsiObjectRef &&obj) const noexcept;
|
|
198
204
|
facebook::jsi::PropNameID MakePropNameID(JsiPropertyIdRef &&propertyId) const noexcept;
|
|
@@ -225,6 +231,13 @@ struct JsiAbiRuntime : facebook::jsi::Runtime {
|
|
|
225
231
|
static JsiSymbolRef Detach(PointerValue const *pv) noexcept;
|
|
226
232
|
};
|
|
227
233
|
|
|
234
|
+
struct BigIntPointerValue : DataPointerValue {
|
|
235
|
+
BigIntPointerValue(winrt::weak_ref<JsiRuntime> &&weakRuntime, JsiBigIntRef &&bigInt) noexcept;
|
|
236
|
+
void invalidate() override;
|
|
237
|
+
static JsiBigIntRef const &GetData(PointerValue const *pv) noexcept;
|
|
238
|
+
static JsiBigIntRef Detach(PointerValue const *pv) noexcept;
|
|
239
|
+
};
|
|
240
|
+
|
|
228
241
|
struct StringPointerValue : DataPointerValue {
|
|
229
242
|
StringPointerValue(winrt::weak_ref<JsiRuntime> &&weakRuntime, JsiStringRef &&str) noexcept;
|
|
230
243
|
void invalidate() override;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#include "pch.h"
|
|
5
|
+
#include "JsiValueHelpers.h"
|
|
6
|
+
|
|
7
|
+
namespace winrt::Microsoft::ReactNative {
|
|
8
|
+
|
|
9
|
+
/*static*/ FacebookJsiValueKind JsiValueKindHelper::ToValueKind(JsiValueKind const &kind) noexcept {
|
|
10
|
+
switch (kind) {
|
|
11
|
+
case JsiValueKind::Undefined:
|
|
12
|
+
return FacebookJsiValueKind::UndefinedKind;
|
|
13
|
+
case JsiValueKind::Null:
|
|
14
|
+
return FacebookJsiValueKind::NullKind;
|
|
15
|
+
case JsiValueKind::Boolean:
|
|
16
|
+
return FacebookJsiValueKind::BooleanKind;
|
|
17
|
+
case JsiValueKind::Number:
|
|
18
|
+
return FacebookJsiValueKind::NumberKind;
|
|
19
|
+
case JsiValueKind::Symbol:
|
|
20
|
+
return FacebookJsiValueKind::SymbolKind;
|
|
21
|
+
case JsiValueKind::String:
|
|
22
|
+
return FacebookJsiValueKind::StringKind;
|
|
23
|
+
case JsiValueKind::Object:
|
|
24
|
+
return FacebookJsiValueKind::ObjectKind;
|
|
25
|
+
case JsiValueKind::BigInt:
|
|
26
|
+
return FacebookJsiValueKind::BigIntKind;
|
|
27
|
+
}
|
|
28
|
+
return FacebookJsiValueKind::UndefinedKind;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*static*/ JsiValueKind JsiValueKindHelper::ToJsiValueKind(FacebookJsiValueKind const &kind) noexcept {
|
|
32
|
+
switch (kind) {
|
|
33
|
+
case FacebookJsiValueKind::UndefinedKind:
|
|
34
|
+
return JsiValueKind::Undefined;
|
|
35
|
+
case FacebookJsiValueKind::NullKind:
|
|
36
|
+
return JsiValueKind::Null;
|
|
37
|
+
case FacebookJsiValueKind::BooleanKind:
|
|
38
|
+
return JsiValueKind::Boolean;
|
|
39
|
+
case FacebookJsiValueKind::NumberKind:
|
|
40
|
+
return JsiValueKind::Number;
|
|
41
|
+
case FacebookJsiValueKind::SymbolKind:
|
|
42
|
+
return JsiValueKind::Symbol;
|
|
43
|
+
case FacebookJsiValueKind::BigIntKind:
|
|
44
|
+
return JsiValueKind::BigInt;
|
|
45
|
+
case FacebookJsiValueKind::StringKind:
|
|
46
|
+
return JsiValueKind::String;
|
|
47
|
+
case FacebookJsiValueKind::ObjectKind:
|
|
48
|
+
return JsiValueKind::Object;
|
|
49
|
+
}
|
|
50
|
+
return JsiValueKind::Undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
} // namespace winrt::Microsoft::ReactNative
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
#pragma once
|
|
5
|
+
#ifndef MICROSOFT_REACTNATIVE_JSIVALUEHELPERS
|
|
6
|
+
#define MICROSOFT_REACTNATIVE_JSIVALUEHELPERS
|
|
7
|
+
|
|
8
|
+
#include "winrt/Microsoft.ReactNative.h"
|
|
9
|
+
|
|
10
|
+
namespace winrt::Microsoft::ReactNative {
|
|
11
|
+
|
|
12
|
+
// CODESYNC: ReactCommon\jsi\jsi\jsi.h
|
|
13
|
+
enum FacebookJsiValueKind {
|
|
14
|
+
UndefinedKind,
|
|
15
|
+
NullKind,
|
|
16
|
+
BooleanKind,
|
|
17
|
+
NumberKind,
|
|
18
|
+
SymbolKind,
|
|
19
|
+
BigIntKind,
|
|
20
|
+
StringKind,
|
|
21
|
+
ObjectKind,
|
|
22
|
+
PointerKind = SymbolKind,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
struct JsiValueKindHelper final {
|
|
26
|
+
static FacebookJsiValueKind ToValueKind(JsiValueKind const &kind) noexcept;
|
|
27
|
+
static JsiValueKind ToJsiValueKind(FacebookJsiValueKind const &kind) noexcept;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
} // namespace winrt::Microsoft::ReactNative
|
|
31
|
+
|
|
32
|
+
#endif // MICROSOFT_REACTNATIVE_JSIVALUEHELPERS
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
#pragma once
|
|
4
|
+
#ifndef MICROSOFT_REACTNATIVE_JSI_LONGLIVEDJSIVALUE_
|
|
5
|
+
#define MICROSOFT_REACTNATIVE_JSI_LONGLIVEDJSIVALUE_
|
|
6
|
+
|
|
7
|
+
#include <ReactCommon/LongLivedObject.h>
|
|
8
|
+
#include <jsi/jsi.h>
|
|
9
|
+
|
|
10
|
+
namespace winrt::Microsoft::ReactNative {
|
|
11
|
+
|
|
12
|
+
// Wrap up JSI Runtime into a LongLivedObject
|
|
13
|
+
struct LongLivedJsiRuntime : facebook::react::LongLivedObject {
|
|
14
|
+
static std::weak_ptr<LongLivedJsiRuntime> CreateWeak(
|
|
15
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> const &longLivedObjectCollection,
|
|
16
|
+
facebook::jsi::Runtime &runtime) noexcept {
|
|
17
|
+
auto value = std::shared_ptr<LongLivedJsiRuntime>(new LongLivedJsiRuntime(longLivedObjectCollection, runtime));
|
|
18
|
+
longLivedObjectCollection->add(value);
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
facebook::jsi::Runtime &Runtime() {
|
|
23
|
+
return runtime_;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public: // LongLivedObject overrides
|
|
27
|
+
void allowRelease() override {
|
|
28
|
+
if (auto longLivedObjectCollection = longLivedObjectCollection_.lock()) {
|
|
29
|
+
if (longLivedObjectCollection != nullptr) {
|
|
30
|
+
longLivedObjectCollection->remove(this);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
LongLivedObject::allowRelease();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected:
|
|
38
|
+
LongLivedJsiRuntime(
|
|
39
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> const &longLivedObjectCollection,
|
|
40
|
+
facebook::jsi::Runtime &runtime)
|
|
41
|
+
: longLivedObjectCollection_(longLivedObjectCollection), runtime_(runtime) {}
|
|
42
|
+
|
|
43
|
+
LongLivedJsiRuntime(LongLivedJsiRuntime const &) = delete;
|
|
44
|
+
|
|
45
|
+
private:
|
|
46
|
+
// Use a weak reference to the collection to avoid reference loops
|
|
47
|
+
std::weak_ptr<facebook::react::LongLivedObjectCollection> longLivedObjectCollection_;
|
|
48
|
+
facebook::jsi::Runtime &runtime_;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Wrap up a JSI Value into a LongLivedObject.
|
|
52
|
+
template <typename TValue>
|
|
53
|
+
struct LongLivedJsiValue : LongLivedJsiRuntime {
|
|
54
|
+
static std::weak_ptr<LongLivedJsiValue<TValue>> CreateWeak(
|
|
55
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> const &longLivedObjectCollection,
|
|
56
|
+
facebook::jsi::Runtime &runtime,
|
|
57
|
+
TValue &&value) noexcept {
|
|
58
|
+
auto valueWrapper = std::shared_ptr<LongLivedJsiValue<TValue>>(
|
|
59
|
+
new LongLivedJsiValue<TValue>(longLivedObjectCollection, runtime, std::forward<TValue>(value)));
|
|
60
|
+
longLivedObjectCollection->add(valueWrapper);
|
|
61
|
+
return valueWrapper;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
TValue &Value() {
|
|
65
|
+
return value_;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
protected:
|
|
69
|
+
template <typename TValue2>
|
|
70
|
+
LongLivedJsiValue(
|
|
71
|
+
std::shared_ptr<facebook::react::LongLivedObjectCollection> const &longLivedObjectCollection,
|
|
72
|
+
facebook::jsi::Runtime &runtime,
|
|
73
|
+
TValue2 &&value)
|
|
74
|
+
: LongLivedJsiRuntime(longLivedObjectCollection, runtime), value_(std::forward<TValue2>(value)) {}
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
TValue value_;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
using LongLivedJsiFunction = LongLivedJsiValue<facebook::jsi::Function>;
|
|
81
|
+
|
|
82
|
+
} // namespace winrt::Microsoft::ReactNative
|
|
83
|
+
|
|
84
|
+
#endif // MICROSOFT_REACTNATIVE_JSI_LONGLIVEDJSIVALUE_
|
|
@@ -130,6 +130,7 @@ struct NapiJsiRuntime : facebook::jsi::Runtime {
|
|
|
130
130
|
|
|
131
131
|
protected:
|
|
132
132
|
PointerValue *cloneSymbol(const PointerValue *pointerValue) override;
|
|
133
|
+
PointerValue *cloneBigInt(const PointerValue *pointerValue) override;
|
|
133
134
|
PointerValue *cloneString(const PointerValue *pointerValue) override;
|
|
134
135
|
PointerValue *cloneObject(const PointerValue *pointerValue) override;
|
|
135
136
|
PointerValue *clonePropNameID(const PointerValue *pointerValue) override;
|
|
@@ -205,6 +206,7 @@ struct NapiJsiRuntime : facebook::jsi::Runtime {
|
|
|
205
206
|
void popScope(ScopeState *) override;
|
|
206
207
|
|
|
207
208
|
bool strictEquals(const facebook::jsi::Symbol &a, const facebook::jsi::Symbol &b) const override;
|
|
209
|
+
bool strictEquals(const facebook::jsi::BigInt &a, const facebook::jsi::BigInt &b) const override;
|
|
208
210
|
bool strictEquals(const facebook::jsi::String &a, const facebook::jsi::String &b) const override;
|
|
209
211
|
bool strictEquals(const facebook::jsi::Object &a, const facebook::jsi::Object &b) const override;
|
|
210
212
|
|
|
@@ -672,6 +674,12 @@ Runtime::PointerValue *NapiJsiRuntime::cloneSymbol(const Runtime::PointerValue *
|
|
|
672
674
|
return CloneNapiPointerValue(pointerValue);
|
|
673
675
|
}
|
|
674
676
|
|
|
677
|
+
Runtime::PointerValue *NapiJsiRuntime::cloneBigInt(const Runtime::PointerValue *pointerValue) {
|
|
678
|
+
EnvScope scope{m_env};
|
|
679
|
+
|
|
680
|
+
return CloneNapiPointerValue(pointerValue);
|
|
681
|
+
}
|
|
682
|
+
|
|
675
683
|
Runtime::PointerValue *NapiJsiRuntime::cloneString(const Runtime::PointerValue *pointerValue) {
|
|
676
684
|
EnvScope scope{m_env};
|
|
677
685
|
|
|
@@ -715,7 +723,6 @@ PropNameID NapiJsiRuntime::createPropNameIDFromString(const String &str) {
|
|
|
715
723
|
PropNameID NapiJsiRuntime::createPropNameIDFromSymbol(const Symbol &sym) {
|
|
716
724
|
EnvScope envScope{m_env};
|
|
717
725
|
napi_ext_ref propSym = GetPropertyIdFromSymbol(GetNapiValue(sym));
|
|
718
|
-
|
|
719
726
|
return MakePointer<PropNameID>(propSym);
|
|
720
727
|
}
|
|
721
728
|
|
|
@@ -1005,6 +1012,12 @@ bool NapiJsiRuntime::strictEquals(const Symbol &a, const Symbol &b) const {
|
|
|
1005
1012
|
return StrictEquals(GetNapiValue(a), GetNapiValue(b));
|
|
1006
1013
|
}
|
|
1007
1014
|
|
|
1015
|
+
bool NapiJsiRuntime::strictEquals(const BigInt &a, const BigInt &b) const {
|
|
1016
|
+
EnvScope scope{m_env};
|
|
1017
|
+
|
|
1018
|
+
return StrictEquals(GetNapiValue(a), GetNapiValue(b));
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1008
1021
|
bool NapiJsiRuntime::strictEquals(const String &a, const String &b) const {
|
|
1009
1022
|
EnvScope scope{m_env};
|
|
1010
1023
|
|
|
@@ -1618,7 +1631,6 @@ napi_ext_ref NapiJsiRuntime::GetPropertyIdFromName(napi_value str) const {
|
|
|
1618
1631
|
napi_ext_ref NapiJsiRuntime::GetPropertyIdFromSymbol(napi_value sym) const {
|
|
1619
1632
|
napi_ext_ref ref{};
|
|
1620
1633
|
CHECK_NAPI(napi_ext_create_reference(m_env, sym, &ref));
|
|
1621
|
-
|
|
1622
1634
|
return ref;
|
|
1623
1635
|
}
|
|
1624
1636
|
|
|
@@ -37,7 +37,9 @@
|
|
|
37
37
|
<ClInclude Include="$(JSI_SourcePath)\jsi\instrumentation.h" />
|
|
38
38
|
<ClInclude Include="$(JSI_SourcePath)\jsi\jsi-inl.h" />
|
|
39
39
|
<ClInclude Include="$(JSI_SourcePath)\jsi\jsi.h" />
|
|
40
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)CoreApp.h" />
|
|
40
41
|
<ClInclude Include="$(MSBuildThisFileDirectory)DesktopWindowBridge.h" />
|
|
42
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\LongLivedJsiValue.h" />
|
|
41
43
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\NodeApiJsiRuntime.h" />
|
|
42
44
|
<ClInclude Include="$(MSBuildThisFileDirectory)TurboModuleProvider.h" />
|
|
43
45
|
<ClInclude Include="$(CallInvoker_SourcePath)\ReactCommon\CallInvoker.h" />
|
|
@@ -50,6 +52,7 @@
|
|
|
50
52
|
<ClInclude Include="$(MSBuildThisFileDirectory)Crash.h" />
|
|
51
53
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\JsiAbiApi.h" />
|
|
52
54
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\JsiApiContext.h" />
|
|
55
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\JsiValueHelpers.h" />
|
|
53
56
|
<ClInclude Include="$(MSBuildThisFileDirectory)ReactHandleHelper.h" />
|
|
54
57
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSValue.h" />
|
|
55
58
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSValueReader.h" />
|
|
@@ -91,6 +94,7 @@
|
|
|
91
94
|
<ItemGroup Condition="'$(BuildMSRNCxx)' != 'false'">
|
|
92
95
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiAbiApi.cpp" />
|
|
93
96
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiApiContext.cpp" />
|
|
97
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiValueHelpers.cpp" />
|
|
94
98
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSValue.cpp" />
|
|
95
99
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSValueTreeReader.cpp" />
|
|
96
100
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSValueTreeWriter.cpp" />
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiAbiApi.cpp">
|
|
13
13
|
<Filter>JSI</Filter>
|
|
14
14
|
</ClCompile>
|
|
15
|
+
<ClCompile Include="$(MSBuildThisFileDirectory)JSI\JsiValueHelpers.cpp">
|
|
16
|
+
<Filter>JSI</Filter>
|
|
17
|
+
</ClCompile>
|
|
15
18
|
<ClCompile Include="$(MSBuildThisFileDirectory)TurboModuleProvider.cpp">
|
|
16
19
|
<Filter>TurboModule</Filter>
|
|
17
20
|
</ClCompile>
|
|
@@ -110,6 +113,9 @@
|
|
|
110
113
|
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\JsiAbiApi.h">
|
|
111
114
|
<Filter>JSI</Filter>
|
|
112
115
|
</ClInclude>
|
|
116
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\JsiValueHelpers.h">
|
|
117
|
+
<Filter>JSI</Filter>
|
|
118
|
+
</ClInclude>
|
|
113
119
|
<ClInclude Include="$(JSI_SourcePath)\jsi\jsi.h">
|
|
114
120
|
<Filter>JSI</Filter>
|
|
115
121
|
</ClInclude>
|
|
@@ -151,6 +157,10 @@
|
|
|
151
157
|
<Filter>JSI</Filter>
|
|
152
158
|
</ClInclude>
|
|
153
159
|
<ClInclude Include="$(Bridging_SourcePath)\CallbackWrapper.h" />
|
|
160
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)CoreApp.h" />
|
|
161
|
+
<ClInclude Include="$(MSBuildThisFileDirectory)JSI\LongLivedJsiValue.h">
|
|
162
|
+
<Filter>TurboModule</Filter>
|
|
163
|
+
</ClInclude>
|
|
154
164
|
</ItemGroup>
|
|
155
165
|
<ItemGroup>
|
|
156
166
|
<Filter Include="JSI">
|
|
@@ -135,31 +135,8 @@
|
|
|
135
135
|
"resolved": "2.2.9",
|
|
136
136
|
"contentHash": "qF6RRZKaflI+LR1YODNyWYjq5YoX8IJ2wx5y8O+AW2xO+1t/Q6Mm+jQ38zJbWnmXbrcOqUYofn7Y3/KC6lTLBQ=="
|
|
137
137
|
},
|
|
138
|
-
"common": {
|
|
139
|
-
"type": "Project"
|
|
140
|
-
},
|
|
141
|
-
"fmt": {
|
|
142
|
-
"type": "Project"
|
|
143
|
-
},
|
|
144
|
-
"folly": {
|
|
145
|
-
"type": "Project",
|
|
146
|
-
"dependencies": {
|
|
147
|
-
"fmt": "1.0.0"
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
138
|
"microsoft.reactnative": {
|
|
151
|
-
"type": "Project"
|
|
152
|
-
"dependencies": {
|
|
153
|
-
"Common": "1.0.0",
|
|
154
|
-
"Folly": "1.0.0",
|
|
155
|
-
"ReactCommon": "1.0.0"
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"reactcommon": {
|
|
159
|
-
"type": "Project",
|
|
160
|
-
"dependencies": {
|
|
161
|
-
"Folly": "1.0.0"
|
|
162
|
-
}
|
|
139
|
+
"type": "Project"
|
|
163
140
|
}
|
|
164
141
|
},
|
|
165
142
|
"UAP,Version=v10.0.16299/win10-arm": {
|
|
@@ -22,6 +22,7 @@ using DispatchTask = VoidFunctor;
|
|
|
22
22
|
// Forward declarations
|
|
23
23
|
struct DispatchLocalValueGuard;
|
|
24
24
|
struct DispatchQueue;
|
|
25
|
+
struct DispatchQueueSettings;
|
|
25
26
|
struct DispatchSuspendGuard;
|
|
26
27
|
struct DispatchTaskBatch;
|
|
27
28
|
template <typename TInvoke, typename TCancel>
|
|
@@ -85,6 +86,13 @@ struct DispatchLocalValueGuard {
|
|
|
85
86
|
void **m_tlsValue;
|
|
86
87
|
};
|
|
87
88
|
|
|
89
|
+
struct DispatchQueueSettings {
|
|
90
|
+
Mso::Functor<void(DispatchQueue const &)> TaskStarting;
|
|
91
|
+
Mso::Functor<void(DispatchQueue const &)> TaskCompleted;
|
|
92
|
+
Mso::Functor<void(DispatchQueue const &)> IdleWaitStarting;
|
|
93
|
+
Mso::Functor<void(DispatchQueue const &)> IdleWaitCompleted;
|
|
94
|
+
};
|
|
95
|
+
|
|
88
96
|
//! Serial or concurrent dispatch queue main API.
|
|
89
97
|
//! Use Post or InvokeElsePost to post tasks for invocation.
|
|
90
98
|
//! Use BeginTaskBatching to start tasks batching in current thread for the dispatch queue.
|
|
@@ -117,7 +125,7 @@ struct DispatchQueue {
|
|
|
117
125
|
static DispatchQueue MakeSerialQueue() noexcept;
|
|
118
126
|
|
|
119
127
|
//! Create new looper DispatchQueue on top of new std::thread. It owns the thread until shutdown.
|
|
120
|
-
static DispatchQueue MakeLooperQueue() noexcept;
|
|
128
|
+
static DispatchQueue MakeLooperQueue(DispatchQueueSettings const &settings = {}) noexcept;
|
|
121
129
|
|
|
122
130
|
//! Get a dispatch queue for the current UI thread. The result is null if the UI thread has no system UI thread
|
|
123
131
|
//! dispatcher.
|
|
@@ -417,7 +425,7 @@ struct IDispatchQueueStatic : IUnknown {
|
|
|
417
425
|
virtual DispatchQueue MakeSerialQueue() noexcept = 0;
|
|
418
426
|
|
|
419
427
|
//! Create new looper DispatchQueue on top of new std::thread. It owns the thread until shutdown.
|
|
420
|
-
virtual DispatchQueue MakeLooperQueue() noexcept = 0;
|
|
428
|
+
virtual DispatchQueue MakeLooperQueue(DispatchQueueSettings const &settings) noexcept = 0;
|
|
421
429
|
|
|
422
430
|
//! Get a dispatch queue for the current UI thread. The result is null if the UI thread has no system UI thread
|
|
423
431
|
//! dispatcher.
|
|
@@ -545,8 +553,8 @@ inline /*static*/ DispatchQueue DispatchQueue::MakeSerialQueue() noexcept {
|
|
|
545
553
|
return IDispatchQueueStatic::Instance()->MakeSerialQueue();
|
|
546
554
|
}
|
|
547
555
|
|
|
548
|
-
inline /*static*/ DispatchQueue DispatchQueue::MakeLooperQueue() noexcept {
|
|
549
|
-
return IDispatchQueueStatic::Instance()->MakeLooperQueue();
|
|
556
|
+
inline /*static*/ DispatchQueue DispatchQueue::MakeLooperQueue(DispatchQueueSettings const &settings) noexcept {
|
|
557
|
+
return IDispatchQueueStatic::Instance()->MakeLooperQueue(settings);
|
|
550
558
|
}
|
|
551
559
|
|
|
552
560
|
inline /*static*/ DispatchQueue DispatchQueue::GetCurrentUIThreadQueue() noexcept {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
namespace Mso {
|
|
9
9
|
|
|
10
10
|
struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDispatchQueueScheduler> {
|
|
11
|
-
LooperScheduler() noexcept;
|
|
11
|
+
LooperScheduler(DispatchQueueSettings const &settings = {}) noexcept;
|
|
12
12
|
~LooperScheduler() noexcept override;
|
|
13
13
|
|
|
14
14
|
static void RunLoop(const Mso::WeakPtr<LooperScheduler> &weakSelf) noexcept;
|
|
@@ -23,6 +23,7 @@ struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDis
|
|
|
23
23
|
|
|
24
24
|
private:
|
|
25
25
|
ManualResetEvent m_wakeUpEvent;
|
|
26
|
+
DispatchQueueSettings m_settings;
|
|
26
27
|
Mso::WeakPtr<IDispatchQueueService> m_queue;
|
|
27
28
|
std::atomic_bool m_isShutdown{false};
|
|
28
29
|
std::thread m_looperThread; // it must be last in the initialization list
|
|
@@ -32,8 +33,8 @@ struct LooperScheduler : Mso::UnknownObject<Mso::RefCountStrategy::WeakRef, IDis
|
|
|
32
33
|
// LooperScheduler implementation
|
|
33
34
|
//=============================================================================
|
|
34
35
|
|
|
35
|
-
LooperScheduler::LooperScheduler() noexcept
|
|
36
|
-
: m_looperThread([weakSelf = Mso::WeakPtr{this}]() noexcept { RunLoop(weakSelf); }) {}
|
|
36
|
+
LooperScheduler::LooperScheduler(DispatchQueueSettings const &settings) noexcept
|
|
37
|
+
: m_settings(settings), m_looperThread([weakSelf = Mso::WeakPtr{this}]() noexcept { RunLoop(weakSelf); }) {}
|
|
37
38
|
|
|
38
39
|
LooperScheduler::~LooperScheduler() noexcept {
|
|
39
40
|
AwaitTermination();
|
|
@@ -42,10 +43,22 @@ LooperScheduler::~LooperScheduler() noexcept {
|
|
|
42
43
|
/*static*/ void LooperScheduler::RunLoop(const Mso::WeakPtr<LooperScheduler> &weakSelf) noexcept {
|
|
43
44
|
for (;;) {
|
|
44
45
|
if (auto self = weakSelf.GetStrongPtr()) {
|
|
45
|
-
if (auto queue = self->m_queue.GetStrongPtr()) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
queue->
|
|
46
|
+
if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
|
|
47
|
+
for (;;) {
|
|
48
|
+
DispatchTask task;
|
|
49
|
+
if (!(*GetRawState(queue))->TryDequeTask(task)) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (auto &func = self->m_settings.TaskStarting) {
|
|
54
|
+
func(queue);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
(*GetRawState(queue))->InvokeTask(std::move(task), std::nullopt);
|
|
58
|
+
|
|
59
|
+
if (auto &func = self->m_settings.TaskCompleted) {
|
|
60
|
+
func(queue);
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
}
|
|
51
64
|
|
|
@@ -53,8 +66,21 @@ LooperScheduler::~LooperScheduler() noexcept {
|
|
|
53
66
|
break;
|
|
54
67
|
}
|
|
55
68
|
|
|
69
|
+
if (auto &func = self->m_settings.IdleWaitStarting) {
|
|
70
|
+
if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
|
|
71
|
+
func(queue);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
56
75
|
self->m_wakeUpEvent.Wait();
|
|
57
76
|
self->m_wakeUpEvent.Reset();
|
|
77
|
+
|
|
78
|
+
if (auto &func = self->m_settings.IdleWaitCompleted) {
|
|
79
|
+
if (auto queue = DispatchQueue{self->m_queue.GetStrongPtr()}) {
|
|
80
|
+
func(queue);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
58
84
|
continue;
|
|
59
85
|
}
|
|
60
86
|
|
|
@@ -101,8 +127,9 @@ void LooperScheduler::AwaitTermination() noexcept {
|
|
|
101
127
|
// DispatchQueueStatic::MakeThreadPoolScheduler implementation
|
|
102
128
|
//=============================================================================
|
|
103
129
|
|
|
104
|
-
/*static*/ Mso::CntPtr<IDispatchQueueScheduler> DispatchQueueStatic::MakeLooperScheduler(
|
|
105
|
-
|
|
130
|
+
/*static*/ Mso::CntPtr<IDispatchQueueScheduler> DispatchQueueStatic::MakeLooperScheduler(
|
|
131
|
+
DispatchQueueSettings const &settings) noexcept {
|
|
132
|
+
return Mso::Make<LooperScheduler, IDispatchQueueScheduler>(settings);
|
|
106
133
|
}
|
|
107
134
|
|
|
108
135
|
} // namespace Mso
|
|
@@ -271,8 +271,8 @@ DispatchQueue DispatchQueueStatic::MakeSerialQueue() noexcept {
|
|
|
271
271
|
return Mso::Make<QueueService, IDispatchQueueService>(MakeThreadPoolScheduler(/*maxThreads:*/ 1));
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
DispatchQueue DispatchQueueStatic::MakeLooperQueue() noexcept {
|
|
275
|
-
return Mso::Make<QueueService, IDispatchQueueService>(MakeLooperScheduler());
|
|
274
|
+
DispatchQueue DispatchQueueStatic::MakeLooperQueue(DispatchQueueSettings const &settings) noexcept {
|
|
275
|
+
return Mso::Make<QueueService, IDispatchQueueService>(MakeLooperScheduler(settings));
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
DispatchQueue DispatchQueueStatic::MakeConcurrentQueue(uint32_t maxThreads) noexcept {
|
|
@@ -81,14 +81,14 @@ struct QueueLocalValueEntry {
|
|
|
81
81
|
|
|
82
82
|
struct DispatchQueueStatic : Mso::UnknownObject<Mso::RefCountStrategy::NoRefCount, IDispatchQueueStatic> {
|
|
83
83
|
static DispatchQueueStatic *Instance() noexcept;
|
|
84
|
-
static Mso::CntPtr<IDispatchQueueScheduler> MakeLooperScheduler() noexcept;
|
|
84
|
+
static Mso::CntPtr<IDispatchQueueScheduler> MakeLooperScheduler(DispatchQueueSettings const &settings) noexcept;
|
|
85
85
|
static Mso::CntPtr<IDispatchQueueScheduler> MakeThreadPoolScheduler(uint32_t maxThreads) noexcept;
|
|
86
86
|
|
|
87
87
|
public: // IDispatchQueueStatic
|
|
88
88
|
DispatchQueue CurrentQueue() noexcept override;
|
|
89
89
|
DispatchQueue const &ConcurrentQueue() noexcept override;
|
|
90
90
|
DispatchQueue MakeSerialQueue() noexcept override;
|
|
91
|
-
DispatchQueue MakeLooperQueue() noexcept override;
|
|
91
|
+
DispatchQueue MakeLooperQueue(DispatchQueueSettings const &settings) noexcept override;
|
|
92
92
|
DispatchQueue GetCurrentUIThreadQueue() noexcept override;
|
|
93
93
|
DispatchQueue MakeConcurrentQueue(uint32_t maxThreads) noexcept override;
|
|
94
94
|
DispatchQueue MakeCustomQueue(Mso::CntPtr<IDispatchQueueScheduler> &&scheduler) noexcept override;
|
|
@@ -289,7 +289,12 @@ void UISchedulerWinRT::AwaitTermination() noexcept {
|
|
|
289
289
|
return queue;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
|
|
292
|
+
decltype(DispatcherQueue::GetForCurrentThread()) dispatcher{nullptr};
|
|
293
|
+
try {
|
|
294
|
+
dispatcher = DispatcherQueue::GetForCurrentThread();
|
|
295
|
+
} catch (winrt::hresult_error const &) {
|
|
296
|
+
}
|
|
297
|
+
|
|
293
298
|
if (!dispatcher) {
|
|
294
299
|
return queue;
|
|
295
300
|
}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.
|
|
13
|
+
<ReactNativeWindowsVersion>0.70.0</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
|
-
<ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
15
|
+
<ReactNativeWindowsMinor>70</ReactNativeWindowsMinor>
|
|
16
|
+
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
18
|
</PropertyGroup>
|
|
19
19
|
</Project>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<!-- Enabling this will (1) Include hermes glues in the Microsoft.ReactNative binaries AND (2) Make hermes the default engine -->
|
|
9
9
|
<UseHermes Condition="'$(UseHermes)' == ''">false</UseHermes>
|
|
10
10
|
<!-- This will be true if (1) the client want to use hermes by setting UseHermes to true OR (2) We are building for UWP where dynamic switching is enabled -->
|
|
11
|
-
<HermesVersion Condition="'$(HermesVersion)' == ''">0.
|
|
11
|
+
<HermesVersion Condition="'$(HermesVersion)' == ''">0.70.1</HermesVersion>
|
|
12
12
|
<HermesPackage Condition="'$(HermesPackage)' == '' And Exists('$(PkgReactNative_Hermes_Windows)')">$(PkgReactNative_Hermes_Windows)</HermesPackage>
|
|
13
13
|
<HermesPackage Condition="'$(HermesPackage)' == ''">$(NuGetPackageRoot)\ReactNative.Hermes.Windows\$(HermesVersion)</HermesPackage>
|
|
14
14
|
<EnableHermesInspectorInReleaseFlavor Condition="'$(EnableHermesInspectorInReleaseFlavor)' == ''">false</EnableHermesInspectorInReleaseFlavor>
|
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
|
|
13
13
|
<ItemDefinitionGroup>
|
|
14
14
|
<ClCompile>
|
|
15
|
+
<StringPooling>true</StringPooling>
|
|
15
16
|
<Optimization>MinSpace</Optimization>
|
|
17
|
+
<AdditionalOptions>%(AdditionalOptions) /Gw</AdditionalOptions>
|
|
16
18
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
17
19
|
<ControlFlowGuard>Guard</ControlFlowGuard>
|
|
18
20
|
</ClCompile>
|
|
21
|
+
|
|
22
|
+
<Link>
|
|
23
|
+
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
|
24
|
+
</Link>
|
|
19
25
|
</ItemDefinitionGroup>
|
|
20
26
|
|
|
21
27
|
</Project>
|