From 97356689c0ae3c5f023a60cb24b77e7f6c81296e Mon Sep 17 00:00:00 2001 From: Sarang Gokhale Date: Mon, 9 Dec 2024 11:11:17 -0800 Subject: [PATCH 1/3] Add linter exception to generated headers for Office builds (#14157) * Add linter exception to generated headers for Office builds --- ...-0671783d-ada6-43fb-9882-81d449c16124.json | 7 ++ ...-243f361c-0d3e-471e-a30f-bbaec98e4a20.json | 7 ++ ...-638e11af-371a-497c-8d4a-c794b3f6c67b.json | 7 ++ ...-2deb0a55-0a7b-44b0-b458-4b105d90fc28.json | 7 ++ ...-a9362be4-db26-4085-87d2-96580e418d6c.json | 7 ++ .../codegen/src/generators/GenerateNM2.ts | 3 +- .../codegen/NativeMyModuleDataTypes.g.h | 1 + .../codegen/NativeMyModuleSpec.g.h | 1 + vnext/codegen/NativeAccessibilityInfoSpec.g.h | 1 + .../NativeAccessibilityManagerSpec.g.h | 1 + .../codegen/NativeActionSheetManagerSpec.g.h | 1 + vnext/codegen/NativeAlertManagerSpec.g.h | 1 + vnext/codegen/NativeAnimatedModuleSpec.g.h | 1 + .../codegen/NativeAnimatedTurboModuleSpec.g.h | 1 + vnext/codegen/NativeAppStateSpec.g.h | 1 + vnext/codegen/NativeAppThemeSpec.g.h | 1 + vnext/codegen/NativeAppearanceSpec.g.h | 1 + vnext/codegen/NativeBlobModuleSpec.g.h | 1 + vnext/codegen/NativeBugReportingSpec.g.h | 1 + vnext/codegen/NativeClipboardSpec.g.h | 1 + vnext/codegen/NativeDevLoadingViewSpec.g.h | 1 + vnext/codegen/NativeDevMenuSpec.g.h | 1 + vnext/codegen/NativeDevSettingsSpec.g.h | 1 + .../codegen/NativeDeviceEventManagerSpec.g.h | 1 + vnext/codegen/NativeDeviceInfoSpec.g.h | 1 + .../NativeDialogManagerAndroidSpec.g.h | 1 + .../NativeDialogManagerWindowsSpec.g.h | 1 + vnext/codegen/NativeExceptionsManagerSpec.g.h | 1 + vnext/codegen/NativeFileReaderModuleSpec.g.h | 1 + vnext/codegen/NativeFrameRateLoggerSpec.g.h | 1 + .../NativeHeadlessJsTaskSupportSpec.g.h | 1 + vnext/codegen/NativeI18nManagerSpec.g.h | 1 + vnext/codegen/NativeImageEditorSpec.g.h | 1 + .../codegen/NativeImageLoaderAndroidSpec.g.h | 1 + vnext/codegen/NativeImageLoaderIOSSpec.g.h | 1 + vnext/codegen/NativeImageStoreAndroidSpec.g.h | 1 + vnext/codegen/NativeImageStoreIOSSpec.g.h | 1 + vnext/codegen/NativeIntentAndroidSpec.g.h | 1 + .../NativeIntersectionObserverSpec.g.h | 1 + vnext/codegen/NativeJSCHeapCaptureSpec.g.h | 1 + .../codegen/NativeJSCSamplingProfilerSpec.g.h | 1 + vnext/codegen/NativeKeyboardObserverSpec.g.h | 1 + vnext/codegen/NativeLinkingManagerSpec.g.h | 1 + vnext/codegen/NativeLogBoxSpec.g.h | 1 + vnext/codegen/NativeModalManagerSpec.g.h | 1 + vnext/codegen/NativeMutationObserverSpec.g.h | 1 + vnext/codegen/NativeNetworkingAndroidSpec.g.h | 1 + vnext/codegen/NativeNetworkingIOSSpec.g.h | 1 + vnext/codegen/NativePerformanceSpec.g.h | 1 + .../codegen/NativePermissionsAndroidSpec.g.h | 1 + .../NativePlatformConstantsAndroidSpec.g.h | 1 + .../NativePlatformConstantsIOSSpec.g.h | 1 + .../NativePlatformConstantsWindowsSpec.g.h | 82 +++++++++++++++++++ .../NativePushNotificationManagerIOSSpec.g.h | 1 + ...ReactDevToolsRuntimeSettingsModuleSpec.g.h | 67 +++++++++++++++ ...NativeReactDevToolsSettingsManagerSpec.g.h | 41 ++++++++++ .../NativeReactNativeFeatureFlagsSpec.g.h | 1 + vnext/codegen/NativeRedBoxSpec.g.h | 1 + vnext/codegen/NativeSampleTurboModuleSpec.g.h | 1 + vnext/codegen/NativeSegmentFetcherSpec.g.h | 1 + vnext/codegen/NativeSettingsManagerSpec.g.h | 1 + vnext/codegen/NativeShareModuleSpec.g.h | 1 + vnext/codegen/NativeSoundManagerSpec.g.h | 1 + vnext/codegen/NativeSourceCodeSpec.g.h | 1 + .../NativeStatusBarManagerAndroidSpec.g.h | 1 + .../codegen/NativeStatusBarManagerIOSSpec.g.h | 1 + vnext/codegen/NativeTimingSpec.g.h | 1 + vnext/codegen/NativeToastAndroidSpec.g.h | 1 + vnext/codegen/NativeUIManagerSpec.g.h | 1 + vnext/codegen/NativeVibrationSpec.g.h | 1 + vnext/codegen/NativeWebSocketModuleSpec.g.h | 1 + 71 files changed, 289 insertions(+), 1 deletion(-) create mode 100644 change/@react-native-windows-automation-0671783d-ada6-43fb-9882-81d449c16124.json create mode 100644 change/@react-native-windows-automation-channel-243f361c-0d3e-471e-a30f-bbaec98e4a20.json create mode 100644 change/@react-native-windows-automation-commands-638e11af-371a-497c-8d4a-c794b3f6c67b.json create mode 100644 change/@react-native-windows-codegen-2deb0a55-0a7b-44b0-b458-4b105d90fc28.json create mode 100644 change/react-native-windows-a9362be4-db26-4085-87d2-96580e418d6c.json create mode 100644 vnext/codegen/NativePlatformConstantsWindowsSpec.g.h create mode 100644 vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h create mode 100644 vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h diff --git a/change/@react-native-windows-automation-0671783d-ada6-43fb-9882-81d449c16124.json b/change/@react-native-windows-automation-0671783d-ada6-43fb-9882-81d449c16124.json new file mode 100644 index 00000000000..eea4aacb4a0 --- /dev/null +++ b/change/@react-native-windows-automation-0671783d-ada6-43fb-9882-81d449c16124.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "add the new generated headers", + "packageName": "@react-native-windows/automation", + "email": "email not defined", + "dependentChangeType": "none" +} diff --git a/change/@react-native-windows-automation-channel-243f361c-0d3e-471e-a30f-bbaec98e4a20.json b/change/@react-native-windows-automation-channel-243f361c-0d3e-471e-a30f-bbaec98e4a20.json new file mode 100644 index 00000000000..6dad8e9f384 --- /dev/null +++ b/change/@react-native-windows-automation-channel-243f361c-0d3e-471e-a30f-bbaec98e4a20.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "add the new generated headers", + "packageName": "@react-native-windows/automation-channel", + "email": "email not defined", + "dependentChangeType": "none" +} diff --git a/change/@react-native-windows-automation-commands-638e11af-371a-497c-8d4a-c794b3f6c67b.json b/change/@react-native-windows-automation-commands-638e11af-371a-497c-8d4a-c794b3f6c67b.json new file mode 100644 index 00000000000..01d007a39b3 --- /dev/null +++ b/change/@react-native-windows-automation-commands-638e11af-371a-497c-8d4a-c794b3f6c67b.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "add the new generated headers", + "packageName": "@react-native-windows/automation-commands", + "email": "email not defined", + "dependentChangeType": "none" +} diff --git a/change/@react-native-windows-codegen-2deb0a55-0a7b-44b0-b458-4b105d90fc28.json b/change/@react-native-windows-codegen-2deb0a55-0a7b-44b0-b458-4b105d90fc28.json new file mode 100644 index 00000000000..fc05cd9b6a0 --- /dev/null +++ b/change/@react-native-windows-codegen-2deb0a55-0a7b-44b0-b458-4b105d90fc28.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add linter exception to generated headers for Office builds", + "packageName": "@react-native-windows/codegen", + "email": "email not defined", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-a9362be4-db26-4085-87d2-96580e418d6c.json b/change/react-native-windows-a9362be4-db26-4085-87d2-96580e418d6c.json new file mode 100644 index 00000000000..778f1d8707a --- /dev/null +++ b/change/react-native-windows-a9362be4-db26-4085-87d2-96580e418d6c.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "add the new generated headers", + "packageName": "react-native-windows", + "email": "email not defined", + "dependentChangeType": "none" +} diff --git a/packages/@react-native-windows/codegen/src/generators/GenerateNM2.ts b/packages/@react-native-windows/codegen/src/generators/GenerateNM2.ts index fa1e12f4f94..c7de600197a 100644 --- a/packages/@react-native-windows/codegen/src/generators/GenerateNM2.ts +++ b/packages/@react-native-windows/codegen/src/generators/GenerateNM2.ts @@ -24,7 +24,8 @@ const headerTemplate = `/* * in a way that also verifies at compile time that the native module matches the interface required * by the TurboModule JS spec. */ -#pragma once`; +#pragma once +// clang-format off`; const specTemplate = `::_MODULE_CUSTPM_TYPES_REFLECTION_:: struct ::_MODULE_NAME_::Spec : winrt::Microsoft::ReactNative::TurboModuleSpec { diff --git a/packages/sample-apps/codegen/NativeMyModuleDataTypes.g.h b/packages/sample-apps/codegen/NativeMyModuleDataTypes.g.h index b44cd2cfb38..eb7f18aed61 100644 --- a/packages/sample-apps/codegen/NativeMyModuleDataTypes.g.h +++ b/packages/sample-apps/codegen/NativeMyModuleDataTypes.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/packages/sample-apps/codegen/NativeMyModuleSpec.g.h b/packages/sample-apps/codegen/NativeMyModuleSpec.g.h index 5b5861629ab..c3f950aff03 100644 --- a/packages/sample-apps/codegen/NativeMyModuleSpec.g.h +++ b/packages/sample-apps/codegen/NativeMyModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off // #include "NativeMyModuleDataTypes.g.h" before this file to use the generated type definition #include diff --git a/vnext/codegen/NativeAccessibilityInfoSpec.g.h b/vnext/codegen/NativeAccessibilityInfoSpec.g.h index 80f13150aef..525022c9d67 100644 --- a/vnext/codegen/NativeAccessibilityInfoSpec.g.h +++ b/vnext/codegen/NativeAccessibilityInfoSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAccessibilityManagerSpec.g.h b/vnext/codegen/NativeAccessibilityManagerSpec.g.h index 55ef094c8e6..13204fb80a9 100644 --- a/vnext/codegen/NativeAccessibilityManagerSpec.g.h +++ b/vnext/codegen/NativeAccessibilityManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeActionSheetManagerSpec.g.h b/vnext/codegen/NativeActionSheetManagerSpec.g.h index ad0de284b85..267443c2ff4 100644 --- a/vnext/codegen/NativeActionSheetManagerSpec.g.h +++ b/vnext/codegen/NativeActionSheetManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAlertManagerSpec.g.h b/vnext/codegen/NativeAlertManagerSpec.g.h index 3ba84201993..507b416abb8 100644 --- a/vnext/codegen/NativeAlertManagerSpec.g.h +++ b/vnext/codegen/NativeAlertManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAnimatedModuleSpec.g.h b/vnext/codegen/NativeAnimatedModuleSpec.g.h index 70017e2b666..b0da7340293 100644 --- a/vnext/codegen/NativeAnimatedModuleSpec.g.h +++ b/vnext/codegen/NativeAnimatedModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h b/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h index 97d4f2de96b..a9061d93a47 100644 --- a/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h +++ b/vnext/codegen/NativeAnimatedTurboModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAppStateSpec.g.h b/vnext/codegen/NativeAppStateSpec.g.h index 9153299d048..c005e3d41fe 100644 --- a/vnext/codegen/NativeAppStateSpec.g.h +++ b/vnext/codegen/NativeAppStateSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAppThemeSpec.g.h b/vnext/codegen/NativeAppThemeSpec.g.h index 8f1f6a6b285..cdf9bfc7afd 100644 --- a/vnext/codegen/NativeAppThemeSpec.g.h +++ b/vnext/codegen/NativeAppThemeSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeAppearanceSpec.g.h b/vnext/codegen/NativeAppearanceSpec.g.h index 4c8cf8fc6ce..af2d1120ff0 100644 --- a/vnext/codegen/NativeAppearanceSpec.g.h +++ b/vnext/codegen/NativeAppearanceSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeBlobModuleSpec.g.h b/vnext/codegen/NativeBlobModuleSpec.g.h index 09924810019..fda258210df 100644 --- a/vnext/codegen/NativeBlobModuleSpec.g.h +++ b/vnext/codegen/NativeBlobModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeBugReportingSpec.g.h b/vnext/codegen/NativeBugReportingSpec.g.h index dec6e56e18c..b8d8be6bd91 100644 --- a/vnext/codegen/NativeBugReportingSpec.g.h +++ b/vnext/codegen/NativeBugReportingSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeClipboardSpec.g.h b/vnext/codegen/NativeClipboardSpec.g.h index 75499fbe14a..1908c625795 100644 --- a/vnext/codegen/NativeClipboardSpec.g.h +++ b/vnext/codegen/NativeClipboardSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDevLoadingViewSpec.g.h b/vnext/codegen/NativeDevLoadingViewSpec.g.h index 2d28a64103a..8df12e28295 100644 --- a/vnext/codegen/NativeDevLoadingViewSpec.g.h +++ b/vnext/codegen/NativeDevLoadingViewSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDevMenuSpec.g.h b/vnext/codegen/NativeDevMenuSpec.g.h index 6aee622bf0a..88f498cd3a1 100644 --- a/vnext/codegen/NativeDevMenuSpec.g.h +++ b/vnext/codegen/NativeDevMenuSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDevSettingsSpec.g.h b/vnext/codegen/NativeDevSettingsSpec.g.h index 1798509a837..c17573b786f 100644 --- a/vnext/codegen/NativeDevSettingsSpec.g.h +++ b/vnext/codegen/NativeDevSettingsSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDeviceEventManagerSpec.g.h b/vnext/codegen/NativeDeviceEventManagerSpec.g.h index ad195caae47..84c12436a76 100644 --- a/vnext/codegen/NativeDeviceEventManagerSpec.g.h +++ b/vnext/codegen/NativeDeviceEventManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDeviceInfoSpec.g.h b/vnext/codegen/NativeDeviceInfoSpec.g.h index dd57df10f6f..e8672b3bda5 100644 --- a/vnext/codegen/NativeDeviceInfoSpec.g.h +++ b/vnext/codegen/NativeDeviceInfoSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDialogManagerAndroidSpec.g.h b/vnext/codegen/NativeDialogManagerAndroidSpec.g.h index b56332c14f3..711c593784d 100644 --- a/vnext/codegen/NativeDialogManagerAndroidSpec.g.h +++ b/vnext/codegen/NativeDialogManagerAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDialogManagerWindowsSpec.g.h b/vnext/codegen/NativeDialogManagerWindowsSpec.g.h index 3766224bbf7..9c5fe21a26e 100644 --- a/vnext/codegen/NativeDialogManagerWindowsSpec.g.h +++ b/vnext/codegen/NativeDialogManagerWindowsSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeExceptionsManagerSpec.g.h b/vnext/codegen/NativeExceptionsManagerSpec.g.h index b3391117069..97d3564c263 100644 --- a/vnext/codegen/NativeExceptionsManagerSpec.g.h +++ b/vnext/codegen/NativeExceptionsManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeFileReaderModuleSpec.g.h b/vnext/codegen/NativeFileReaderModuleSpec.g.h index fc6c2db899b..e8cd720496d 100644 --- a/vnext/codegen/NativeFileReaderModuleSpec.g.h +++ b/vnext/codegen/NativeFileReaderModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeFrameRateLoggerSpec.g.h b/vnext/codegen/NativeFrameRateLoggerSpec.g.h index ef6837c95ae..ee0fa9b373f 100644 --- a/vnext/codegen/NativeFrameRateLoggerSpec.g.h +++ b/vnext/codegen/NativeFrameRateLoggerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h b/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h index ffb77541dde..4ba71d2e7ae 100644 --- a/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h +++ b/vnext/codegen/NativeHeadlessJsTaskSupportSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeI18nManagerSpec.g.h b/vnext/codegen/NativeI18nManagerSpec.g.h index e65dbf03fb7..2e9eab293a0 100644 --- a/vnext/codegen/NativeI18nManagerSpec.g.h +++ b/vnext/codegen/NativeI18nManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeImageEditorSpec.g.h b/vnext/codegen/NativeImageEditorSpec.g.h index f2ae68f7d1f..f308bd08654 100644 --- a/vnext/codegen/NativeImageEditorSpec.g.h +++ b/vnext/codegen/NativeImageEditorSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeImageLoaderAndroidSpec.g.h b/vnext/codegen/NativeImageLoaderAndroidSpec.g.h index 433bc7a116a..ac972d61345 100644 --- a/vnext/codegen/NativeImageLoaderAndroidSpec.g.h +++ b/vnext/codegen/NativeImageLoaderAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeImageLoaderIOSSpec.g.h b/vnext/codegen/NativeImageLoaderIOSSpec.g.h index bbdd315456b..4b69e50442a 100644 --- a/vnext/codegen/NativeImageLoaderIOSSpec.g.h +++ b/vnext/codegen/NativeImageLoaderIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeImageStoreAndroidSpec.g.h b/vnext/codegen/NativeImageStoreAndroidSpec.g.h index e4e33f4aea8..66fccbe9a63 100644 --- a/vnext/codegen/NativeImageStoreAndroidSpec.g.h +++ b/vnext/codegen/NativeImageStoreAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeImageStoreIOSSpec.g.h b/vnext/codegen/NativeImageStoreIOSSpec.g.h index 8d18990eaa6..887fa9af152 100644 --- a/vnext/codegen/NativeImageStoreIOSSpec.g.h +++ b/vnext/codegen/NativeImageStoreIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeIntentAndroidSpec.g.h b/vnext/codegen/NativeIntentAndroidSpec.g.h index 8d313fd3e95..861ecc0267e 100644 --- a/vnext/codegen/NativeIntentAndroidSpec.g.h +++ b/vnext/codegen/NativeIntentAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeIntersectionObserverSpec.g.h b/vnext/codegen/NativeIntersectionObserverSpec.g.h index b9121bc1b2c..6445eec039c 100644 --- a/vnext/codegen/NativeIntersectionObserverSpec.g.h +++ b/vnext/codegen/NativeIntersectionObserverSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeJSCHeapCaptureSpec.g.h b/vnext/codegen/NativeJSCHeapCaptureSpec.g.h index 1462a337d6e..aa9adddd0f1 100644 --- a/vnext/codegen/NativeJSCHeapCaptureSpec.g.h +++ b/vnext/codegen/NativeJSCHeapCaptureSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeJSCSamplingProfilerSpec.g.h b/vnext/codegen/NativeJSCSamplingProfilerSpec.g.h index 0e2191c3f0d..72e41e776e7 100644 --- a/vnext/codegen/NativeJSCSamplingProfilerSpec.g.h +++ b/vnext/codegen/NativeJSCSamplingProfilerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeKeyboardObserverSpec.g.h b/vnext/codegen/NativeKeyboardObserverSpec.g.h index 08627689213..3c888dc5023 100644 --- a/vnext/codegen/NativeKeyboardObserverSpec.g.h +++ b/vnext/codegen/NativeKeyboardObserverSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeLinkingManagerSpec.g.h b/vnext/codegen/NativeLinkingManagerSpec.g.h index 82ec7a071bc..665568db801 100644 --- a/vnext/codegen/NativeLinkingManagerSpec.g.h +++ b/vnext/codegen/NativeLinkingManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeLogBoxSpec.g.h b/vnext/codegen/NativeLogBoxSpec.g.h index f833fca6175..0e510c75996 100644 --- a/vnext/codegen/NativeLogBoxSpec.g.h +++ b/vnext/codegen/NativeLogBoxSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeModalManagerSpec.g.h b/vnext/codegen/NativeModalManagerSpec.g.h index e88abaa1d27..9cb67c0b03b 100644 --- a/vnext/codegen/NativeModalManagerSpec.g.h +++ b/vnext/codegen/NativeModalManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeMutationObserverSpec.g.h b/vnext/codegen/NativeMutationObserverSpec.g.h index dfb9effeaac..5412c54a203 100644 --- a/vnext/codegen/NativeMutationObserverSpec.g.h +++ b/vnext/codegen/NativeMutationObserverSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeNetworkingAndroidSpec.g.h b/vnext/codegen/NativeNetworkingAndroidSpec.g.h index 53bb429b9cc..3f6a0276878 100644 --- a/vnext/codegen/NativeNetworkingAndroidSpec.g.h +++ b/vnext/codegen/NativeNetworkingAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeNetworkingIOSSpec.g.h b/vnext/codegen/NativeNetworkingIOSSpec.g.h index 11c7e9bbe22..42d2eb7093c 100644 --- a/vnext/codegen/NativeNetworkingIOSSpec.g.h +++ b/vnext/codegen/NativeNetworkingIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePerformanceSpec.g.h b/vnext/codegen/NativePerformanceSpec.g.h index 0e5ec8129cc..d42e71f4c12 100644 --- a/vnext/codegen/NativePerformanceSpec.g.h +++ b/vnext/codegen/NativePerformanceSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePermissionsAndroidSpec.g.h b/vnext/codegen/NativePermissionsAndroidSpec.g.h index e74f83dfb98..4bde8da8dae 100644 --- a/vnext/codegen/NativePermissionsAndroidSpec.g.h +++ b/vnext/codegen/NativePermissionsAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h b/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h index 5e221fa6267..e5e269d2ac7 100644 --- a/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h +++ b/vnext/codegen/NativePlatformConstantsAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePlatformConstantsIOSSpec.g.h b/vnext/codegen/NativePlatformConstantsIOSSpec.g.h index c5b35498cdb..da6713d3ddb 100644 --- a/vnext/codegen/NativePlatformConstantsIOSSpec.g.h +++ b/vnext/codegen/NativePlatformConstantsIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h b/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h new file mode 100644 index 00000000000..60065d28fb2 --- /dev/null +++ b/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h @@ -0,0 +1,82 @@ + +/* + * This file is auto-generated from a NativeModule spec file in js. + * + * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules + * in a way that also verifies at compile time that the native module matches the interface required + * by the TurboModule JS spec. + */ +#pragma once +// clang-format off + +#include +#include + +namespace Microsoft::ReactNativeSpecs { + +struct PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion { + double major; + double minor; + double patch; + std::optional prerelease; +}; + +struct PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion { + double major; + double minor; + double patch; +}; + +struct PlatformConstantsWindowsSpec_PlatformConstantsWindows { + bool isTesting; + std::optional isDisableAnimations; + PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion reactNativeVersion; + PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion reactNativeWindowsVersion; + double osVersion; +}; + + +inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion*) noexcept { + winrt::Microsoft::ReactNative::FieldMap fieldMap { + {L"major", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::major}, + {L"minor", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::minor}, + {L"patch", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::patch}, + {L"prerelease", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::prerelease}, + }; + return fieldMap; +} + +inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion*) noexcept { + winrt::Microsoft::ReactNative::FieldMap fieldMap { + {L"major", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::major}, + {L"minor", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::minor}, + {L"patch", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::patch}, + }; + return fieldMap; +} + +inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows*) noexcept { + winrt::Microsoft::ReactNative::FieldMap fieldMap { + {L"isTesting", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isTesting}, + {L"isDisableAnimations", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isDisableAnimations}, + {L"reactNativeVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeVersion}, + {L"reactNativeWindowsVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeWindowsVersion}, + {L"osVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::osVersion}, + }; + return fieldMap; +} + +struct PlatformConstantsWindowsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { + static constexpr auto methods = std::tuple{ + + }; + + template + static constexpr void ValidateModule() noexcept { + constexpr auto methodCheckResults = CheckMethods(); + + + } +}; + +} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h b/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h index da853f60aa7..26cc325aed4 100644 --- a/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h +++ b/vnext/codegen/NativePushNotificationManagerIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h b/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h new file mode 100644 index 00000000000..c9275869659 --- /dev/null +++ b/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h @@ -0,0 +1,67 @@ + +/* + * This file is auto-generated from a NativeModule spec file in js. + * + * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules + * in a way that also verifies at compile time that the native module matches the interface required + * by the TurboModule JS spec. + */ +#pragma once +// clang-format off + +#include +#include + +namespace Microsoft::ReactNativeSpecs { + +struct ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig { + std::optional shouldReloadAndProfile; + std::optional recordChangeDescriptions; +}; + +struct ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig { + bool shouldReloadAndProfile; + bool recordChangeDescriptions; +}; + + +inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig*) noexcept { + winrt::Microsoft::ReactNative::FieldMap fieldMap { + {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::shouldReloadAndProfile}, + {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::recordChangeDescriptions}, + }; + return fieldMap; +} + +inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig*) noexcept { + winrt::Microsoft::ReactNative::FieldMap fieldMap { + {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::shouldReloadAndProfile}, + {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::recordChangeDescriptions}, + }; + return fieldMap; +} + +struct ReactDevToolsRuntimeSettingsModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { + static constexpr auto methods = std::tuple{ + Method{0, L"setReloadAndProfileConfig"}, + SyncMethod{1, L"getReloadAndProfileConfig"}, + }; + + template + static constexpr void ValidateModule() noexcept { + constexpr auto methodCheckResults = CheckMethods(); + + REACT_SHOW_METHOD_SPEC_ERRORS( + 0, + "setReloadAndProfileConfig", + " REACT_METHOD(setReloadAndProfileConfig) void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n" + " REACT_METHOD(setReloadAndProfileConfig) static void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 1, + "getReloadAndProfileConfig", + " REACT_SYNC_METHOD(getReloadAndProfileConfig) ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(getReloadAndProfileConfig) static ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n"); + } +}; + +} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h b/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h new file mode 100644 index 00000000000..3aa4d89dc57 --- /dev/null +++ b/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h @@ -0,0 +1,41 @@ + +/* + * This file is auto-generated from a NativeModule spec file in js. + * + * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules + * in a way that also verifies at compile time that the native module matches the interface required + * by the TurboModule JS spec. + */ +#pragma once +// clang-format off + +#include +#include + +namespace Microsoft::ReactNativeSpecs { + + +struct ReactDevToolsSettingsManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { + static constexpr auto methods = std::tuple{ + Method{0, L"setGlobalHookSettings"}, + SyncMethod() noexcept>{1, L"getGlobalHookSettings"}, + }; + + template + static constexpr void ValidateModule() noexcept { + constexpr auto methodCheckResults = CheckMethods(); + + REACT_SHOW_METHOD_SPEC_ERRORS( + 0, + "setGlobalHookSettings", + " REACT_METHOD(setGlobalHookSettings) void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n" + " REACT_METHOD(setGlobalHookSettings) static void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n"); + REACT_SHOW_METHOD_SPEC_ERRORS( + 1, + "getGlobalHookSettings", + " REACT_SYNC_METHOD(getGlobalHookSettings) std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n" + " REACT_SYNC_METHOD(getGlobalHookSettings) static std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n"); + } +}; + +} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h index 815ec04a8e7..0be3c21771a 100644 --- a/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h +++ b/vnext/codegen/NativeReactNativeFeatureFlagsSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeRedBoxSpec.g.h b/vnext/codegen/NativeRedBoxSpec.g.h index c6ef7c88d3b..df5920f44d0 100644 --- a/vnext/codegen/NativeRedBoxSpec.g.h +++ b/vnext/codegen/NativeRedBoxSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeSampleTurboModuleSpec.g.h b/vnext/codegen/NativeSampleTurboModuleSpec.g.h index 4eea12cc988..e599aee4c06 100644 --- a/vnext/codegen/NativeSampleTurboModuleSpec.g.h +++ b/vnext/codegen/NativeSampleTurboModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeSegmentFetcherSpec.g.h b/vnext/codegen/NativeSegmentFetcherSpec.g.h index da91959a07b..437c2ec2733 100644 --- a/vnext/codegen/NativeSegmentFetcherSpec.g.h +++ b/vnext/codegen/NativeSegmentFetcherSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeSettingsManagerSpec.g.h b/vnext/codegen/NativeSettingsManagerSpec.g.h index ef1fdcee8b7..e7c95185389 100644 --- a/vnext/codegen/NativeSettingsManagerSpec.g.h +++ b/vnext/codegen/NativeSettingsManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeShareModuleSpec.g.h b/vnext/codegen/NativeShareModuleSpec.g.h index e464e8ef122..203924e6799 100644 --- a/vnext/codegen/NativeShareModuleSpec.g.h +++ b/vnext/codegen/NativeShareModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeSoundManagerSpec.g.h b/vnext/codegen/NativeSoundManagerSpec.g.h index bda018e0562..0261a978d41 100644 --- a/vnext/codegen/NativeSoundManagerSpec.g.h +++ b/vnext/codegen/NativeSoundManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeSourceCodeSpec.g.h b/vnext/codegen/NativeSourceCodeSpec.g.h index 668955e1149..814ab87ba70 100644 --- a/vnext/codegen/NativeSourceCodeSpec.g.h +++ b/vnext/codegen/NativeSourceCodeSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h b/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h index 5e88242e4e3..1bd4371f002 100644 --- a/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h +++ b/vnext/codegen/NativeStatusBarManagerAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h b/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h index fc91d65d92f..aa643aa9c06 100644 --- a/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h +++ b/vnext/codegen/NativeStatusBarManagerIOSSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeTimingSpec.g.h b/vnext/codegen/NativeTimingSpec.g.h index 9e13a81d129..8f06e1a7529 100644 --- a/vnext/codegen/NativeTimingSpec.g.h +++ b/vnext/codegen/NativeTimingSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeToastAndroidSpec.g.h b/vnext/codegen/NativeToastAndroidSpec.g.h index ddc51e3e8bb..117aefda153 100644 --- a/vnext/codegen/NativeToastAndroidSpec.g.h +++ b/vnext/codegen/NativeToastAndroidSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeUIManagerSpec.g.h b/vnext/codegen/NativeUIManagerSpec.g.h index 495b10192a1..184a9583566 100644 --- a/vnext/codegen/NativeUIManagerSpec.g.h +++ b/vnext/codegen/NativeUIManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeVibrationSpec.g.h b/vnext/codegen/NativeVibrationSpec.g.h index 41b7edd44ab..0f62498567b 100644 --- a/vnext/codegen/NativeVibrationSpec.g.h +++ b/vnext/codegen/NativeVibrationSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeWebSocketModuleSpec.g.h b/vnext/codegen/NativeWebSocketModuleSpec.g.h index a73f9ddb8f0..1e037ea4d15 100644 --- a/vnext/codegen/NativeWebSocketModuleSpec.g.h +++ b/vnext/codegen/NativeWebSocketModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include From ea7424bf38470093e48dc984f6cc28a89a917bd3 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 9 Dec 2024 13:45:15 -0800 Subject: [PATCH 2/3] Add ability to override UpdateLayoutMetrics and VisualToMountChildrenInto (#14182) * Add ability to override UpdateLayoutMetrics and VisualToMountChildrenInto * Change files * format * fix --- ...-fc9a80b3-b16a-458c-b6e9-230a3d4f14f2.json | 7 ++ ...-2e9f4c25-c40a-4434-9c2c-0d6672969f47.json | 7 ++ .../generators/GenerateComponentWindows.ts | 15 +++ .../Fabric/ComponentView.cpp | 72 +++++------- .../Fabric/ComponentView.h | 25 +--- .../CompositionViewComponentView.cpp | 28 ++--- .../CompositionViewComponentView.h | 7 +- .../ContentIslandComponentView.cpp | 11 +- .../Composition/ContentIslandComponentView.h | 3 +- .../ReactCompositionViewComponentBuilder.cpp | 108 +++++++++++++----- .../ReactCompositionViewComponentBuilder.h | 22 +++- .../IReactCompositionViewComponentBuilder.idl | 25 ++++ 12 files changed, 211 insertions(+), 119 deletions(-) create mode 100644 change/@react-native-windows-codegen-fc9a80b3-b16a-458c-b6e9-230a3d4f14f2.json create mode 100644 change/react-native-windows-2e9f4c25-c40a-4434-9c2c-0d6672969f47.json diff --git a/change/@react-native-windows-codegen-fc9a80b3-b16a-458c-b6e9-230a3d4f14f2.json b/change/@react-native-windows-codegen-fc9a80b3-b16a-458c-b6e9-230a3d4f14f2.json new file mode 100644 index 00000000000..0e19c6e196a --- /dev/null +++ b/change/@react-native-windows-codegen-fc9a80b3-b16a-458c-b6e9-230a3d4f14f2.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add ability to override UpdateLayoutMetrics and VisualToMountChildrenInto", + "packageName": "@react-native-windows/codegen", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-2e9f4c25-c40a-4434-9c2c-0d6672969f47.json b/change/react-native-windows-2e9f4c25-c40a-4434-9c2c-0d6672969f47.json new file mode 100644 index 00000000000..d4f99015357 --- /dev/null +++ b/change/react-native-windows-2e9f4c25-c40a-4434-9c2c-0d6672969f47.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Add ability to override UpdateLayoutMetrics and VisualToMountChildrenInto", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts b/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts index 803024dbeeb..8a6c7544856 100644 --- a/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts +++ b/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts @@ -29,6 +29,7 @@ type FilesOutput = Map; const headerTemplate = `/* * This file is auto-generated from ::_COMPONENT_NAME_::NativeComponent spec file in flow / TypeScript. */ +// clang-format off #pragma once #include @@ -95,6 +96,13 @@ struct Base::_COMPONENT_NAME_:: { m_props = newProps; } + // UpdateLayoutMetrics will only be called if this method is overridden + virtual void UpdateLayoutMetrics( + const winrt::Microsoft::ReactNative::ComponentView &/*view*/, + const winrt::Microsoft::ReactNative::LayoutMetrics &/*newLayoutMetrics*/, + const winrt::Microsoft::ReactNative::LayoutMetrics &/*oldLayoutMetrics*/) noexcept { + } + // UpdateState will only be called if this method is overridden virtual void UpdateState( const winrt::Microsoft::ReactNative::ComponentView &/*view*/, @@ -163,6 +171,13 @@ void Register::_COMPONENT_NAME_::NativeComponent( userData->UpdateProps(view, newProps ? newProps.as<::_COMPONENT_NAME_::Props>() : nullptr, oldProps ? oldProps.as<::_COMPONENT_NAME_::Props>() : nullptr); }); + compBuilder.SetUpdateLayoutMetricsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, + const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, + const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) noexcept { + auto userData = view.UserData().as(); + userData->UpdateLayoutMetrics(view, newLayoutMetrics, oldLayoutMetrics); + }); + builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::EventEmitter &eventEmitter) noexcept { auto userData = view.UserData().as(); diff --git a/vnext/Microsoft.ReactNative/Fabric/ComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/ComponentView.cpp index 00a1e05df43..4895e1e2328 100644 --- a/vnext/Microsoft.ReactNative/Fabric/ComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/ComponentView.cpp @@ -22,11 +22,12 @@ struct RootComponentView; namespace winrt::Microsoft::ReactNative::implementation { -ComponentView::ComponentView(facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext) - : m_tag(tag), m_reactContext(reactContext) {} - -void ComponentView::MarkAsCustomComponent() noexcept { - m_customComponent = true; +ComponentView::ComponentView( + facebook::react::Tag tag, + winrt::Microsoft::ReactNative::ReactContext const &reactContext, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder) + : m_tag(tag), m_reactContext(reactContext) { + m_builder.copy_from(builder); } std::vector @@ -52,18 +53,15 @@ void ComponentView::MountChildComponentView( uint32_t index) noexcept { m_children.InsertAt(index, childComponentView); winrt::get_self(childComponentView)->parent(*this); - if (m_mountChildComponentViewHandler) { - m_mountChildComponentViewHandler(*this, winrt::make(childComponentView, index)); + if (m_builder && m_builder->MountChildComponentViewHandler()) { + m_builder->MountChildComponentViewHandler()( + *this, winrt::make(childComponentView, index)); } if (m_mounted) { winrt::get_self(childComponentView)->onMounted(); } } -void ComponentView::MountChildComponentViewHandler(const MountChildComponentViewDelegate &handler) noexcept { - m_mountChildComponentViewHandler = handler; -} - void ComponentView::onMounted() noexcept { assert(!m_mounted); m_mounted = true; @@ -89,16 +87,14 @@ void ComponentView::Mounted(winrt::event_token const &token) noexcept { void ComponentView::UnmountChildComponentView( const winrt::Microsoft::ReactNative::ComponentView &childComponentView, uint32_t index) noexcept { - if (m_mountChildComponentViewHandler) { - m_mountChildComponentViewHandler(*this, winrt::make(childComponentView, index)); + if (m_builder && m_builder->UnmountChildComponentViewHandler()) { + m_builder->UnmountChildComponentViewHandler()( + *this, winrt::make(childComponentView, index)); } m_children.RemoveAt(index); winrt::get_self(childComponentView)->parent(nullptr); winrt::get_self(childComponentView)->onUnmounted(); } -void ComponentView::UnmountChildComponentViewHandler(const UnmountChildComponentViewDelegate &handler) noexcept { - m_unmountChildComponentViewHandler = handler; -} void ComponentView::onUnmounted() noexcept { if (!m_mounted) @@ -148,15 +144,11 @@ uint32_t UnmountChildComponentViewArgs::Index() const noexcept { void ComponentView::updateProps( facebook::react::Props::Shared const &props, facebook::react::Props::Shared const &oldProps) noexcept { - if (m_updatePropsDelegate) { - m_updatePropsDelegate(*this, userProps(props), oldProps ? userProps(oldProps) : nullptr); + if (m_builder && m_builder->UpdatePropsHandler()) { + m_builder->UpdatePropsHandler()(*this, userProps(props), oldProps ? userProps(oldProps) : nullptr); } } -void ComponentView::UpdatePropsHandler(const UpdatePropsDelegate &handler) noexcept { - m_updatePropsDelegate = handler; -} - const winrt::Microsoft::ReactNative::IComponentProps ComponentView::userProps( facebook::react::Props::Shared const &props) noexcept { const auto &abiProps = @@ -165,28 +157,20 @@ const winrt::Microsoft::ReactNative::IComponentProps ComponentView::userProps( } void ComponentView::updateEventEmitter(facebook::react::EventEmitter::Shared const &eventEmitter) noexcept { - if (m_updateEventEmitterHandler) { - m_updateEventEmitterHandler(*this, winrt::make(eventEmitter)); + if (m_builder && m_builder->UpdateEventEmitterHandler()) { + m_builder->UpdateEventEmitterHandler()(*this, winrt::make(eventEmitter)); } } -void ComponentView::UpdateEventEmitterHandler(const UpdateEventEmitterDelegate &handler) noexcept { - m_updateEventEmitterHandler = handler; -} - void ComponentView::updateState( facebook::react::State::Shared const &state, facebook::react::State::Shared const &oldState) noexcept { // Avoid new-ing up a new AbiComponentState on every state change if we are not a custom component - if (m_updateStateDelegate) { - m_updateStateDelegate(*this, winrt::make<::Microsoft::ReactNative::AbiComponentState>(state)); + if (m_builder && m_builder->UpdateStateHandler()) { + m_builder->UpdateStateHandler()(*this, winrt::make<::Microsoft::ReactNative::AbiComponentState>(state)); } } -void ComponentView::UpdateStateHandler(const UpdateStateDelegate &handler) noexcept { - m_updateStateDelegate = handler; -} - LayoutMetricsChangedArgs::LayoutMetricsChangedArgs( const winrt::Microsoft::ReactNative::LayoutMetrics &newLayoutMetrics, const winrt::Microsoft::ReactNative::LayoutMetrics &oldLayoutMetrics) @@ -216,6 +200,10 @@ void ComponentView::updateLayoutMetrics( layoutMetrics.frame.size.height}, layoutMetrics.pointScaleFactor}; + if (m_builder && m_builder->UpdateLayoutMetricsHandler()) { + m_builder->UpdateLayoutMetricsHandler()(*this, newMetrics, oldMetrics); + } + m_layoutMetrics = layoutMetrics; m_layoutMetricsChangedEvent(*this, winrt::make(newMetrics, oldMetrics)); @@ -240,13 +228,9 @@ void ComponentView::LayoutMetricsChanged(winrt::event_token const &token) noexce m_layoutMetricsChangedEvent.remove(token); } -void ComponentView::FinalizeUpdateHandler(const UpdateFinalizerDelegate &handler) noexcept { - m_finalizeUpdateHandler = handler; -} - void ComponentView::FinalizeUpdates(winrt::Microsoft::ReactNative::ComponentViewUpdateMask updateMask) noexcept { - if (m_finalizeUpdateHandler) { - m_finalizeUpdateHandler(*this, updateMask); + if (m_builder && m_builder->FinalizeUpdateHandler()) { + m_builder->FinalizeUpdateHandler()(*this, updateMask); } } @@ -257,13 +241,9 @@ facebook::react::Props::Shared ComponentView::props() noexcept { return {}; } -void ComponentView::CustomCommandHandler(const HandleCommandDelegate &handler) noexcept { - m_customCommandHandler = handler; -} - void ComponentView::HandleCommand(const winrt::Microsoft::ReactNative::HandleCommandArgs &args) noexcept { - if (m_customCommandHandler) { - m_customCommandHandler(*this, args); + if (m_builder && m_builder->CustomCommandHandler()) { + m_builder->CustomCommandHandler()(*this, args); } } diff --git a/vnext/Microsoft.ReactNative/Fabric/ComponentView.h b/vnext/Microsoft.ReactNative/Fabric/ComponentView.h index 074bac0a445..aefaff97d98 100644 --- a/vnext/Microsoft.ReactNative/Fabric/ComponentView.h +++ b/vnext/Microsoft.ReactNative/Fabric/ComponentView.h @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -80,7 +81,10 @@ struct UnmountChildComponentViewArgs : public UnmountChildComponentViewArgsT { - ComponentView(facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext); + ComponentView( + facebook::react::Tag tag, + winrt::Microsoft::ReactNative::ReactContext const &reactContext, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder); virtual std::vector supplementalComponentDescriptorProviders() noexcept; virtual void updateProps( @@ -115,7 +119,6 @@ struct ComponentView virtual void onGettingFocus(const winrt::Microsoft::ReactNative::GettingFocusEventArgs &args) noexcept; virtual void onLostFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept; virtual void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept; - void MarkAsCustomComponent() noexcept; virtual void onMounted() noexcept; bool isMounted() noexcept; virtual void onUnmounted() noexcept; @@ -223,14 +226,6 @@ struct ComponentView void UserData(const winrt::IInspectable &userData) noexcept; winrt::IInspectable UserData() const noexcept; - void CustomCommandHandler(const HandleCommandDelegate &handler) noexcept; - void UpdatePropsHandler(const UpdatePropsDelegate &handler) noexcept; - void UpdateStateHandler(const UpdateStateDelegate &handler) noexcept; - void UpdateEventEmitterHandler(const UpdateEventEmitterDelegate &handler) noexcept; - void MountChildComponentViewHandler(const MountChildComponentViewDelegate &handler) noexcept; - void UnmountChildComponentViewHandler(const UnmountChildComponentViewDelegate &handler) noexcept; - void FinalizeUpdateHandler(const UpdateFinalizerDelegate &handler) noexcept; - virtual void MountChildComponentView( const winrt::Microsoft::ReactNative::ComponentView &childComponentView, uint32_t index) noexcept; @@ -258,7 +253,7 @@ struct ComponentView const winrt::Microsoft::ReactNative::Composition::Input::CharacterReceivedRoutedEventArgs &args) noexcept; protected: - bool m_customComponent : 1 {false}; // Is a user custom component, and so needs to call external override functions + winrt::com_ptr m_builder; bool m_mounted : 1 {false}; const facebook::react::Tag m_tag; winrt::IInspectable m_userData; @@ -270,14 +265,6 @@ struct ComponentView winrt::Windows::Foundation::Collections::IVector m_children{ winrt::single_threaded_vector()}; - UpdatePropsDelegate m_updatePropsDelegate{nullptr}; - UpdateStateDelegate m_updateStateDelegate{nullptr}; - HandleCommandDelegate m_customCommandHandler{nullptr}; - UpdateFinalizerDelegate m_finalizeUpdateHandler{nullptr}; - MountChildComponentViewDelegate m_mountChildComponentViewHandler{nullptr}; - UnmountChildComponentViewDelegate m_unmountChildComponentViewHandler{nullptr}; - UpdateEventEmitterDelegate m_updateEventEmitterHandler{nullptr}; - winrt::event< winrt::Windows::Foundation::EventHandler> m_keyDownEvent; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp index a77e4bb5ed0..9f7578a0451 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp @@ -53,8 +53,9 @@ ComponentView::ComponentView( const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext, facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext, - ComponentViewFeatures flags) - : base_type(tag, reactContext), m_compContext(compContext), m_flags(flags) { + ComponentViewFeatures flags, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder) + : base_type(tag, reactContext, builder), m_compContext(compContext), m_flags(flags) { m_outerVisual = compContext.CreateSpriteVisual(); // TODO could be a raw ContainerVisual if we had a // CreateContainerVisual in ICompositionContext } @@ -916,24 +917,15 @@ ViewComponentView::ViewComponentView( const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext, facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext, - ComponentViewFeatures flags) - : base_type(compContext, tag, reactContext, flags), + ComponentViewFeatures flags, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder) + : base_type(compContext, tag, reactContext, flags, builder), m_props(defaultProps ? defaultProps : ViewComponentView::defaultProps()) {} winrt::Microsoft::ReactNative::Composition::Experimental::IVisual ViewComponentView::createVisual() noexcept { return m_compContext.CreateSpriteVisual(); } -void ViewComponentView::CreateVisualHandler( - const winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate &handler) { - m_createVisualHandler = handler; -} - -winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate ViewComponentView::CreateVisualHandler() - const noexcept { - return m_createVisualHandler; -} - void ViewComponentView::CreateInternalVisualHandler( const winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate &handler) { m_createInternalVisualHandler = handler; @@ -948,10 +940,10 @@ void ViewComponentView::ensureVisual() noexcept { if (!m_visual) { if (m_createInternalVisualHandler) { m_visual = m_createInternalVisualHandler(*this); - } else if (m_createVisualHandler) { + } else if (m_builder && m_builder->CreateVisualHandler()) { m_visual = winrt::Microsoft::ReactNative::Composition::Experimental::MicrosoftCompositionContextHelper::CreateVisual( - m_createVisualHandler(*this)); + m_builder->CreateVisualHandler()(*this)); } else { m_visual = createVisual(); } @@ -969,6 +961,8 @@ winrt::Microsoft::ReactNative::ComponentView ViewComponentView::Create( winrt::Microsoft::ReactNative::Composition::Experimental::IVisual ViewComponentView::VisualToMountChildrenInto() noexcept { + if (m_builder && m_builder->VisualToMountChildrenIntoHandler()) + return m_builder->VisualToMountChildrenIntoHandler()(*this); return Visual(); } @@ -1216,7 +1210,7 @@ winrt::Microsoft::ReactNative::ViewProps ViewComponentView::ViewProps() noexcept winrt::Microsoft::ReactNative::ViewProps ViewComponentView::ViewPropsInner() noexcept { // If we have AbiViewProps, then we dont need to new up a props wrapper - if (m_customComponent) { + if (m_builder) { const auto &abiViewProps = *std::static_pointer_cast(m_props); return abiViewProps.ViewProps(); } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h index f7b826a7343..83a926be017 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h @@ -35,7 +35,8 @@ struct ComponentView : public ComponentViewT< const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext, facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext, - ComponentViewFeatures flags); + ComponentViewFeatures flags, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder); virtual ~ComponentView(); virtual winrt::Microsoft::ReactNative::Composition::Experimental::IVisual Visual() const noexcept { @@ -208,7 +209,8 @@ struct ViewComponentView : public ViewComponentViewT< const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext, facebook::react::Tag tag, winrt::Microsoft::ReactNative::ReactContext const &reactContext, - ComponentViewFeatures flags); + ComponentViewFeatures flags, + winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder *builder = nullptr); virtual winrt::Microsoft::ReactNative::Composition::Experimental::IVisual createVisual() noexcept; @@ -226,7 +228,6 @@ struct ViewComponentView : public ViewComponentViewT< bool m_hasNonVisualChildren{false}; facebook::react::SharedViewProps m_props; winrt::Microsoft::ReactNative::Composition::Experimental::IVisual m_visual{nullptr}; - winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate m_createVisualHandler{nullptr}; winrt::Microsoft::ReactNative::Composition::Experimental::CreateInternalVisualDelegate m_createInternalVisualHandler{ nullptr}; }; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp index 84b10002bd8..70f73d834fa 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp @@ -22,8 +22,15 @@ namespace winrt::Microsoft::ReactNative::Composition::implementation { ContentIslandComponentView::ContentIslandComponentView( const winrt::Microsoft::ReactNative::Composition::Experimental::ICompositionContext &compContext, facebook::react::Tag tag, - winrt::Microsoft::ReactNative::ReactContext const &reactContext) - : base_type(ViewComponentView::defaultProps(), compContext, tag, reactContext, ComponentViewFeatures::Default) { + winrt::Microsoft::ReactNative::ReactContext const &reactContext, + ReactCompositionViewComponentBuilder *builder) + : base_type( + ViewComponentView::defaultProps(), + compContext, + tag, + reactContext, + ComponentViewFeatures::Default, + builder) { m_mountedToken = Mounted([](const winrt::IInspectable &, const winrt::Microsoft::ReactNative::ComponentView &view) { view.as()->OnMounted(); }); diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h b/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h index 3dc0259a3f2..ae252c9bb61 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h @@ -40,7 +40,8 @@ struct ContentIslandComponentView : ContentIslandComponentViewT #include #include +#include "CompositionContextHelper.h" #include "DynamicWriter.h" #include "ReactHost/MsoUtils.h" @@ -52,24 +53,6 @@ LayoutHandler ReactCompositionViewComponentBuilder::LayoutHandler() const noexce void ReactCompositionViewComponentBuilder::InitializeComponentView( const winrt::Microsoft::ReactNative::ComponentView &view) noexcept { auto self = winrt::get_self(view); - self->MarkAsCustomComponent(); - if (m_customCommandHandler) - self->CustomCommandHandler(m_customCommandHandler); - if (m_finalizeUpdateHandler) - self->FinalizeUpdateHandler(m_finalizeUpdateHandler); - if (m_updatePropsHandler) - self->UpdatePropsHandler(m_updatePropsHandler); - if (m_updateStateHandler) - self->UpdateStateHandler(m_updateStateHandler); - if (m_updateEventEmitterHandler) - self->UpdateEventEmitterHandler(m_updateEventEmitterHandler); - if (m_mountChildComponentViewHandler) - self->MountChildComponentViewHandler(m_mountChildComponentViewHandler); - if (m_unmountChildComponentViewHandler) - self->UnmountChildComponentViewHandler(m_unmountChildComponentViewHandler); - if (m_createVisualHandler) - view.as()->CreateVisualHandler( - m_createVisualHandler); } void ReactCompositionViewComponentBuilder::SetComponentViewInitializer( @@ -78,8 +61,9 @@ void ReactCompositionViewComponentBuilder::SetComponentViewInitializer( const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context, - ComponentViewFeatures) { - auto view = winrt::make(tag, reactContext); + ComponentViewFeatures, + ReactCompositionViewComponentBuilder &builder) { + auto view = winrt::make(tag, reactContext, &builder); initializer(view); return view; }; @@ -94,9 +78,10 @@ void ReactCompositionViewComponentBuilder::SetViewComponentViewInitializer( const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context, - ComponentViewFeatures features) { + ComponentViewFeatures features, + ReactCompositionViewComponentBuilder &builder) { auto view = winrt::make( - implementation::ViewComponentView::defaultProps(), context, tag, reactContext, features); + implementation::ViewComponentView::defaultProps(), context, tag, reactContext, features, &builder); initializer(view); return view; }; @@ -108,14 +93,15 @@ void ReactCompositionViewComponentBuilder::SetViewComponentViewInitializer( void ReactCompositionViewComponentBuilder::SetContentIslandComponentViewInitializer( const ComponentIslandComponentViewInitializer &initializer) noexcept { - m_fnCreateView = - [initializer]( - const IReactContext &reactContext, - int32_t tag, - const Experimental::ICompositionContext &context, - ComponentViewFeatures) -> winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView { + m_fnCreateView = [initializer]( + const IReactContext &reactContext, + int32_t tag, + const Experimental::ICompositionContext &context, + ComponentViewFeatures /*features*/, + ReactCompositionViewComponentBuilder &builder) + -> winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView { auto view = winrt::make( - context, tag, reactContext); + context, tag, reactContext, &builder); initializer(view); return view; }; @@ -166,46 +152,108 @@ void ReactCompositionViewComponentBuilder::SetCustomCommandHandler(HandleCommand m_customCommandHandler = impl; } +const HandleCommandDelegate &ReactCompositionViewComponentBuilder::CustomCommandHandler() const noexcept { + return m_customCommandHandler; +} + void ReactCompositionViewComponentBuilder::SetFinalizeUpdateHandler(UpdateFinalizerDelegate impl) noexcept { m_finalizeUpdateHandler = impl; } +const UpdateFinalizerDelegate &ReactCompositionViewComponentBuilder::FinalizeUpdateHandler() const noexcept { + return m_finalizeUpdateHandler; +} + void ReactCompositionViewComponentBuilder::SetUpdatePropsHandler(UpdatePropsDelegate impl) noexcept { m_updatePropsHandler = impl; } +const winrt::Microsoft::ReactNative::UpdatePropsDelegate &ReactCompositionViewComponentBuilder::UpdatePropsHandler() + const noexcept { + return m_updatePropsHandler; +} + void ReactCompositionViewComponentBuilder::SetUpdateStateHandler(UpdateStateDelegate impl) noexcept { m_updateStateHandler = impl; } +const winrt::Microsoft::ReactNative::UpdateStateDelegate &ReactCompositionViewComponentBuilder::UpdateStateHandler() + const noexcept { + return m_updateStateHandler; +} + void ReactCompositionViewComponentBuilder::SetUpdateEventEmitterHandler(UpdateEventEmitterDelegate impl) noexcept { m_updateEventEmitterHandler = impl; } +const UpdateEventEmitterDelegate &ReactCompositionViewComponentBuilder::UpdateEventEmitterHandler() const noexcept { + return m_updateEventEmitterHandler; +} + void ReactCompositionViewComponentBuilder::SetMountChildComponentViewHandler( MountChildComponentViewDelegate impl) noexcept { m_mountChildComponentViewHandler = impl; } +const MountChildComponentViewDelegate &ReactCompositionViewComponentBuilder::MountChildComponentViewHandler() + const noexcept { + return m_mountChildComponentViewHandler; +} + void ReactCompositionViewComponentBuilder::SetUnmountChildComponentViewHandler( UnmountChildComponentViewDelegate impl) noexcept { m_unmountChildComponentViewHandler = impl; } +const UnmountChildComponentViewDelegate &ReactCompositionViewComponentBuilder::UnmountChildComponentViewHandler() + const noexcept { + return m_unmountChildComponentViewHandler; +} + void ReactCompositionViewComponentBuilder::SetCreateVisualHandler(CreateVisualDelegate impl) noexcept { m_createVisualHandler = impl; } +const CreateVisualDelegate &ReactCompositionViewComponentBuilder::CreateVisualHandler() const noexcept { + return m_createVisualHandler; +} + void ReactCompositionViewComponentBuilder::SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept { m_features = viewFeatures; } +void ReactCompositionViewComponentBuilder::SetVisualToMountChildrenIntoHandler( + VisualToMountChildrenIntoDelegate impl) noexcept { + m_visualToMountChildrenIntoHandler = [impl](const winrt::Microsoft::ReactNative::ComponentView &view) { + return winrt::Microsoft::ReactNative::Composition::Experimental::implementation::MicrosoftCompositionContextHelper:: + CreateVisual(impl(view)); + }; +} + +void ReactCompositionViewComponentBuilder::SetIVisualToMountChildrenIntoHandler( + winrt::Microsoft::ReactNative::Composition::Experimental::IVisualToMountChildrenIntoDelegate impl) noexcept { + m_visualToMountChildrenIntoHandler = impl; +} + +const winrt::Microsoft::ReactNative::Composition::Experimental::IVisualToMountChildrenIntoDelegate & +ReactCompositionViewComponentBuilder::VisualToMountChildrenIntoHandler() const noexcept { + return m_visualToMountChildrenIntoHandler; +} + +void ReactCompositionViewComponentBuilder::SetUpdateLayoutMetricsHandler(UpdateLayoutMetricsDelegate impl) noexcept { + m_updateLayoutMetricsHandler = impl; +} + +const UpdateLayoutMetricsDelegate &ReactCompositionViewComponentBuilder::UpdateLayoutMetricsHandler() const noexcept { + return m_updateLayoutMetricsHandler; +} + winrt::Microsoft::ReactNative::ComponentView ReactCompositionViewComponentBuilder::CreateView( const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context) noexcept { assert(m_fnCreateView); - auto view = m_fnCreateView(reactContext, tag, context, m_features); + auto view = m_fnCreateView(reactContext, tag, context, m_features, *this); InitializeComponentView(view); return view; } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h index 220884bd6c6..618aae06e5d 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h @@ -44,6 +44,10 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< void SetContentIslandComponentViewInitializer(const ComponentIslandComponentViewInitializer &initializer) noexcept; void SetCreateVisualHandler(CreateVisualDelegate impl) noexcept; void SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept; + void SetVisualToMountChildrenIntoHandler(VisualToMountChildrenIntoDelegate impl) noexcept; + void SetIVisualToMountChildrenIntoHandler( + winrt::Microsoft::ReactNative::Composition::Experimental::IVisualToMountChildrenIntoDelegate impl) noexcept; + void SetUpdateLayoutMetricsHandler(UpdateLayoutMetricsDelegate impl) noexcept; public: IComponentProps CreateProps(ViewProps props, const IComponentProps &cloneFrom) noexcept; @@ -60,6 +64,18 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< facebook::react::Tag tag, const Experimental::ICompositionContext &context) noexcept; + const UpdateFinalizerDelegate &FinalizeUpdateHandler() const noexcept; + const HandleCommandDelegate &CustomCommandHandler() const noexcept; + const winrt::Microsoft::ReactNative::UpdatePropsDelegate &UpdatePropsHandler() const noexcept; + const winrt::Microsoft::ReactNative::UpdateStateDelegate &UpdateStateHandler() const noexcept; + const UpdateEventEmitterDelegate &UpdateEventEmitterHandler() const noexcept; + const MountChildComponentViewDelegate &MountChildComponentViewHandler() const noexcept; + const UnmountChildComponentViewDelegate &UnmountChildComponentViewHandler() const noexcept; + const UpdateLayoutMetricsDelegate &UpdateLayoutMetricsHandler() const noexcept; + const CreateVisualDelegate &CreateVisualHandler() const noexcept; + const winrt::Microsoft::ReactNative::Composition::Experimental::IVisualToMountChildrenIntoDelegate & + VisualToMountChildrenIntoHandler() const noexcept; + private: void InitializeComponentView(const winrt::Microsoft::ReactNative::ComponentView &view) noexcept; @@ -74,7 +90,8 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context, - ComponentViewFeatures features)> + ComponentViewFeatures features, + ReactCompositionViewComponentBuilder &builder)> m_fnCreateView; std::function m_descriptorConstructorFactory; winrt::Microsoft::ReactNative::HandleCommandDelegate m_customCommandHandler; @@ -86,6 +103,9 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< winrt::Microsoft::ReactNative::UnmountChildComponentViewDelegate m_unmountChildComponentViewHandler; winrt::Microsoft::ReactNative::Composition::CreateVisualDelegate m_createVisualHandler; + winrt::Microsoft::ReactNative::Composition::Experimental::IVisualToMountChildrenIntoDelegate + m_visualToMountChildrenIntoHandler; + UpdateLayoutMetricsDelegate m_updateLayoutMetricsHandler; }; } // namespace winrt::Microsoft::ReactNative::Composition diff --git a/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl b/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl index 021103285d9..2edf2b822aa 100644 --- a/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +++ b/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl @@ -25,6 +25,29 @@ namespace Microsoft.ReactNative.Composition [webhosthidden] delegate Microsoft.UI.Composition.Visual CreateVisualDelegate(Microsoft.ReactNative.ComponentView view); + [experimental] + delegate void UpdateLayoutMetricsDelegate(Microsoft.ReactNative.ComponentView source, Microsoft.ReactNative.LayoutMetrics newLayoutMetrics, Microsoft.ReactNative.LayoutMetrics oldLayoutMetrics); + + [experimental] + [webhosthidden] + delegate Microsoft.UI.Composition.Visual VisualToMountChildrenIntoDelegate(Microsoft.ReactNative.ComponentView view); + + namespace Experimental { + [experimental] + [webhosthidden] + DOC_STRING("This type will be removed in future versions") + delegate Microsoft.ReactNative.Composition.Experimental.IVisual IVisualToMountChildrenIntoDelegate(Microsoft.ReactNative.ComponentView view); + + [experimental] + [webhosthidden] + DOC_STRING("This interface is for use when running react-native-windows using a custom compositor. " + "This interface will be removed in future versions") + interface IReactCompositionViewComponentInternalBuilder + { + void SetIVisualToMountChildrenIntoHandler(IVisualToMountChildrenIntoDelegate impl); + }; + } + [webhosthidden] [experimental] DOC_STRING(".") @@ -34,6 +57,8 @@ namespace Microsoft.ReactNative.Composition void SetContentIslandComponentViewInitializer(ComponentIslandComponentViewInitializer initializer); void SetCreateVisualHandler(CreateVisualDelegate impl); void SetViewFeatures(ComponentViewFeatures viewFeatures); + void SetUpdateLayoutMetricsHandler(UpdateLayoutMetricsDelegate impl); + void SetVisualToMountChildrenIntoHandler(VisualToMountChildrenIntoDelegate impl); }; } // namespace Microsoft.ReactNative From ed89944e709c69c674e8b12252ffac4d6c9ee253 Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:01:56 -0800 Subject: [PATCH 3/3] fix --- .../NativeAnimationsDebugModuleSpec.g.h | 1 + .../NativeDevToolsSettingsManagerSpec.g.h | 1 + .../codegen/NativePerformanceObserverSpec.g.h | 1 + .../NativePlatformConstantsWinSpec.g.h | 1 + .../NativePlatformConstantsWindowsSpec.g.h | 82 ------------------- ...ReactDevToolsRuntimeSettingsModuleSpec.g.h | 67 --------------- ...NativeReactDevToolsSettingsManagerSpec.g.h | 41 ---------- 7 files changed, 4 insertions(+), 190 deletions(-) delete mode 100644 vnext/codegen/NativePlatformConstantsWindowsSpec.g.h delete mode 100644 vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h delete mode 100644 vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h diff --git a/vnext/codegen/NativeAnimationsDebugModuleSpec.g.h b/vnext/codegen/NativeAnimationsDebugModuleSpec.g.h index 3a4904084c5..a2bcd285f3e 100644 --- a/vnext/codegen/NativeAnimationsDebugModuleSpec.g.h +++ b/vnext/codegen/NativeAnimationsDebugModuleSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativeDevToolsSettingsManagerSpec.g.h b/vnext/codegen/NativeDevToolsSettingsManagerSpec.g.h index bd96ca414a2..056658eb648 100644 --- a/vnext/codegen/NativeDevToolsSettingsManagerSpec.g.h +++ b/vnext/codegen/NativeDevToolsSettingsManagerSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePerformanceObserverSpec.g.h b/vnext/codegen/NativePerformanceObserverSpec.g.h index af070ff45ea..f459a197bc7 100644 --- a/vnext/codegen/NativePerformanceObserverSpec.g.h +++ b/vnext/codegen/NativePerformanceObserverSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePlatformConstantsWinSpec.g.h b/vnext/codegen/NativePlatformConstantsWinSpec.g.h index 8b991c7a120..892acdbe9b9 100644 --- a/vnext/codegen/NativePlatformConstantsWinSpec.g.h +++ b/vnext/codegen/NativePlatformConstantsWinSpec.g.h @@ -7,6 +7,7 @@ * by the TurboModule JS spec. */ #pragma once +// clang-format off #include #include diff --git a/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h b/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h deleted file mode 100644 index 60065d28fb2..00000000000 --- a/vnext/codegen/NativePlatformConstantsWindowsSpec.g.h +++ /dev/null @@ -1,82 +0,0 @@ - -/* - * This file is auto-generated from a NativeModule spec file in js. - * - * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules - * in a way that also verifies at compile time that the native module matches the interface required - * by the TurboModule JS spec. - */ -#pragma once -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion { - double major; - double minor; - double patch; - std::optional prerelease; -}; - -struct PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion { - double major; - double minor; - double patch; -}; - -struct PlatformConstantsWindowsSpec_PlatformConstantsWindows { - bool isTesting; - std::optional isDisableAnimations; - PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion reactNativeVersion; - PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion reactNativeWindowsVersion; - double osVersion; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::major}, - {L"minor", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::minor}, - {L"patch", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::patch}, - {L"prerelease", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeVersion::prerelease}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"major", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::major}, - {L"minor", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::minor}, - {L"patch", &PlatformConstantsWindowsSpec_PlatformConstantsWindows_reactNativeWindowsVersion::patch}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(PlatformConstantsWindowsSpec_PlatformConstantsWindows*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"isTesting", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isTesting}, - {L"isDisableAnimations", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::isDisableAnimations}, - {L"reactNativeVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeVersion}, - {L"reactNativeWindowsVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::reactNativeWindowsVersion}, - {L"osVersion", &PlatformConstantsWindowsSpec_PlatformConstantsWindows::osVersion}, - }; - return fieldMap; -} - -struct PlatformConstantsWindowsSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h b/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h deleted file mode 100644 index c9275869659..00000000000 --- a/vnext/codegen/NativeReactDevToolsRuntimeSettingsModuleSpec.g.h +++ /dev/null @@ -1,67 +0,0 @@ - -/* - * This file is auto-generated from a NativeModule spec file in js. - * - * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules - * in a way that also verifies at compile time that the native module matches the interface required - * by the TurboModule JS spec. - */ -#pragma once -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - -struct ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig { - std::optional shouldReloadAndProfile; - std::optional recordChangeDescriptions; -}; - -struct ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig { - bool shouldReloadAndProfile; - bool recordChangeDescriptions; -}; - - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::shouldReloadAndProfile}, - {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig::recordChangeDescriptions}, - }; - return fieldMap; -} - -inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig*) noexcept { - winrt::Microsoft::ReactNative::FieldMap fieldMap { - {L"shouldReloadAndProfile", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::shouldReloadAndProfile}, - {L"recordChangeDescriptions", &ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig::recordChangeDescriptions}, - }; - return fieldMap; -} - -struct ReactDevToolsRuntimeSettingsModuleSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setReloadAndProfileConfig"}, - SyncMethod{1, L"getReloadAndProfileConfig"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setReloadAndProfileConfig", - " REACT_METHOD(setReloadAndProfileConfig) void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n" - " REACT_METHOD(setReloadAndProfileConfig) static void setReloadAndProfileConfig(ReactDevToolsRuntimeSettingsModuleSpec_PartialReloadAndProfileConfig && config) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getReloadAndProfileConfig", - " REACT_SYNC_METHOD(getReloadAndProfileConfig) ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getReloadAndProfileConfig) static ReactDevToolsRuntimeSettingsModuleSpec_ReloadAndProfileConfig getReloadAndProfileConfig() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs diff --git a/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h b/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h deleted file mode 100644 index 3aa4d89dc57..00000000000 --- a/vnext/codegen/NativeReactDevToolsSettingsManagerSpec.g.h +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * This file is auto-generated from a NativeModule spec file in js. - * - * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules - * in a way that also verifies at compile time that the native module matches the interface required - * by the TurboModule JS spec. - */ -#pragma once -// clang-format off - -#include -#include - -namespace Microsoft::ReactNativeSpecs { - - -struct ReactDevToolsSettingsManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec { - static constexpr auto methods = std::tuple{ - Method{0, L"setGlobalHookSettings"}, - SyncMethod() noexcept>{1, L"getGlobalHookSettings"}, - }; - - template - static constexpr void ValidateModule() noexcept { - constexpr auto methodCheckResults = CheckMethods(); - - REACT_SHOW_METHOD_SPEC_ERRORS( - 0, - "setGlobalHookSettings", - " REACT_METHOD(setGlobalHookSettings) void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n" - " REACT_METHOD(setGlobalHookSettings) static void setGlobalHookSettings(std::string settings) noexcept { /* implementation */ }\n"); - REACT_SHOW_METHOD_SPEC_ERRORS( - 1, - "getGlobalHookSettings", - " REACT_SYNC_METHOD(getGlobalHookSettings) std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n" - " REACT_SYNC_METHOD(getGlobalHookSettings) static std::optional getGlobalHookSettings() noexcept { /* implementation */ }\n"); - } -}; - -} // namespace Microsoft::ReactNativeSpecs