react-native-windows 0.75.4 → 0.76.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 +6 -4
- package/Directory.Build.props +4 -0
- package/Directory.Build.targets +5 -0
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Alert/Alert.windows.js +3 -0
- package/Libraries/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/NativeAnimatedAllowlist.js +111 -0
- package/Libraries/Animated/animations/Animation.js +11 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -1
- package/Libraries/Animated/animations/SpringAnimation.js +1 -1
- package/Libraries/Animated/animations/TimingAnimation.js +2 -1
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -2
- package/Libraries/Animated/createAnimatedComponent.js +10 -9
- package/Libraries/Animated/nodes/AnimatedColor.js +1 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +3 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +42 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +56 -50
- package/Libraries/Animated/nodes/AnimatedProps.js +77 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +103 -59
- package/Libraries/Animated/nodes/AnimatedTracking.js +1 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +102 -67
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -1
- package/Libraries/Animated/nodes/AnimatedWithChildren.js +21 -22
- package/Libraries/Animated/useAnimatedProps.js +142 -7
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/Button.windows.js +0 -1
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +131 -169
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +230 -94
- package/Libraries/Components/TextInput/TextInput.windows.js +230 -105
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +2 -0
- package/Libraries/Components/View/View.windows.js +32 -30
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +0 -1
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +3 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +4 -4
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/AssetSourceResolver.windows.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.windows.js +11 -22
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Inspector/Inspector.js +3 -2
- package/Libraries/Inspector/InspectorPanel.js +16 -10
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +3 -3
- package/Libraries/LogBox/Data/LogBoxData.js +24 -3
- package/Libraries/LogBox/LogBoxNotificationContainer.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +9 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +9 -8
- package/Libraries/Modal/Modal.js +0 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +8 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +22 -22
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +1 -2
- package/Libraries/ReactNative/AppRegistry.d.ts +0 -4
- package/Libraries/ReactNative/AppRegistry.js +1 -7
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +26 -4
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/ReactNative/renderApplication.js +1 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +11 -4
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -5
- package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +231 -42
- package/Libraries/Text/Text.js +394 -196
- package/Libraries/Text/Text.windows.js +476 -300
- package/Libraries/Text/TextNativeComponent.js +2 -1
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/Appearance.js +108 -84
- package/Libraries/Utilities/DevLoadingView.js +2 -4
- package/Libraries/Utilities/HMRClient.js +2 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/Utilities/createPerformanceLogger.js +0 -9
- package/Libraries/Utilities/stringifyViewConfig.js +22 -0
- package/Libraries/Utilities/useColorScheme.js +3 -3
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/promiseRejectionTrackingOptions.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +6 -5
- package/Microsoft.ReactNative/ComponentView.idl +11 -0
- package/Microsoft.ReactNative/Composition.Input.idl +1 -0
- package/Microsoft.ReactNative/CompositionSwitcher.idl +3 -0
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +9 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +7 -9
- package/Microsoft.ReactNative/Fabric/ComponentView.h +5 -6
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +4 -0
- package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +44 -13
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +42 -5
- package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +81 -63
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +8 -6
- package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.cpp +20 -6
- package/Microsoft.ReactNative/Fabric/Composition/FocusManager.h +13 -6
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +2 -3
- package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +72 -54
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +14 -4
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +26 -8
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +5 -2
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +18 -7
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +6 -6
- package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +97 -140
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +8 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +18 -11
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +5 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +0 -13
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +29 -4
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.h +1 -2
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +28 -12
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/HostPlatformColor.h +33 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +26 -9
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +10 -4
- package/Microsoft.ReactNative/IReactModuleBuilder.cpp +5 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.h +1 -0
- package/Microsoft.ReactNative/IReactModuleBuilder.idl +9 -0
- package/Microsoft.ReactNative/IReactViewComponentBuilder.idl +8 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +2 -0
- package/Microsoft.ReactNative/Modules/AlertModule.cpp +3 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.cpp +1 -1
- package/Microsoft.ReactNative/Modules/AppearanceModule.h +7 -1
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +3 -3
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/LinkingManagerModule.h +1 -1
- package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +9 -0
- package/Microsoft.ReactNative/Modules/LogBoxModule.h +2 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.cpp +121 -0
- package/Microsoft.ReactNative/Modules/SampleTurboModule.h +90 -0
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.cpp +0 -7
- package/Microsoft.ReactNative/ReactHost/MsoReactContext.h +0 -5
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +5 -1
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.cpp +59 -0
- package/Microsoft.ReactNative/ReactInstanceSettingsBuilder.h +23 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +179 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.h +35 -0
- package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +69 -0
- package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.cpp +82 -0
- package/Microsoft.ReactNative/ReactNativeWin32App.h +38 -0
- package/Microsoft.ReactNative/TurboModulesProvider.cpp +45 -0
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -1
- package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +25 -16
- package/Microsoft.ReactNative/packages.fabric.lock.json +159 -0
- package/Microsoft.ReactNative/packages.lock.json +11 -12
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +3 -4
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +3 -0
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.cpp +2 -2
- package/Microsoft.ReactNative.Cxx/ModuleRegistration.h +62 -4
- package/Microsoft.ReactNative.Cxx/NativeModules.h +131 -14
- package/Microsoft.ReactNative.Managed/packages.lock.json +9 -9
- package/Microsoft.ReactNative.Managed.CodeGen/ReactNativeNames.cs +10 -2
- package/PropertySheets/Autolink.props +1 -1
- package/PropertySheets/Bundle.props +1 -1
- package/PropertySheets/Codegen.props +1 -1
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/NuGet.LockFile.props +18 -0
- package/README.md +29 -29
- package/ReactCommon/ReactCommon.vcxproj +5 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +11 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +2 -7
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.cpp +441 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/NetworkIOAgent.h +266 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsinspector-modern/Utf8.h +56 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +3 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Convert.h +172 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +4 -5
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +2 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +3 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/LayoutableShadowNode.cpp +363 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +22 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +118 -51
- package/ReactCommon/packages.lock.json +2 -2
- package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +8 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -2
- package/Shared/Modules/WebSocketModule.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +4 -1
- package/Shared/Shared.vcxitems +38 -2
- package/Shared/Shared.vcxitems.filters +6 -1
- package/Shared/TurboModuleManager.cpp +0 -3
- package/codegen/NativeLinkingManagerSpec.g.h +3 -3
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +198 -54
- package/codegen/NativeSampleTurboModuleSpec.g.h +35 -0
- package/codegen/rnwcoreJSI-generated.cpp +245 -101
- package/codegen/rnwcoreJSI.h +847 -548
- package/index.js +3 -1
- package/index.windows.js +3 -1
- package/jest/mockComponent.js +4 -1
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -13
- package/package.json +29 -29
- package/src/private/animated/NativeAnimatedHelper.js +438 -0
- package/src/private/animated/NativeAnimatedValidation.js +64 -0
- package/src/private/components/HScrollViewNativeComponents.js +56 -0
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +27 -0
- package/src/private/components/VScrollViewNativeComponents.js +48 -0
- package/src/private/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +166 -16
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +29 -5
- package/src/private/fusebox/FuseboxSessionObserver.js +42 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeAppearance.js +3 -3
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWindows.js +7 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.cpp +1 -1
- package/template/cpp-app/src/AutolinkedNativeModules.g.h +1 -1
- package/template/cs-app/src/AutolinkedNativeModules.g.cs +1 -1
- package/template/index.windows.bundle +1 -1
- package/template/metro.config.js +2 -2
- package/template/shared-app/src/AutolinkedNativeModules.g.props +1 -1
- package/template/shared-app/src/AutolinkedNativeModules.g.targets +1 -1
- package/templates/cpp-app/metro.config.js +2 -2
- package/templates/cpp-app/template.config.js +5 -5
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.cpp +1 -1
- package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.h +1 -1
- package/templates/cpp-app/windows/MyApp/MyApp.cpp +2 -0
- package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.h +3 -3
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +1 -1
- package/types/experimental.d.ts +20 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +0 -615
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2396
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -136
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +0 -48
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +0 -122
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +0 -388
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "CdpJson.h"
|
|
11
|
+
#include "InspectorInterfaces.h"
|
|
12
|
+
#include "ScopedExecutor.h"
|
|
13
|
+
|
|
14
|
+
#include <folly/dynamic.h>
|
|
15
|
+
#include <mutex>
|
|
16
|
+
#include <sstream>
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <unordered_map>
|
|
19
|
+
#include <utility>
|
|
20
|
+
#include <variant>
|
|
21
|
+
|
|
22
|
+
namespace facebook::react::jsinspector_modern {
|
|
23
|
+
|
|
24
|
+
using StreamID = const std::string;
|
|
25
|
+
using Headers = std::map<std::string, std::string>;
|
|
26
|
+
using IOReadError = const std::string;
|
|
27
|
+
|
|
28
|
+
// namespace { [Windows #13587]
|
|
29
|
+
class Stream; // Defined in NetworkIOAgent.cpp
|
|
30
|
+
using StreamsMap = std::unordered_map<std::string, std::shared_ptr<Stream>>;
|
|
31
|
+
// } // namespace [Windows #13587]
|
|
32
|
+
|
|
33
|
+
struct LoadNetworkResourceRequest {
|
|
34
|
+
std::string url;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
struct ReadStreamParams {
|
|
38
|
+
StreamID handle;
|
|
39
|
+
std::optional<unsigned long> size;
|
|
40
|
+
std::optional<unsigned long> offset;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct NetworkResource {
|
|
44
|
+
bool success{};
|
|
45
|
+
std::optional<std::string> stream;
|
|
46
|
+
std::optional<int> httpStatusCode;
|
|
47
|
+
std::optional<std::string> netErrorName;
|
|
48
|
+
std::optional<Headers> headers;
|
|
49
|
+
folly::dynamic toDynamic() const {
|
|
50
|
+
auto dynamicResource = folly::dynamic::object("success", success);
|
|
51
|
+
|
|
52
|
+
if (success) { // stream IFF successful
|
|
53
|
+
assert(stream);
|
|
54
|
+
dynamicResource("stream", *stream);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (netErrorName) { // Only if unsuccessful
|
|
58
|
+
assert(!success);
|
|
59
|
+
dynamicResource("netErrorName", *netErrorName);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (httpStatusCode) { // Guaranteed if successful
|
|
63
|
+
dynamicResource("httpStatusCode", *httpStatusCode);
|
|
64
|
+
} else {
|
|
65
|
+
assert(!success);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (headers) { // Guaranteed if successful
|
|
69
|
+
auto dynamicHeaders = folly::dynamic::object();
|
|
70
|
+
for (const auto& pair : *headers) {
|
|
71
|
+
dynamicHeaders(pair.first, pair.second);
|
|
72
|
+
}
|
|
73
|
+
dynamicResource("headers", std::move(dynamicHeaders));
|
|
74
|
+
} else {
|
|
75
|
+
assert(!success);
|
|
76
|
+
}
|
|
77
|
+
return dynamicResource;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
struct IOReadResult {
|
|
82
|
+
std::string data;
|
|
83
|
+
bool eof;
|
|
84
|
+
bool base64Encoded;
|
|
85
|
+
folly::dynamic toDynamic() const {
|
|
86
|
+
auto obj = folly::dynamic::object("data", data);
|
|
87
|
+
obj("eof", eof);
|
|
88
|
+
obj("base64Encoded", base64Encoded);
|
|
89
|
+
return obj;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Passed to `loadNetworkResource`, provides callbacks for processing incoming
|
|
95
|
+
* data and other events.
|
|
96
|
+
*/
|
|
97
|
+
class NetworkRequestListener {
|
|
98
|
+
public:
|
|
99
|
+
NetworkRequestListener() = default;
|
|
100
|
+
NetworkRequestListener(const NetworkRequestListener&) = delete;
|
|
101
|
+
NetworkRequestListener& operator=(const NetworkRequestListener&) = delete;
|
|
102
|
+
NetworkRequestListener(NetworkRequestListener&&) noexcept = default;
|
|
103
|
+
NetworkRequestListener& operator=(NetworkRequestListener&&) noexcept =
|
|
104
|
+
default;
|
|
105
|
+
virtual ~NetworkRequestListener() = default;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* To be called by the delegate on receipt of response headers, including
|
|
109
|
+
* on "unsuccessful" status codes.
|
|
110
|
+
*
|
|
111
|
+
* \param httpStatusCode The HTTP status code received.
|
|
112
|
+
* \param headers Response headers as an unordered_map.
|
|
113
|
+
*/
|
|
114
|
+
virtual void onHeaders(int httpStatusCode, const Headers& headers) = 0;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* To be called by the delegate on receipt of data chunks.
|
|
118
|
+
* \param data The data received.
|
|
119
|
+
*/
|
|
120
|
+
virtual void onData(std::string_view data) = 0;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* To be called by the delegate on any error with the request, either before
|
|
124
|
+
* headers are received or for a subsequent interrupion.
|
|
125
|
+
*
|
|
126
|
+
* \param message A short, human-readable message, which may be forwarded to
|
|
127
|
+
* the CDP client either in the `loadNetworkResource` response (if headers
|
|
128
|
+
* were not yet received), or as a CDP error in response to a subsequent
|
|
129
|
+
* `IO.read`.
|
|
130
|
+
*/
|
|
131
|
+
virtual void onError(const std::string& message) = 0;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* To be called by the delegate on successful completion of the request.
|
|
135
|
+
* Delegates must call *either* onCompletion() or onError() exactly once.
|
|
136
|
+
*/
|
|
137
|
+
virtual void onCompletion() = 0;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Optionally (preferably) used to give NetworkIOAgent
|
|
141
|
+
a way to cancel an
|
|
142
|
+
* in-progress download.
|
|
143
|
+
*
|
|
144
|
+
* \param cancelFunction A function that can be called to cancel a download,
|
|
145
|
+
* may be called before or after the download is complete.
|
|
146
|
+
*/
|
|
147
|
+
virtual void setCancelFunction(std::function<void()> cancelFunction) = 0;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Implemented by the HostTargetDelegate per-platform to perform network
|
|
152
|
+
* requests.
|
|
153
|
+
*/
|
|
154
|
+
class LoadNetworkResourceDelegate {
|
|
155
|
+
public:
|
|
156
|
+
LoadNetworkResourceDelegate() = default;
|
|
157
|
+
LoadNetworkResourceDelegate(const LoadNetworkResourceDelegate&) = delete;
|
|
158
|
+
LoadNetworkResourceDelegate& operator=(const LoadNetworkResourceDelegate&) =
|
|
159
|
+
delete;
|
|
160
|
+
LoadNetworkResourceDelegate(LoadNetworkResourceDelegate&&) noexcept = delete;
|
|
161
|
+
LoadNetworkResourceDelegate& operator=(
|
|
162
|
+
LoadNetworkResourceDelegate&&) noexcept = delete;
|
|
163
|
+
virtual ~LoadNetworkResourceDelegate() = default;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Called by NetworkIOAgent on handling a
|
|
167
|
+
* `Network.loadNetworkResource` CDP request. Platform implementations should
|
|
168
|
+
* override this to perform a network request of the given URL, and use
|
|
169
|
+
* listener's callbacks (via the executor) on receipt of headers, data chunks,
|
|
170
|
+
* and errors.
|
|
171
|
+
*
|
|
172
|
+
* \param params A LoadNetworkResourceRequest, including the url.
|
|
173
|
+
* \param executor A listener-scoped executor used by the delegate to execute
|
|
174
|
+
* listener callbacks on headers, data chunks, and errors. Implementations
|
|
175
|
+
* *should* call listener->setCancelFunction() to provide a lambda that can be
|
|
176
|
+
* called to abort any in-flight network operation that is no longer needed.
|
|
177
|
+
*/
|
|
178
|
+
virtual void loadNetworkResource(
|
|
179
|
+
[[maybe_unused]] const LoadNetworkResourceRequest& params,
|
|
180
|
+
[[maybe_unused]] ScopedExecutor<NetworkRequestListener> executor) = 0;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Provides an agent for handling CDP's Network.loadNetworkResource, IO.read and
|
|
185
|
+
* IO.close.
|
|
186
|
+
*
|
|
187
|
+
* Owns state of all in-progress and completed HTTP requests - ensure
|
|
188
|
+
* IO.close is used to free resources once consumed.
|
|
189
|
+
*
|
|
190
|
+
* Public methods must be called the same thread as the given executor.
|
|
191
|
+
*/
|
|
192
|
+
class NetworkIOAgent {
|
|
193
|
+
public:
|
|
194
|
+
/**
|
|
195
|
+
* \param frontendChannel A channel used to send responses to the
|
|
196
|
+
* frontend.
|
|
197
|
+
* \param executor An executor used for any callbacks provided, and for
|
|
198
|
+
* processing incoming data or other events from network operations.
|
|
199
|
+
*/
|
|
200
|
+
NetworkIOAgent(FrontendChannel frontendChannel, VoidExecutor executor)
|
|
201
|
+
: frontendChannel_(frontendChannel),
|
|
202
|
+
executor_(executor),
|
|
203
|
+
streams_(std::make_shared<StreamsMap>()) {}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Handle a CDP request. The response will be sent over the provided
|
|
207
|
+
* \c FrontendChannel synchronously or asynchronously.
|
|
208
|
+
* \param req The parsed request.
|
|
209
|
+
*/
|
|
210
|
+
bool handleRequest(
|
|
211
|
+
const cdp::PreparsedRequest& req,
|
|
212
|
+
LoadNetworkResourceDelegate& delegate);
|
|
213
|
+
|
|
214
|
+
private:
|
|
215
|
+
/**
|
|
216
|
+
* A channel used to send responses and events to the frontend.
|
|
217
|
+
*/
|
|
218
|
+
FrontendChannel frontendChannel_;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* An executor used to create NetworkRequestListener-scoped executors for the
|
|
222
|
+
* delegate.
|
|
223
|
+
*/
|
|
224
|
+
VoidExecutor executor_;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Map of stream objects, which contain data received, accept read requests
|
|
228
|
+
* and listen for delegate events. Delegates have a scoped executor for Stream
|
|
229
|
+
* instances, but Streams will not live beyond the destruction of this
|
|
230
|
+
* NetworkIOAgent instance + executor scope.
|
|
231
|
+
*
|
|
232
|
+
* This is a shared_ptr so that we may capture a weak_ptr in our
|
|
233
|
+
* Stream::create callback without creating a cycle.
|
|
234
|
+
*/
|
|
235
|
+
std::shared_ptr<StreamsMap> streams_;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Stream IDs are strings of an incrementing integer, unique within each
|
|
239
|
+
* NewtworkIOAgent instance. This stores the next one to use.
|
|
240
|
+
*/
|
|
241
|
+
unsigned long nextStreamId_{0};
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Begin loading an HTTP resource, delegating platform-specific
|
|
245
|
+
* implementation, responding to the frontend on headers received or on error.
|
|
246
|
+
* Does not catch exceptions thrown by the delegate (such as
|
|
247
|
+
* NotImplementedException).
|
|
248
|
+
*/
|
|
249
|
+
void handleLoadNetworkResource(
|
|
250
|
+
const cdp::PreparsedRequest& req,
|
|
251
|
+
LoadNetworkResourceDelegate& delegate);
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Handle an IO.read CDP request. Emit a chunk of data from the stream, once
|
|
255
|
+
* enough has been downloaded, or report an error.
|
|
256
|
+
*/
|
|
257
|
+
void handleIoRead(const cdp::PreparsedRequest& req);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Handle an IO.close CDP request. Safely aborts any in-flight request.
|
|
261
|
+
* Reports CDP ok if the stream is found, or a CDP error if not.
|
|
262
|
+
*/
|
|
263
|
+
void handleIoClose(const cdp::PreparsedRequest& req);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
} // namespace facebook::react::jsinspector_modern
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include <vector>
|
|
11
|
+
|
|
12
|
+
namespace facebook::react::jsinspector_modern {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Takes a vector of bytes representing a fragment of a UTF-8 string, and
|
|
16
|
+
* removes the minimum number (0-3) of trailing bytes so that the remainder is
|
|
17
|
+
* valid UTF-8. Useful for slicing binary data into UTF-8 strings.
|
|
18
|
+
*
|
|
19
|
+
* \param buffer Buffer to operate on - will be resized if necessary.
|
|
20
|
+
*/
|
|
21
|
+
inline void truncateToValidUTF8(std::vector<char>& buffer) {
|
|
22
|
+
const auto length = buffer.size();
|
|
23
|
+
// Ensure we don't cut a UTF-8 code point in the middle by removing any
|
|
24
|
+
// trailing bytes representing an incomplete UTF-8 code point.
|
|
25
|
+
|
|
26
|
+
// If the last byte is a UTF-8 first byte or continuation byte (topmost bit
|
|
27
|
+
// is 1) (otherwise the last char is ASCII and we don't need to do
|
|
28
|
+
// anything).
|
|
29
|
+
if (length > 0 && (buffer[length - 1] & 0b10000000) == 0b10000000) {
|
|
30
|
+
size_t continuationBytes = 0; // [Windows #13587]
|
|
31
|
+
// Find the first byte of the UTF-8 code point (topmost bits 11) and count
|
|
32
|
+
// the number of continuation bytes following it.
|
|
33
|
+
while ((buffer[length - continuationBytes - 1] & 0b11000000) !=
|
|
34
|
+
0b11000000) {
|
|
35
|
+
continuationBytes++;
|
|
36
|
+
if (continuationBytes > 3 || continuationBytes >= length - 1) {
|
|
37
|
+
throw std::runtime_error("Invalid UTF-8 sequence");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
char firstByteOfSequence = buffer[length - continuationBytes - 1];
|
|
41
|
+
// Check for the special case that our original cut point was at the end
|
|
42
|
+
// of a UTF-8 code-point, and therefore already valid. This will be the
|
|
43
|
+
// case if the first byte indicates continuationBytes continuation bytes
|
|
44
|
+
// should follow, i.e. its top bits are (1+continuationBytes) 1's followed
|
|
45
|
+
// by a 0.
|
|
46
|
+
char mask = static_cast<char>(0b11111000 << (3 - continuationBytes));
|
|
47
|
+
char expectedBitsAfterMask = static_cast<char>(mask << 1);
|
|
48
|
+
if (continuationBytes == 0 ||
|
|
49
|
+
(firstByteOfSequence & mask) != expectedBitsAfterMask) {
|
|
50
|
+
// Remove the trailing continuation bytes, if any, and the first byte.
|
|
51
|
+
buffer.resize(length - (continuationBytes + 1));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
} // namespace facebook::react::jsinspector_modern
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
#include <react/bridging/Class.h>
|
|
14
14
|
// #include <react/bridging/Dynamic.h> // Line causes Error C1083 Cannot open include file: 'double-conversion/double-conversion.h' #11644
|
|
15
15
|
#include <react/bridging/Error.h>
|
|
16
|
-
#include <react/bridging/EventEmitter.h>
|
|
16
|
+
#include <react/bridging/EventEmitter.h> // [Windows #13391]
|
|
17
17
|
#include <react/bridging/Function.h>
|
|
18
18
|
#include <react/bridging/Number.h>
|
|
19
19
|
#include <react/bridging/Object.h>
|
|
20
20
|
#include <react/bridging/Promise.h>
|
|
21
|
-
#include <react/bridging/Value.h>
|
|
21
|
+
#include <react/bridging/Value.h> // [Windows #13391]
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// [Windows #13391]
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <jsi/jsi.h>
|
|
13
|
+
|
|
14
|
+
#include <optional>
|
|
15
|
+
#include <type_traits>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react::bridging {
|
|
18
|
+
|
|
19
|
+
// std::remove_cvref_t is not available until C++20.
|
|
20
|
+
template <typename T>
|
|
21
|
+
using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
|
|
22
|
+
|
|
23
|
+
template <typename T>
|
|
24
|
+
inline constexpr bool is_jsi_v =
|
|
25
|
+
std::is_same_v<jsi::Value, remove_cvref_t<T>> ||
|
|
26
|
+
std::is_same_v<jsi::String, remove_cvref_t<T>> ||
|
|
27
|
+
std::is_base_of_v<jsi::Object, remove_cvref_t<T>>;
|
|
28
|
+
|
|
29
|
+
template <typename>
|
|
30
|
+
struct is_optional : std::false_type {};
|
|
31
|
+
|
|
32
|
+
template <typename T>
|
|
33
|
+
struct is_optional<std::optional<T>> : std::true_type {};
|
|
34
|
+
|
|
35
|
+
template <typename T>
|
|
36
|
+
inline constexpr bool is_optional_v = is_optional<T>::value;
|
|
37
|
+
|
|
38
|
+
template <typename T, typename = void>
|
|
39
|
+
inline constexpr bool is_optional_jsi_v = false;
|
|
40
|
+
|
|
41
|
+
template <typename T>
|
|
42
|
+
inline constexpr bool
|
|
43
|
+
is_optional_jsi_v<T, typename std::enable_if_t<is_optional_v<T>>> =
|
|
44
|
+
is_jsi_v<typename T::value_type>;
|
|
45
|
+
|
|
46
|
+
template <typename T>
|
|
47
|
+
struct Converter;
|
|
48
|
+
|
|
49
|
+
template <typename T>
|
|
50
|
+
struct ConverterBase {
|
|
51
|
+
using BaseT = remove_cvref_t<T>;
|
|
52
|
+
|
|
53
|
+
ConverterBase(jsi::Runtime& rt, T&& value)
|
|
54
|
+
: rt_(rt), value_(std::forward<T>(value)) {}
|
|
55
|
+
|
|
56
|
+
operator BaseT() && {
|
|
57
|
+
if constexpr (std::is_lvalue_reference_v<T>) {
|
|
58
|
+
// Copy the reference into a Value that then can be moved from.
|
|
59
|
+
auto value = jsi::Value(rt_, value_);
|
|
60
|
+
|
|
61
|
+
if constexpr (std::is_same_v<BaseT, jsi::Value>) {
|
|
62
|
+
return std::move(value);
|
|
63
|
+
} else if constexpr (std::is_same_v<BaseT, jsi::String>) {
|
|
64
|
+
return std::move(value).getString(rt_);
|
|
65
|
+
} else if constexpr (std::is_same_v<BaseT, jsi::Object>) {
|
|
66
|
+
return std::move(value).getObject(rt_);
|
|
67
|
+
} else if constexpr (std::is_same_v<BaseT, jsi::Array>) {
|
|
68
|
+
return std::move(value).getObject(rt_).getArray(rt_);
|
|
69
|
+
} else if constexpr (std::is_same_v<BaseT, jsi::Function>) {
|
|
70
|
+
return std::move(value).getObject(rt_).getFunction(rt_);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
return std::move(value_);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
template <
|
|
78
|
+
typename U,
|
|
79
|
+
std::enable_if_t<
|
|
80
|
+
std::is_lvalue_reference_v<T> &&
|
|
81
|
+
// Ensure non-reference type can be converted to the desired type.
|
|
82
|
+
std::is_convertible_v<Converter<BaseT>, U>,
|
|
83
|
+
int> = 0>
|
|
84
|
+
operator U() && {
|
|
85
|
+
return Converter<BaseT>(rt_, std::move(*this).operator BaseT());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
template <
|
|
89
|
+
typename U,
|
|
90
|
+
std::enable_if_t<is_jsi_v<T> && std::is_same_v<U, jsi::Value>, int> = 0>
|
|
91
|
+
operator U() && = delete; // Prevent unwanted upcasting of JSI values.
|
|
92
|
+
|
|
93
|
+
protected:
|
|
94
|
+
jsi::Runtime& rt_;
|
|
95
|
+
T value_;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
template <typename T>
|
|
99
|
+
struct Converter : public ConverterBase<T> {
|
|
100
|
+
using ConverterBase<T>::ConverterBase;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
template <>
|
|
104
|
+
struct Converter<jsi::Value> : public ConverterBase<jsi::Value> {
|
|
105
|
+
using ConverterBase<jsi::Value>::ConverterBase;
|
|
106
|
+
|
|
107
|
+
operator jsi::String() && {
|
|
108
|
+
return std::move(value_).asString(rt_);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
operator jsi::Object() && {
|
|
112
|
+
return std::move(value_).asObject(rt_);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
operator jsi::Array() && {
|
|
116
|
+
return std::move(value_).asObject(rt_).asArray(rt_);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
operator jsi::Function() && {
|
|
120
|
+
return std::move(value_).asObject(rt_).asFunction(rt_);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
template <>
|
|
125
|
+
struct Converter<jsi::Object> : public ConverterBase<jsi::Object> {
|
|
126
|
+
using ConverterBase<jsi::Object>::ConverterBase;
|
|
127
|
+
|
|
128
|
+
operator jsi::Array() && {
|
|
129
|
+
return std::move(value_).asArray(rt_);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
operator jsi::Function() && {
|
|
133
|
+
return std::move(value_).asFunction(rt_);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
template <typename T>
|
|
138
|
+
struct Converter<std::optional<T>> : public ConverterBase<jsi::Value> {
|
|
139
|
+
Converter(jsi::Runtime& rt, std::optional<T> value)
|
|
140
|
+
: ConverterBase(rt, value ? std::move(*value) : jsi::Value::null()) {}
|
|
141
|
+
|
|
142
|
+
operator std::optional<T>() && {
|
|
143
|
+
if (value_.isNull() || value_.isUndefined()) {
|
|
144
|
+
return {};
|
|
145
|
+
}
|
|
146
|
+
return std::move(value_);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
template <typename T, std::enable_if_t<is_jsi_v<T>, int> = 0>
|
|
151
|
+
auto convert(jsi::Runtime& rt, T&& value) {
|
|
152
|
+
return Converter<T>(rt, std::forward<T>(value));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
template <
|
|
156
|
+
typename T,
|
|
157
|
+
std::enable_if_t<is_jsi_v<T> || std::is_scalar_v<T>, int> = 0>
|
|
158
|
+
auto convert(jsi::Runtime& rt, std::optional<T> value) {
|
|
159
|
+
return Converter<std::optional<T>>(rt, std::move(value));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
template <typename T, std::enable_if_t<std::is_scalar_v<T>, int> = 0>
|
|
163
|
+
auto convert(jsi::Runtime& rt, T&& value) {
|
|
164
|
+
return value;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
template <typename T>
|
|
168
|
+
auto convert(jsi::Runtime& rt, Converter<T>&& converter) {
|
|
169
|
+
return std::move(converter);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
} // namespace facebook::react::bridging
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// [Windows #13391]
|
|
9
|
+
|
|
8
10
|
#pragma once
|
|
9
11
|
|
|
10
|
-
#include <Function.h> // [Windows]
|
|
12
|
+
#include <Function.h> // [Windows #13391]
|
|
11
13
|
#include <functional>
|
|
12
14
|
#include <memory>
|
|
13
15
|
#include <mutex>
|
|
@@ -104,10 +106,7 @@ class AsyncEventEmitter : public IAsyncEventEmitter {
|
|
|
104
106
|
jsi::Object get(
|
|
105
107
|
jsi::Runtime& rt,
|
|
106
108
|
const std::shared_ptr<CallInvoker>& jsInvoker) const override {
|
|
107
|
-
|
|
108
|
-
result.setProperty(
|
|
109
|
-
rt, "addListener", bridging::toJs(rt, listen_, jsInvoker));
|
|
110
|
-
return result;
|
|
109
|
+
return bridging::toJs(rt, listen_, jsInvoker);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
private:
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#pragma once
|
|
9
9
|
|
|
10
|
-
#include <Base.h> // [Windows]
|
|
11
|
-
#include <CallbackWrapper.h> // [Windows]
|
|
10
|
+
#include <Base.h> // [Windows #13391]
|
|
11
|
+
#include <CallbackWrapper.h> // [Windows #13391]
|
|
12
12
|
|
|
13
13
|
#include <ReactCommon/CallInvoker.h>
|
|
14
14
|
#include <ReactCommon/SchedulerPriority.h>
|
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
#include <string>
|
|
12
12
|
|
|
13
13
|
#include <jsi/jsi.h>
|
|
14
|
-
#include <
|
|
15
|
-
|
|
14
|
+
#include <LongLivedObject.h> // [Windows #13391]
|
|
15
|
+
|
|
16
|
+
#include <CallbackWrapper.h> // [Windows #13391]
|
|
16
17
|
|
|
17
18
|
namespace facebook::react {
|
|
18
19
|
|
|
@@ -91,6 +91,15 @@ ScrollViewProps::ScrollViewProps(
|
|
|
91
91
|
"automaticallyAdjustsScrollIndicatorInsets",
|
|
92
92
|
sourceProps.automaticallyAdjustsScrollIndicatorInsets,
|
|
93
93
|
true)),
|
|
94
|
+
automaticallyAdjustKeyboardInsets(
|
|
95
|
+
CoreFeatures::enablePropIteratorSetter
|
|
96
|
+
? sourceProps.automaticallyAdjustKeyboardInsets
|
|
97
|
+
: convertRawProp(
|
|
98
|
+
context,
|
|
99
|
+
rawProps,
|
|
100
|
+
"automaticallyAdjustKeyboardInsets",
|
|
101
|
+
sourceProps.automaticallyAdjustKeyboardInsets,
|
|
102
|
+
false)),
|
|
94
103
|
decelerationRate(
|
|
95
104
|
CoreFeatures::enablePropIteratorSetter
|
|
96
105
|
? sourceProps.decelerationRate
|