react-native-windows 0.74.11 → 0.75.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 +8 -2
- package/Common/Common.vcxproj +8 -0
- package/Common/Utilities.cpp +2 -2
- package/Directory.Build.targets +5 -0
- package/Folly/Folly.vcxproj +10 -2
- package/Folly/Folly.vcxproj.filters +0 -7
- package/Folly/TEMP_UntilFollyUpdate/ConstexprMath.h +970 -0
- package/Folly/TEMP_UntilFollyUpdate/json.cpp +1110 -0
- package/Folly/TEMP_UntilFollyUpdate/lang/ToAscii.cpp +4 -2
- package/Libraries/Animated/AnimatedImplementation.js +2 -0
- package/Libraries/Animated/NativeAnimatedHelper.js +4 -0
- package/Libraries/Animated/createAnimatedComponent.js +10 -4
- package/Libraries/Animated/useAnimatedProps.js +56 -28
- package/Libraries/BatchedBridge/MessageQueue.js +1 -0
- package/Libraries/Components/Button.js +10 -5
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +11 -2
- package/Libraries/Components/Flyout/Flyout.js +10 -10
- package/Libraries/Components/Flyout/FlyoutNativeComponent.js +8 -7
- package/Libraries/Components/Pressable/Pressable.js +13 -6
- package/Libraries/Components/Pressable/Pressable.windows.js +13 -6
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +4 -0
- package/Libraries/Components/ScrollView/ScrollView.js +109 -29
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +13 -1
- package/Libraries/Components/StatusBar/StatusBar.js +1 -21
- package/Libraries/Components/Switch/Switch.windows.js +2 -0
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +0 -15
- package/Libraries/Components/TextInput/InputAccessoryView.js +10 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +0 -12
- package/Libraries/Components/TextInput/TextInput.d.ts +0 -19
- package/Libraries/Components/TextInput/TextInput.js +14 -70
- package/Libraries/Components/TextInput/TextInput.windows.js +15 -72
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +27 -12
- package/Libraries/Components/Touchable/Touchable.js +2 -2
- package/Libraries/Components/Touchable/TouchableHighlight.d.ts +4 -10
- package/Libraries/Components/Touchable/TouchableHighlight.js +3 -1
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +3 -1
- package/Libraries/Components/Touchable/TouchableOpacity.d.ts +4 -32
- package/Libraries/Components/Touchable/TouchableOpacity.js +3 -1
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +3 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +8 -0
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +117 -111
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +129 -110
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +6 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +1 -0
- package/Libraries/Components/View/View.js +0 -11
- package/Libraries/Components/View/View.windows.js +0 -11
- package/Libraries/Components/View/ViewAccessibility.js +4 -4
- package/Libraries/Components/View/ViewAccessibility.windows.js +4 -4
- package/Libraries/Components/View/ViewPropTypes.d.ts +21 -59
- package/Libraries/Components/View/ViewPropTypes.js +7 -0
- package/Libraries/Components/View/ViewPropTypes.windows.js +7 -0
- package/Libraries/Core/Devtools/loadBundleFromServer.js +3 -3
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +153 -0
- package/Libraries/Core/Devtools/parseErrorStack.js +5 -5
- package/Libraries/Core/Devtools/parseHermesStack.js +22 -16
- package/Libraries/Core/ErrorHandlers.js +116 -0
- package/Libraries/Core/ExceptionsManager.js +2 -2
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpDeveloperTools.js +3 -1
- package/Libraries/Core/setUpPerformance.js +6 -4
- package/Libraries/Core/setUpReactDevTools.js +70 -10
- package/Libraries/Core/setUpTimers.js +50 -31
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +1 -1
- package/Libraries/Image/Image.android.js +23 -13
- package/Libraries/Image/Image.d.ts +14 -15
- package/Libraries/Image/Image.ios.js +21 -11
- package/Libraries/Image/Image.windows.js +21 -11
- package/Libraries/Image/ImageProps.js +16 -5
- package/Libraries/Image/ImageTypes.flow.js +7 -2
- package/Libraries/Image/ImageUtils.js +1 -0
- package/Libraries/Image/ImageViewNativeComponent.js +2 -1
- package/Libraries/Inspector/ElementBox.js +6 -3
- package/Libraries/Inspector/ElementProperties.js +1 -1
- package/Libraries/Interaction/TouchHistoryMath.js +4 -4
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +6 -26
- package/Libraries/JSInspector/NetworkAgent.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +39 -29
- package/Libraries/LogBox/Data/LogBoxLog.js +114 -2
- package/Libraries/LogBox/Data/parseLogBoxLog.js +168 -53
- package/Libraries/LogBox/LogBox.js +29 -12
- package/Libraries/LogBox/LogBoxNotificationContainer.js +4 -0
- package/Libraries/LogBox/UI/LogBoxInspector.js +8 -70
- package/Libraries/LogBox/UI/LogBoxInspectorBody.js +87 -0
- package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +6 -42
- package/Libraries/LogBox/UI/LogBoxInspectorFooterButton.js +58 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +5 -66
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.windows.js +5 -66
- package/Libraries/LogBox/UI/LogBoxInspectorHeaderButton.js +76 -0
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +8 -5
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +8 -5
- package/Libraries/LogBox/UI/LogBoxNotification.js +13 -152
- package/Libraries/LogBox/UI/LogBoxNotificationCountBadge.js +63 -0
- package/Libraries/LogBox/UI/LogBoxNotificationDismissButton.js +67 -0
- package/Libraries/LogBox/UI/LogBoxNotificationMessage.js +57 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +5 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +5 -0
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +5 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +12 -5
- package/Libraries/NativeComponent/StaticViewConfigValidator.js +3 -0
- package/Libraries/Network/XMLHttpRequest.js +5 -1
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +3 -3
- package/Libraries/Pressability/Pressability.js +3 -51
- package/Libraries/Pressability/Pressability.windows.js +3 -51
- package/Libraries/ReactNative/AppRegistry.d.ts +4 -0
- package/Libraries/ReactNative/AppRegistry.js +2 -4
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -21
- package/Libraries/ReactNative/FabricUIManager.js +0 -51
- package/Libraries/ReactNative/ReactFabricPublicInstance/warnForStyleProps.js +1 -0
- package/Libraries/ReactNative/RendererImplementation.js +20 -2
- package/Libraries/ReactNative/UIManager.d.ts +0 -21
- package/Libraries/ReactNative/UIManagerProperties.js +0 -3
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +5 -341
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -8
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +15682 -27088
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +5082 -4381
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +3480 -2571
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +15943 -27543
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5303 -4606
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +3450 -2572
- package/Libraries/Renderer/shims/ReactFabric.js +2 -2
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +2 -3
- package/Libraries/Renderer/shims/ReactNativeTypes.js +24 -3
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -2
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/Share/Share.d.ts +16 -10
- package/Libraries/Share/Share.js +14 -15
- package/Libraries/StyleSheet/StyleSheet.d.ts +1 -1
- package/Libraries/StyleSheet/StyleSheet.js +3 -10
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +21 -21
- package/Libraries/StyleSheet/StyleSheetTypes.js +24 -18
- package/Libraries/StyleSheet/flattenStyle.js +1 -0
- package/Libraries/StyleSheet/processFilter.js +132 -0
- package/Libraries/StyleSheet/processTransform.js +18 -3
- package/Libraries/Text/Text.js +151 -128
- package/Libraries/Text/Text.windows.js +144 -127
- package/Libraries/Text/TextNativeComponent.js +5 -4
- package/Libraries/Text/TextProps.js +6 -6
- package/Libraries/Text/TextProps.windows.js +6 -6
- package/Libraries/TurboModule/TurboModuleRegistry.js +2 -1
- package/Libraries/Types/CodegenTypes.js +3 -0
- package/Libraries/Utilities/{LoadingView.android.js → DevLoadingView.js} +33 -11
- package/Libraries/Utilities/Dimensions.js +1 -0
- package/Libraries/Utilities/HMRClient.js +36 -8
- package/Libraries/Utilities/HMRClientProdShim.js +1 -0
- package/Libraries/Utilities/NativePlatformConstantsWin.js +2 -2
- package/Libraries/Utilities/Platform.android.js +4 -4
- package/Libraries/Utilities/RCTLog.js +1 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +12 -24
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +11 -6
- package/Libraries/__tests__/ViewWindows-test.js +6 -6
- package/Libraries/promiseRejectionTrackingOptions.js +1 -0
- package/Microsoft.ReactNative/Base/FollyIncludes.h +1 -1
- package/Microsoft.ReactNative/ComponentView.idl +0 -17
- package/Microsoft.ReactNative/Fabric/AbiState.cpp +3 -45
- package/Microsoft.ReactNative/Fabric/AbiState.h +0 -6
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +1 -4
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +10 -6
- package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +0 -10
- package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +0 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +29 -45
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +1 -3
- package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +7 -12
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.cpp +9 -3
- package/Microsoft.ReactNative/Fabric/Composition/UriImageManager.h +1 -1
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +11 -18
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +3 -5
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +23 -16
- package/Microsoft.ReactNative/Fabric/WindowsImageManager.h +5 -2
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +2 -10
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +107 -36
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +18 -12
- package/Microsoft.ReactNative/Modules/DevSettingsModule.cpp +4 -0
- package/Microsoft.ReactNative/Modules/DevSettingsModule.h +1 -0
- package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +1 -2
- package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +7 -4
- package/Microsoft.ReactNative/Modules/NativeUIManager.h +1 -1
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.cpp +2 -2
- package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.h +3 -3
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +11 -17
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.h +1 -1
- package/Microsoft.ReactNative/Timer.idl +1 -3
- package/Microsoft.ReactNative/Utils/BatchingEventEmitter.cpp +1 -1
- package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +2 -3
- package/Microsoft.ReactNative/Utils/ValueUtils.cpp +1 -1
- package/Microsoft.ReactNative/Views/DynamicAutomationPeer.cpp +2 -2
- package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +1 -1
- package/Microsoft.ReactNative/packages.lock.json +45 -72
- package/Microsoft.ReactNative.Cxx/JSI/LongLivedJsiValue.h +1 -1
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +5 -0
- package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +1 -0
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.cpp +14 -6
- package/Microsoft.ReactNative.Cxx/TurboModuleProvider.h +2 -2
- package/Microsoft.ReactNative.Managed/Microsoft.ReactNative.Managed.csproj +1 -1
- package/Microsoft.ReactNative.Managed/packages.lock.json +3 -3
- package/PropertySheets/ARM64EC.props +13 -0
- package/PropertySheets/Application/ARM64EC.props +13 -0
- package/PropertySheets/DynamicLibrary/ARM64EC.props +13 -0
- package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +4 -4
- package/PropertySheets/Generated/PackageVersion.g.props +4 -4
- package/PropertySheets/JSEngine.props +2 -0
- package/PropertySheets/StaticLibrary/ARM64EC.props +13 -0
- package/README.md +21 -21
- package/ReactCommon/ReactCommon.vcxproj +11 -1
- package/ReactCommon/ReactCommon.vcxproj.filters +19 -12
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +67 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +180 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +351 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +6 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Base.h +152 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +2 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +13 -15
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/EventEmitter.h +137 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Function.h +283 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.cpp +7 -10
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +162 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +2 -4
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +33 -8
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.cpp +45 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/JSRuntimeFactory.h +67 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +104 -74
- package/Scripts/StripAdditionalPlatformsFromNuspec.ps1 +1 -1
- package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +4 -0
- package/Scripts/rnw-dependencies.ps1 +36 -23
- package/Shared/HermesRuntimeHolder.cpp +19 -1
- package/Shared/HermesRuntimeHolder.h +8 -1
- package/Shared/HermesSamplingProfiler.cpp +1 -2
- package/Shared/Networking/WinRTWebSocketResource.cpp +3 -3
- package/Shared/OInstance.cpp +1 -2
- package/Shared/Shared.vcxitems +21 -15
- package/Shared/Shared.vcxitems.filters +8 -3
- package/Shared/Threading/BatchingQueueThread.cpp +6 -2
- package/Shared/Threading/BatchingQueueThread.h +2 -2
- package/Shared/Utils/CppWinrtLessExceptions.h +2 -2
- package/codegen/NativeAppStateSpec.g.h +8 -8
- package/codegen/NativeBlobModuleSpec.g.h +0 -10
- package/codegen/NativeDOMSpec.g.h +136 -0
- package/codegen/NativeDevSettingsSpec.g.h +11 -5
- package/codegen/NativeIdleCallbacksSpec.g.h +64 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +14 -14
- package/codegen/NativeMicrotasksSpec.g.h +34 -0
- package/codegen/NativePerformanceSpec.g.h +35 -7
- package/codegen/NativePlatformConstantsWindowsSpec.g.h +81 -0
- package/codegen/NativePushNotificationManagerIOSSpec.g.h +15 -19
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +111 -39
- package/codegen/NativeUIManagerSpec.g.h +5 -17
- package/codegen/react/components/rnwcore/Props.cpp +1 -1
- package/codegen/react/components/rnwcore/Props.h +16 -12
- package/codegen/react/components/rnwcore/States.h +0 -26
- package/codegen/rnwcoreJSI-generated.cpp +688 -463
- package/codegen/rnwcoreJSI.h +1374 -2867
- package/fmt/TEMP_UntilFmtUpdate/core.h +2925 -0
- package/fmt/fmt.vcxproj +10 -2
- package/jest/mockComponent.js +7 -0
- package/jest/renderer.js +25 -14
- package/jest/setup.js +19 -13
- package/package.json +29 -27
- package/rn-get-polyfills.js +1 -0
- package/src/private/core/composeStyles.js +27 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +93 -33
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +23 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +56 -0
- package/src/private/fusebox/setUpFuseboxReactDevToolsDispatcher.js +108 -0
- package/src/private/specs/modules/NativeBlobModule.js +4 -2
- package/src/private/specs/modules/NativeDevSettings.js +1 -0
- package/src/private/specs/modules/NativePushNotificationManagerIOS.js +0 -4
- package/src/private/specs/modules/NativeUIManager.js +0 -7
- package/src/private/webapis/dom/geometry/DOMRectReadOnly.js +24 -24
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +11 -14
- package/src/private/webapis/dom/nodes/ReadOnlyCharacterData.js +2 -3
- package/src/private/webapis/dom/nodes/ReadOnlyElement.js +24 -54
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +5 -13
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +468 -0
- package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +413 -0
- package/src/private/webapis/dom/oldstylecollections/DOMRectList.js +4 -4
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +4 -4
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +5 -5
- package/src/private/webapis/idlecallbacks/specs/NativeIdleCallbacks.js +34 -0
- package/src/private/webapis/microtasks/specs/NativeMicrotasks.js +21 -0
- package/src/private/webapis/performance/EventCounts.js +1 -1
- package/src/private/webapis/performance/MemoryInfo.js +9 -9
- package/src/private/webapis/performance/Performance.js +10 -56
- package/src/private/webapis/performance/PerformanceObserver.js +30 -22
- package/src/private/webapis/performance/RawPerformanceEntry.js +2 -7
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +18 -18
- package/src/private/webapis/performance/UserTiming.js +63 -0
- package/src/private/webapis/performance/{NativePerformance.js → specs/NativePerformance.js} +3 -2
- package/src/private/webapis/performance/{NativePerformanceObserver.js → specs/NativePerformanceObserver.js} +2 -2
- package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformance.js +1 -1
- package/src/private/webapis/performance/{__mocks__ → specs/__mocks__}/NativePerformanceObserver.js +3 -4
- package/stubs/glog/logging.h +1 -0
- package/template/cpp-lib/proj/MyLib.vcxproj +1 -1
- package/template/cs-lib/proj/MyLib.csproj +1 -1
- package/template/metro.config.js +13 -2
- package/templates/cpp-app/template.config.js +1 -1
- package/templates/cpp-lib/example/metro.config.js +2 -2
- package/templates/cpp-lib/template.config.js +1 -1
- package/templates/old/generateWrapper.js +4 -1
- package/types/modules/globals.d.ts +4 -0
- package/Libraries/Lists/FlatList.windows.js +0 -717
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +0 -13
- package/Libraries/Utilities/LoadingView.ios.js +0 -50
- package/Libraries/Utilities/LoadingView.js +0 -16
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp +0 -178
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.cpp +0 -39
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.h +0 -31
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/YGEnums.h +0 -137
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +0 -2377
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +0 -140
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +0 -92
- package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/enums/ExperimentalFeature.h +0 -40
- 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 -366
- package/codegen/NativeAnimationsDebugModuleSpec.g.h +0 -40
- package/codegen/NativePlatformConstantsWinSpec.g.h +0 -81
- package/jest/ReactNativeInternalFeatureFlagsMock.js +0 -13
- package/src/private/featureflags/NativeReactNativeFeatureFlags.js +0 -44
- package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +0 -92
- package/src/private/specs/modules/NativeAnimationsDebugModule.js +0 -20
- package/src/private/webapis/dom/oldstylecollections/__tests__/DOMRectList-test.js +0 -85
- package/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-test.js +0 -80
- package/src/private/webapis/dom/oldstylecollections/__tests__/NodeList-test.js +0 -161
- package/src/private/webapis/performance/__tests__/EventCounts-test.js +0 -116
- package/src/private/webapis/performance/__tests__/NativePerformanceMock-test.js +0 -82
- package/src/private/webapis/performance/__tests__/NativePerformanceObserverMock-test.js +0 -108
- package/src/private/webapis/performance/__tests__/Performance-test.js +0 -117
- package/src/private/webapis/performance/__tests__/PerformanceObserver-test.js +0 -208
- package/template/metro.devMode.config.js +0 -56
- /package/src/private/specs/modules/{NativePlatformConstantsWin.js → NativePlatformConstantsWindows.js} +0 -0
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#include <algorithm>
|
|
9
|
-
#include <cstddef>
|
|
10
|
-
#include <iostream>
|
|
11
|
-
|
|
12
|
-
#include <yoga/debug/AssertFatal.h>
|
|
13
|
-
#include <yoga/node/Node.h>
|
|
14
|
-
#include <yoga/numeric/Comparison.h>
|
|
15
|
-
|
|
16
|
-
namespace facebook::yoga {
|
|
17
|
-
|
|
18
|
-
Node::Node() : Node{&Config::getDefault()} {}
|
|
19
|
-
|
|
20
|
-
Node::Node(const yoga::Config* config) : config_{config} {
|
|
21
|
-
yoga::assertFatal(
|
|
22
|
-
config != nullptr, "Attempting to construct Node with null config");
|
|
23
|
-
|
|
24
|
-
if (config->useWebDefaults()) {
|
|
25
|
-
useWebDefaults();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
Node::Node(Node&& node) {
|
|
30
|
-
hasNewLayout_ = node.hasNewLayout_;
|
|
31
|
-
isReferenceBaseline_ = node.isReferenceBaseline_;
|
|
32
|
-
isDirty_ = node.isDirty_;
|
|
33
|
-
alwaysFormsContainingBlock_ = node.alwaysFormsContainingBlock_;
|
|
34
|
-
nodeType_ = node.nodeType_;
|
|
35
|
-
context_ = node.context_;
|
|
36
|
-
measureFunc_ = node.measureFunc_;
|
|
37
|
-
baselineFunc_ = node.baselineFunc_;
|
|
38
|
-
dirtiedFunc_ = node.dirtiedFunc_;
|
|
39
|
-
style_ = node.style_;
|
|
40
|
-
layout_ = node.layout_;
|
|
41
|
-
lineIndex_ = node.lineIndex_;
|
|
42
|
-
owner_ = node.owner_;
|
|
43
|
-
children_ = std::move(node.children_);
|
|
44
|
-
config_ = node.config_;
|
|
45
|
-
resolvedDimensions_ = node.resolvedDimensions_;
|
|
46
|
-
for (auto c : children_) {
|
|
47
|
-
c->setOwner(this);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
YGSize Node::measure(
|
|
52
|
-
float width,
|
|
53
|
-
MeasureMode widthMode,
|
|
54
|
-
float height,
|
|
55
|
-
MeasureMode heightMode) {
|
|
56
|
-
return measureFunc_(
|
|
57
|
-
this, width, unscopedEnum(widthMode), height, unscopedEnum(heightMode));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
float Node::baseline(float width, float height) const {
|
|
61
|
-
return baselineFunc_(this, width, height);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
float Node::dimensionWithMargin(
|
|
65
|
-
const FlexDirection axis,
|
|
66
|
-
const float widthSize) {
|
|
67
|
-
return getLayout().measuredDimension(dimension(axis)) +
|
|
68
|
-
style_.computeMarginForAxis(axis, widthSize);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
bool Node::isLayoutDimensionDefined(const FlexDirection axis) {
|
|
72
|
-
const float value = getLayout().measuredDimension(dimension(axis));
|
|
73
|
-
return yoga::isDefined(value) && value >= 0.0f;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Setters
|
|
77
|
-
|
|
78
|
-
void Node::setMeasureFunc(YGMeasureFunc measureFunc) {
|
|
79
|
-
if (measureFunc == nullptr) {
|
|
80
|
-
// TODO: t18095186 Move nodeType to opt-in function and mark appropriate
|
|
81
|
-
// places in Litho
|
|
82
|
-
setNodeType(NodeType::Default);
|
|
83
|
-
} else {
|
|
84
|
-
yoga::assertFatalWithNode(
|
|
85
|
-
this,
|
|
86
|
-
children_.size() == 0,
|
|
87
|
-
"Cannot set measure function: Nodes with measure functions cannot have "
|
|
88
|
-
"children.");
|
|
89
|
-
// TODO: t18095186 Move nodeType to opt-in function and mark appropriate
|
|
90
|
-
// places in Litho
|
|
91
|
-
setNodeType(NodeType::Text);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
measureFunc_ = measureFunc;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
void Node::replaceChild(Node* child, size_t index) {
|
|
98
|
-
children_[index] = child;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
void Node::replaceChild(Node* oldChild, Node* newChild) {
|
|
102
|
-
std::replace(children_.begin(), children_.end(), oldChild, newChild);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
void Node::insertChild(Node* child, size_t index) {
|
|
106
|
-
children_.insert(children_.begin() + static_cast<ptrdiff_t>(index), child);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
void Node::setConfig(yoga::Config* config) {
|
|
110
|
-
yoga::assertFatal(
|
|
111
|
-
config != nullptr, "Attempting to set a null config on a Node");
|
|
112
|
-
yoga::assertFatalWithConfig(
|
|
113
|
-
config,
|
|
114
|
-
config->useWebDefaults() == config_->useWebDefaults(),
|
|
115
|
-
"UseWebDefaults may not be changed after constructing a Node");
|
|
116
|
-
|
|
117
|
-
if (yoga::configUpdateInvalidatesLayout(*config_, *config)) {
|
|
118
|
-
markDirtyAndPropagate();
|
|
119
|
-
layout_.configVersion = 0; // [Windows #13409]
|
|
120
|
-
} else { // [Windows #13409]
|
|
121
|
-
// If the config is functionally the same, then align the configVersion so
|
|
122
|
-
// that we can reuse the layout cache
|
|
123
|
-
layout_.configVersion = config->getVersion(); // [Windows #13409]
|
|
124
|
-
}
|
|
125
|
-
config_ = config;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
void Node::setDirty(bool isDirty) {
|
|
129
|
-
if (isDirty == isDirty_) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
isDirty_ = isDirty;
|
|
133
|
-
if (isDirty && dirtiedFunc_) {
|
|
134
|
-
dirtiedFunc_(this);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
bool Node::removeChild(Node* child) {
|
|
139
|
-
std::vector<Node*>::iterator p =
|
|
140
|
-
std::find(children_.begin(), children_.end(), child);
|
|
141
|
-
if (p != children_.end()) {
|
|
142
|
-
children_.erase(p);
|
|
143
|
-
return true;
|
|
144
|
-
}
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
void Node::removeChild(size_t index) {
|
|
149
|
-
children_.erase(children_.begin() + static_cast<ptrdiff_t>(index));
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
void Node::setLayoutDirection(Direction direction) {
|
|
153
|
-
layout_.setDirection(direction);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
void Node::setLayoutMargin(float margin, PhysicalEdge edge) {
|
|
157
|
-
layout_.setMargin(edge, margin);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
void Node::setLayoutBorder(float border, PhysicalEdge edge) {
|
|
161
|
-
layout_.setBorder(edge, border);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
void Node::setLayoutPadding(float padding, PhysicalEdge edge) {
|
|
165
|
-
layout_.setPadding(edge, padding);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
void Node::setLayoutLastOwnerDirection(Direction direction) {
|
|
169
|
-
layout_.lastOwnerDirection = direction;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
void Node::setLayoutComputedFlexBasis(const FloatOptional computedFlexBasis) {
|
|
173
|
-
layout_.computedFlexBasis = computedFlexBasis;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
void Node::setLayoutPosition(float position, PhysicalEdge edge) {
|
|
177
|
-
layout_.setPosition(edge, position);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
void Node::setLayoutComputedFlexBasisGeneration(
|
|
181
|
-
uint32_t computedFlexBasisGeneration) {
|
|
182
|
-
layout_.computedFlexBasisGeneration = computedFlexBasisGeneration;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
void Node::setLayoutMeasuredDimension(
|
|
186
|
-
float measuredDimension,
|
|
187
|
-
Dimension dimension) {
|
|
188
|
-
layout_.setMeasuredDimension(dimension, measuredDimension);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
void Node::setLayoutHadOverflow(bool hadOverflow) {
|
|
192
|
-
layout_.setHadOverflow(hadOverflow);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
void Node::setLayoutDimension(float LengthValue, Dimension dimension) {
|
|
196
|
-
layout_.setDimension(dimension, LengthValue);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// If both left and right are defined, then use left. Otherwise return +left or
|
|
200
|
-
// -right depending on which is defined. Ignore statically positioned nodes as
|
|
201
|
-
// insets do not apply to them.
|
|
202
|
-
float Node::relativePosition(
|
|
203
|
-
FlexDirection axis,
|
|
204
|
-
Direction direction,
|
|
205
|
-
float axisSize) const {
|
|
206
|
-
if (style_.positionType() == PositionType::Static) {
|
|
207
|
-
return 0;
|
|
208
|
-
}
|
|
209
|
-
if (style_.isInlineStartPositionDefined(axis, direction)) {
|
|
210
|
-
return style_.computeInlineStartPosition(axis, direction, axisSize);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return -1 * style_.computeInlineEndPosition(axis, direction, axisSize);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
void Node::setPosition(
|
|
217
|
-
const Direction direction,
|
|
218
|
-
const float mainSize,
|
|
219
|
-
const float crossSize,
|
|
220
|
-
const float ownerWidth) {
|
|
221
|
-
/* Root nodes should be always layouted as LTR, so we don't return negative
|
|
222
|
-
* values. */
|
|
223
|
-
const Direction directionRespectingRoot =
|
|
224
|
-
owner_ != nullptr ? direction : Direction::LTR;
|
|
225
|
-
const FlexDirection mainAxis =
|
|
226
|
-
yoga::resolveDirection(style_.flexDirection(), directionRespectingRoot);
|
|
227
|
-
const FlexDirection crossAxis =
|
|
228
|
-
yoga::resolveCrossDirection(mainAxis, directionRespectingRoot);
|
|
229
|
-
|
|
230
|
-
// In the case of position static these are just 0. See:
|
|
231
|
-
// https://www.w3.org/TR/css-position-3/#valdef-position-static
|
|
232
|
-
const float relativePositionMain =
|
|
233
|
-
relativePosition(mainAxis, directionRespectingRoot, mainSize);
|
|
234
|
-
const float relativePositionCross =
|
|
235
|
-
relativePosition(crossAxis, directionRespectingRoot, crossSize);
|
|
236
|
-
|
|
237
|
-
const auto mainAxisLeadingEdge = inlineStartEdge(mainAxis, direction);
|
|
238
|
-
const auto mainAxisTrailingEdge = inlineEndEdge(mainAxis, direction);
|
|
239
|
-
const auto crossAxisLeadingEdge = inlineStartEdge(crossAxis, direction);
|
|
240
|
-
const auto crossAxisTrailingEdge = inlineEndEdge(crossAxis, direction);
|
|
241
|
-
|
|
242
|
-
setLayoutPosition(
|
|
243
|
-
(style_.computeInlineStartMargin(mainAxis, direction, ownerWidth) +
|
|
244
|
-
relativePositionMain),
|
|
245
|
-
mainAxisLeadingEdge);
|
|
246
|
-
setLayoutPosition(
|
|
247
|
-
(style_.computeInlineEndMargin(mainAxis, direction, ownerWidth) +
|
|
248
|
-
relativePositionMain),
|
|
249
|
-
mainAxisTrailingEdge);
|
|
250
|
-
setLayoutPosition(
|
|
251
|
-
(style_.computeInlineStartMargin(crossAxis, direction, ownerWidth) +
|
|
252
|
-
relativePositionCross),
|
|
253
|
-
crossAxisLeadingEdge);
|
|
254
|
-
setLayoutPosition(
|
|
255
|
-
(style_.computeInlineEndMargin(crossAxis, direction, ownerWidth) +
|
|
256
|
-
relativePositionCross),
|
|
257
|
-
crossAxisTrailingEdge);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
Style::Length Node::resolveFlexBasisPtr() const {
|
|
261
|
-
Style::Length flexBasis = style_.flexBasis();
|
|
262
|
-
if (flexBasis.unit() != Unit::Auto && flexBasis.unit() != Unit::Undefined) {
|
|
263
|
-
return flexBasis;
|
|
264
|
-
}
|
|
265
|
-
if (style_.flex().isDefined() && style_.flex().unwrap() > 0.0f) {
|
|
266
|
-
return config_->useWebDefaults() ? value::ofAuto() : value::points(0);
|
|
267
|
-
}
|
|
268
|
-
return value::ofAuto();
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
void Node::resolveDimension() {
|
|
272
|
-
for (auto dim : {Dimension::Width, Dimension::Height}) {
|
|
273
|
-
if (style_.maxDimension(dim).isDefined() &&
|
|
274
|
-
yoga::inexactEquals(
|
|
275
|
-
style_.maxDimension(dim), style_.minDimension(dim))) {
|
|
276
|
-
resolvedDimensions_[yoga::to_underlying(dim)] = style_.maxDimension(dim);
|
|
277
|
-
} else {
|
|
278
|
-
resolvedDimensions_[yoga::to_underlying(dim)] = style_.dimension(dim);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
Direction Node::resolveDirection(const Direction ownerDirection) {
|
|
284
|
-
if (style_.direction() == Direction::Inherit) {
|
|
285
|
-
return ownerDirection != Direction::Inherit ? ownerDirection
|
|
286
|
-
: Direction::LTR;
|
|
287
|
-
} else {
|
|
288
|
-
return style_.direction();
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
void Node::clearChildren() {
|
|
293
|
-
children_.clear();
|
|
294
|
-
children_.shrink_to_fit();
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Other Methods
|
|
298
|
-
|
|
299
|
-
void Node::cloneChildrenIfNeeded() {
|
|
300
|
-
size_t i = 0;
|
|
301
|
-
for (Node*& child : children_) {
|
|
302
|
-
if (child->getOwner() != this) {
|
|
303
|
-
child = resolveRef(config_->cloneNode(child, this, i));
|
|
304
|
-
child->setOwner(this);
|
|
305
|
-
}
|
|
306
|
-
i += 1;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
void Node::markDirtyAndPropagate() {
|
|
311
|
-
if (!isDirty_) {
|
|
312
|
-
setDirty(true);
|
|
313
|
-
setLayoutComputedFlexBasis(FloatOptional());
|
|
314
|
-
if (owner_) {
|
|
315
|
-
owner_->markDirtyAndPropagate();
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
float Node::resolveFlexGrow() const {
|
|
321
|
-
// Root nodes flexGrow should always be 0
|
|
322
|
-
if (owner_ == nullptr) {
|
|
323
|
-
return 0.0;
|
|
324
|
-
}
|
|
325
|
-
if (style_.flexGrow().isDefined()) {
|
|
326
|
-
return style_.flexGrow().unwrap();
|
|
327
|
-
}
|
|
328
|
-
if (style_.flex().isDefined() && style_.flex().unwrap() > 0.0f) {
|
|
329
|
-
return style_.flex().unwrap();
|
|
330
|
-
}
|
|
331
|
-
return Style::DefaultFlexGrow;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
float Node::resolveFlexShrink() const {
|
|
335
|
-
if (owner_ == nullptr) {
|
|
336
|
-
return 0.0;
|
|
337
|
-
}
|
|
338
|
-
if (style_.flexShrink().isDefined()) {
|
|
339
|
-
return style_.flexShrink().unwrap();
|
|
340
|
-
}
|
|
341
|
-
if (!config_->useWebDefaults() && style_.flex().isDefined() &&
|
|
342
|
-
style_.flex().unwrap() < 0.0f) {
|
|
343
|
-
return -style_.flex().unwrap();
|
|
344
|
-
}
|
|
345
|
-
return config_->useWebDefaults() ? Style::WebDefaultFlexShrink
|
|
346
|
-
: Style::DefaultFlexShrink;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
bool Node::isNodeFlexible() {
|
|
350
|
-
return (
|
|
351
|
-
(style_.positionType() != PositionType::Absolute) &&
|
|
352
|
-
(resolveFlexGrow() != 0 || resolveFlexShrink() != 0));
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
void Node::reset() {
|
|
356
|
-
yoga::assertFatalWithNode(
|
|
357
|
-
this,
|
|
358
|
-
children_.size() == 0,
|
|
359
|
-
"Cannot reset a node which still has children attached");
|
|
360
|
-
yoga::assertFatalWithNode(
|
|
361
|
-
this, owner_ == nullptr, "Cannot reset a node still attached to a owner");
|
|
362
|
-
|
|
363
|
-
*this = Node{getConfig()};
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
} // namespace facebook::yoga
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* This file is auto-generated from a NativeModule spec file in js.
|
|
4
|
-
*
|
|
5
|
-
* This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
|
|
6
|
-
* in a way that also verifies at compile time that the native module matches the interface required
|
|
7
|
-
* by the TurboModule JS spec.
|
|
8
|
-
*/
|
|
9
|
-
#pragma once
|
|
10
|
-
|
|
11
|
-
#include <NativeModules.h>
|
|
12
|
-
#include <tuple>
|
|
13
|
-
|
|
14
|
-
namespace Microsoft::ReactNativeSpecs {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
struct AnimationsDebugModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
|
|
18
|
-
static constexpr auto methods = std::tuple{
|
|
19
|
-
Method<void() noexcept>{0, L"startRecordingFps"},
|
|
20
|
-
Method<void(double) noexcept>{1, L"stopRecordingFps"},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
template <class TModule>
|
|
24
|
-
static constexpr void ValidateModule() noexcept {
|
|
25
|
-
constexpr auto methodCheckResults = CheckMethods<TModule, AnimationsDebugModuleSpec>();
|
|
26
|
-
|
|
27
|
-
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
28
|
-
0,
|
|
29
|
-
"startRecordingFps",
|
|
30
|
-
" REACT_METHOD(startRecordingFps) void startRecordingFps() noexcept { /* implementation */ }\n"
|
|
31
|
-
" REACT_METHOD(startRecordingFps) static void startRecordingFps() noexcept { /* implementation */ }\n");
|
|
32
|
-
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
33
|
-
1,
|
|
34
|
-
"stopRecordingFps",
|
|
35
|
-
" REACT_METHOD(stopRecordingFps) void stopRecordingFps(double animationStopTimeMs) noexcept { /* implementation */ }\n"
|
|
36
|
-
" REACT_METHOD(stopRecordingFps) static void stopRecordingFps(double animationStopTimeMs) noexcept { /* implementation */ }\n");
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
} // namespace Microsoft::ReactNativeSpecs
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*
|
|
3
|
-
* This file is auto-generated from a NativeModule spec file in js.
|
|
4
|
-
*
|
|
5
|
-
* This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
|
|
6
|
-
* in a way that also verifies at compile time that the native module matches the interface required
|
|
7
|
-
* by the TurboModule JS spec.
|
|
8
|
-
*/
|
|
9
|
-
#pragma once
|
|
10
|
-
|
|
11
|
-
#include <NativeModules.h>
|
|
12
|
-
#include <tuple>
|
|
13
|
-
|
|
14
|
-
namespace Microsoft::ReactNativeSpecs {
|
|
15
|
-
|
|
16
|
-
struct PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion {
|
|
17
|
-
double major;
|
|
18
|
-
double minor;
|
|
19
|
-
double patch;
|
|
20
|
-
std::optional<std::string> prerelease;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
struct PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion {
|
|
24
|
-
double major;
|
|
25
|
-
double minor;
|
|
26
|
-
double patch;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
struct PlatformConstantsWinSpec_PlatformConstantsWindows {
|
|
30
|
-
bool isTesting;
|
|
31
|
-
std::optional<bool> isDisableAnimations;
|
|
32
|
-
PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion reactNativeVersion;
|
|
33
|
-
PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion reactNativeWindowsVersion;
|
|
34
|
-
double osVersion;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion*) noexcept {
|
|
39
|
-
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
|
40
|
-
{L"major", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion::major},
|
|
41
|
-
{L"minor", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion::minor},
|
|
42
|
-
{L"patch", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion::patch},
|
|
43
|
-
{L"prerelease", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeVersion::prerelease},
|
|
44
|
-
};
|
|
45
|
-
return fieldMap;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion*) noexcept {
|
|
49
|
-
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
|
50
|
-
{L"major", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion::major},
|
|
51
|
-
{L"minor", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion::minor},
|
|
52
|
-
{L"patch", &PlatformConstantsWinSpec_PlatformConstantsWindows_reactNativeWindowsVersion::patch},
|
|
53
|
-
};
|
|
54
|
-
return fieldMap;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWinSpec_PlatformConstantsWindows*) noexcept {
|
|
58
|
-
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
|
59
|
-
{L"isTesting", &PlatformConstantsWinSpec_PlatformConstantsWindows::isTesting},
|
|
60
|
-
{L"isDisableAnimations", &PlatformConstantsWinSpec_PlatformConstantsWindows::isDisableAnimations},
|
|
61
|
-
{L"reactNativeVersion", &PlatformConstantsWinSpec_PlatformConstantsWindows::reactNativeVersion},
|
|
62
|
-
{L"reactNativeWindowsVersion", &PlatformConstantsWinSpec_PlatformConstantsWindows::reactNativeWindowsVersion},
|
|
63
|
-
{L"osVersion", &PlatformConstantsWinSpec_PlatformConstantsWindows::osVersion},
|
|
64
|
-
};
|
|
65
|
-
return fieldMap;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
struct PlatformConstantsWinSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
|
|
69
|
-
static constexpr auto methods = std::tuple{
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
template <class TModule>
|
|
74
|
-
static constexpr void ValidateModule() noexcept {
|
|
75
|
-
constexpr auto methodCheckResults = CheckMethods<TModule, PlatformConstantsWinSpec>();
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
} // namespace Microsoft::ReactNativeSpecs
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
* @format
|
|
8
|
-
* @flow strict
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
module.exports = {};
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
* @generated SignedSource<<8f82962343a5146622f36c2de071ff6a>>
|
|
8
|
-
* @flow strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* IMPORTANT: Do NOT modify this file directly.
|
|
13
|
-
*
|
|
14
|
-
* To change the definition of the flags, edit
|
|
15
|
-
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
|
|
16
|
-
*
|
|
17
|
-
* To regenerate this code, run the following script from the repo root:
|
|
18
|
-
* yarn featureflags-update
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import type {TurboModule} from '../../../Libraries/TurboModule/RCTExport';
|
|
22
|
-
|
|
23
|
-
import * as TurboModuleRegistry from '../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
24
|
-
|
|
25
|
-
export interface Spec extends TurboModule {
|
|
26
|
-
+commonTestFlag?: () => boolean;
|
|
27
|
-
+androidEnablePendingFabricTransactions?: () => boolean;
|
|
28
|
-
+batchRenderingUpdatesInEventLoop?: () => boolean;
|
|
29
|
-
+destroyFabricSurfacesInReactInstanceManager?: () => boolean;
|
|
30
|
-
+enableBackgroundExecutor?: () => boolean;
|
|
31
|
-
+useModernRuntimeScheduler?: () => boolean;
|
|
32
|
-
+enableMicrotasks?: () => boolean;
|
|
33
|
-
+enableSpannableBuildingUnification?: () => boolean;
|
|
34
|
-
+enableCustomDrawOrderFabric?: () => boolean;
|
|
35
|
-
+enableFixForClippedSubviewsCrash?: () => boolean;
|
|
36
|
-
+inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
|
|
37
|
-
+inspectorEnableModernCDPRegistry?: () => boolean;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const NativeReactNativeFeatureFlags: ?Spec = TurboModuleRegistry.get<Spec>(
|
|
41
|
-
'NativeReactNativeFeatureFlagsCxx',
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
export default NativeReactNativeFeatureFlags;
|
|
@@ -1,92 +0,0 @@
|
|
|
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
|
-
* @flow strict-local
|
|
8
|
-
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
describe('ReactNativeFeatureFlags', () => {
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
jest.resetModules();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should provide default values for common flags if the native module is NOT available', () => {
|
|
18
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
19
|
-
expect(ReactNativeFeatureFlags.commonTestFlag()).toBe(false);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should access and cache common flags from the native module if it is available', () => {
|
|
23
|
-
const commonTestFlagFn = jest.fn(() => true);
|
|
24
|
-
|
|
25
|
-
jest.doMock('../NativeReactNativeFeatureFlags', () => ({
|
|
26
|
-
__esModule: true,
|
|
27
|
-
default: {
|
|
28
|
-
commonTestFlag: commonTestFlagFn,
|
|
29
|
-
},
|
|
30
|
-
}));
|
|
31
|
-
|
|
32
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
33
|
-
|
|
34
|
-
expect(commonTestFlagFn).toHaveBeenCalledTimes(0);
|
|
35
|
-
|
|
36
|
-
expect(ReactNativeFeatureFlags.commonTestFlag()).toBe(true);
|
|
37
|
-
expect(commonTestFlagFn).toHaveBeenCalledTimes(1);
|
|
38
|
-
|
|
39
|
-
expect(ReactNativeFeatureFlags.commonTestFlag()).toBe(true);
|
|
40
|
-
expect(commonTestFlagFn).toHaveBeenCalledTimes(1);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should provide default values for JS-only flags', () => {
|
|
44
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
45
|
-
expect(ReactNativeFeatureFlags.jsOnlyTestFlag()).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should access and cache overridden JS-only flags', () => {
|
|
49
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
50
|
-
|
|
51
|
-
const jsOnlyTestFlagFn = jest.fn(() => true);
|
|
52
|
-
ReactNativeFeatureFlags.override({
|
|
53
|
-
jsOnlyTestFlag: jsOnlyTestFlagFn,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
expect(jsOnlyTestFlagFn).toHaveBeenCalledTimes(0);
|
|
57
|
-
|
|
58
|
-
expect(ReactNativeFeatureFlags.jsOnlyTestFlag()).toBe(true);
|
|
59
|
-
expect(jsOnlyTestFlagFn).toHaveBeenCalledTimes(1);
|
|
60
|
-
|
|
61
|
-
expect(ReactNativeFeatureFlags.jsOnlyTestFlag()).toBe(true);
|
|
62
|
-
expect(jsOnlyTestFlagFn).toHaveBeenCalledTimes(1);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('should throw an error if any of the flags has been accessed before overridding', () => {
|
|
66
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
67
|
-
|
|
68
|
-
ReactNativeFeatureFlags.commonTestFlag();
|
|
69
|
-
|
|
70
|
-
expect(() =>
|
|
71
|
-
ReactNativeFeatureFlags.override({
|
|
72
|
-
jsOnlyTestFlag: () => true,
|
|
73
|
-
}),
|
|
74
|
-
).toThrow(
|
|
75
|
-
'Feature flags were accessed before being overridden: commonTestFlag',
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should throw an error when trying to set overrides twice', () => {
|
|
80
|
-
const ReactNativeFeatureFlags = require('../ReactNativeFeatureFlags');
|
|
81
|
-
|
|
82
|
-
ReactNativeFeatureFlags.override({
|
|
83
|
-
jsOnlyTestFlag: () => true,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
expect(() =>
|
|
87
|
-
ReactNativeFeatureFlags.override({
|
|
88
|
-
jsOnlyTestFlag: () => false,
|
|
89
|
-
}),
|
|
90
|
-
).toThrow('Feature flags cannot be overridden more than once');
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
* @flow strict
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
|
|
12
|
-
|
|
13
|
-
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
|
|
14
|
-
|
|
15
|
-
export interface Spec extends TurboModule {
|
|
16
|
-
+startRecordingFps: () => void;
|
|
17
|
-
+stopRecordingFps: (animationStopTimeMs: number) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default (TurboModuleRegistry.get<Spec>('AnimationsDebugModule'): ?Spec);
|