From ef6777ddf3ce328b5253bf08cdf0bd8a8256a8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 31 Mar 2026 08:32:57 -0700 Subject: [PATCH] Exclude iOS-specific symbols from the ReactAndroid C++ API snapshot (#56250) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56250 Excludes iOS-specific symbols from the ReactAndroid C++ API snapshot. The snapshot contains iOS native modules CxxSpec templates, their data structs, and bridging structs that have no relevance on Android. These symbols leaked because the Android codegen generates CxxSpec templates for ALL JavaScript module specs regardless of platform. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D98480080 fbshipit-source-id: a5990c4769456ab756095129851eb4e8dbeda912 --- .../api-snapshots/ReactAndroidDebugCxx.api | 112 ------------------ .../api-snapshots/ReactAndroidReleaseCxx.api | 92 -------------- scripts/cxx-api/config.yml | 1 + 3 files changed, 1 insertion(+), 204 deletions(-) diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 596a0c6afd7..5401164edad 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -8288,20 +8288,6 @@ struct facebook::react::NativeAlertManagerArgs { public bool operator==(const facebook::react::NativeAlertManagerArgs& other) const; } -template -struct facebook::react::NativePushNotificationManagerIOSNotification { - public P0 alertTitle; - public P1 alertBody; - public P2 userInfo; - public P3 category; - public P4 fireDate; - public P5 fireIntervalSeconds; - public P6 applicationIconBadgeNumber; - public P7 isSilent; - public P8 soundName; - public bool operator==(const facebook::react::NativePushNotificationManagerIOSNotification& other) const; -} - template struct facebook::react::NativeExceptionsManagerExceptionData { public P0 message; @@ -8315,19 +8301,6 @@ struct facebook::react::NativeExceptionsManagerExceptionData { public bool operator==(const facebook::react::NativeExceptionsManagerExceptionData& other) const; } -template -struct facebook::react::NativePlatformConstantsIOSPlatformConstantsIOS { - public P0 isTesting; - public P1 isDisableAnimations; - public P2 reactNativeVersion; - public P3 forceTouchAvailable; - public P4 osVersion; - public P5 systemName; - public P6 interfaceIdiom; - public P7 isMacCatalyst; - public bool operator==(const facebook::react::NativePlatformConstantsIOSPlatformConstantsIOS& other) const; -} - template struct facebook::react::NativeDialogManagerAndroidDialogOptions { public P0 title; @@ -8478,14 +8451,6 @@ struct facebook::react::NativeMutationObserverNativeMutationObserverObserveOptio public bool operator==(const facebook::react::NativeMutationObserverNativeMutationObserverObserveOptions& other) const; } -template -struct facebook::react::NativePushNotificationManagerIOSPermissions { - public P0 alert; - public P1 badge; - public P2 sound; - public bool operator==(const facebook::react::NativePushNotificationManagerIOSPermissions& other) const; -} - template struct facebook::react::NativeAnimatedModuleEventMapping { public P0 nativeEventPath; @@ -8810,24 +8775,12 @@ class facebook::react::NativeImageLoaderAndroidCxxSpec : public facebook::react: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeImageLoaderIOSCxxSpec : public facebook::react::TurboModule { - protected NativeImageLoaderIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeImageStoreAndroidCxxSpec : public facebook::react::TurboModule { protected NativeImageStoreAndroidCxxSpec(std::shared_ptr jsInvoker); public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeImageStoreIOSCxxSpec : public facebook::react::TurboModule { - protected NativeImageStoreIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeIntentAndroidCxxSpec : public facebook::react::TurboModule { protected NativeIntentAndroidCxxSpec(std::shared_ptr jsInvoker); @@ -8888,12 +8841,6 @@ class facebook::react::NativeNetworkingAndroidCxxSpec : public facebook::react:: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeNetworkingIOSCxxSpec : public facebook::react::TurboModule { - protected NativeNetworkingIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativePerformanceCxxSpec : public facebook::react::TurboModule { protected NativePerformanceCxxSpec(std::shared_ptr jsInvoker); @@ -8912,18 +8859,6 @@ class facebook::react::NativePlatformConstantsAndroidCxxSpec : public facebook:: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativePlatformConstantsIOSCxxSpec : public facebook::react::TurboModule { - protected NativePlatformConstantsIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - -template -class facebook::react::NativePushNotificationManagerIOSCxxSpec : public facebook::react::TurboModule { - protected NativePushNotificationManagerIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeReactDevToolsRuntimeSettingsModuleCxxSpec : public facebook::react::TurboModule { protected NativeReactDevToolsRuntimeSettingsModuleCxxSpec(std::shared_ptr jsInvoker); @@ -8978,12 +8913,6 @@ class facebook::react::NativeStatusBarManagerAndroidCxxSpec : public facebook::r public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeStatusBarManagerIOSCxxSpec : public facebook::react::TurboModule { - protected NativeStatusBarManagerIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeTimingCxxSpec : public facebook::react::TurboModule { protected NativeTimingCxxSpec(std::shared_ptr jsInvoker); @@ -9382,47 +9311,6 @@ struct facebook::react::NativePlatformConstantsAndroidReactNativeVersionAndroidB public static std::optional prereleaseToJs(facebook::jsi::Runtime& rt, decltype(types.prerelease) value); } -template -struct facebook::react::NativePlatformConstantsIOSPlatformConstantsIOSBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static bool forceTouchAvailableToJs(facebook::jsi::Runtime& rt, decltype(types.forceTouchAvailable) value); - public static bool isDisableAnimationsToJs(facebook::jsi::Runtime& rt, decltype(types.isDisableAnimations) value); - public static bool isMacCatalystToJs(facebook::jsi::Runtime& rt, decltype(types.isMacCatalyst) value); - public static bool isTestingToJs(facebook::jsi::Runtime& rt, decltype(types.isTesting) value); - public static facebook::jsi::Object reactNativeVersionToJs(facebook::jsi::Runtime& rt, decltype(types.reactNativeVersion) value); - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); - public static facebook::jsi::String interfaceIdiomToJs(facebook::jsi::Runtime& rt, decltype(types.interfaceIdiom) value); - public static facebook::jsi::String osVersionToJs(facebook::jsi::Runtime& rt, decltype(types.osVersion) value); - public static facebook::jsi::String systemNameToJs(facebook::jsi::Runtime& rt, decltype(types.systemName) value); -} - -template -struct facebook::react::NativePushNotificationManagerIOSNotificationBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); - public static std::optional isSilentToJs(facebook::jsi::Runtime& rt, decltype(types.isSilent) value); - public static std::optional applicationIconBadgeNumberToJs(facebook::jsi::Runtime& rt, decltype(types.applicationIconBadgeNumber) value); - public static std::optional fireDateToJs(facebook::jsi::Runtime& rt, decltype(types.fireDate) value); - public static std::optional fireIntervalSecondsToJs(facebook::jsi::Runtime& rt, decltype(types.fireIntervalSeconds) value); - public static std::optional userInfoToJs(facebook::jsi::Runtime& rt, decltype(types.userInfo) value); - public static std::optional alertBodyToJs(facebook::jsi::Runtime& rt, decltype(types.alertBody) value); - public static std::optional alertTitleToJs(facebook::jsi::Runtime& rt, decltype(types.alertTitle) value); - public static std::optional categoryToJs(facebook::jsi::Runtime& rt, decltype(types.category) value); - public static std::optional soundNameToJs(facebook::jsi::Runtime& rt, decltype(types.soundName) value); -} - -template -struct facebook::react::NativePushNotificationManagerIOSPermissionsBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static bool alertToJs(facebook::jsi::Runtime& rt, decltype(types.alert) value); - public static bool badgeToJs(facebook::jsi::Runtime& rt, decltype(types.badge) value); - public static bool soundToJs(facebook::jsi::Runtime& rt, decltype(types.sound) value); - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); -} - template struct facebook::react::NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfigBridging { public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 0de2da5e2c9..1f96ae134fd 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -8279,20 +8279,6 @@ struct facebook::react::NativeAlertManagerArgs { public bool operator==(const facebook::react::NativeAlertManagerArgs& other) const; } -template -struct facebook::react::NativePushNotificationManagerIOSNotification { - public P0 alertTitle; - public P1 alertBody; - public P2 userInfo; - public P3 category; - public P4 fireDate; - public P5 fireIntervalSeconds; - public P6 applicationIconBadgeNumber; - public P7 isSilent; - public P8 soundName; - public bool operator==(const facebook::react::NativePushNotificationManagerIOSNotification& other) const; -} - template struct facebook::react::NativeExceptionsManagerExceptionData { public P0 message; @@ -8306,19 +8292,6 @@ struct facebook::react::NativeExceptionsManagerExceptionData { public bool operator==(const facebook::react::NativeExceptionsManagerExceptionData& other) const; } -template -struct facebook::react::NativePlatformConstantsIOSPlatformConstantsIOS { - public P0 isTesting; - public P1 isDisableAnimations; - public P2 reactNativeVersion; - public P3 forceTouchAvailable; - public P4 osVersion; - public P5 systemName; - public P6 interfaceIdiom; - public P7 isMacCatalyst; - public bool operator==(const facebook::react::NativePlatformConstantsIOSPlatformConstantsIOS& other) const; -} - template struct facebook::react::NativeDialogManagerAndroidDialogOptions { public P0 title; @@ -8469,14 +8442,6 @@ struct facebook::react::NativeMutationObserverNativeMutationObserverObserveOptio public bool operator==(const facebook::react::NativeMutationObserverNativeMutationObserverObserveOptions& other) const; } -template -struct facebook::react::NativePushNotificationManagerIOSPermissions { - public P0 alert; - public P1 badge; - public P2 sound; - public bool operator==(const facebook::react::NativePushNotificationManagerIOSPermissions& other) const; -} - template struct facebook::react::NativeAnimatedModuleEventMapping { public P0 nativeEventPath; @@ -8801,24 +8766,12 @@ class facebook::react::NativeImageLoaderAndroidCxxSpec : public facebook::react: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeImageLoaderIOSCxxSpec : public facebook::react::TurboModule { - protected NativeImageLoaderIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeImageStoreAndroidCxxSpec : public facebook::react::TurboModule { protected NativeImageStoreAndroidCxxSpec(std::shared_ptr jsInvoker); public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeImageStoreIOSCxxSpec : public facebook::react::TurboModule { - protected NativeImageStoreIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeIntentAndroidCxxSpec : public facebook::react::TurboModule { protected NativeIntentAndroidCxxSpec(std::shared_ptr jsInvoker); @@ -8879,12 +8832,6 @@ class facebook::react::NativeNetworkingAndroidCxxSpec : public facebook::react:: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeNetworkingIOSCxxSpec : public facebook::react::TurboModule { - protected NativeNetworkingIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativePerformanceCxxSpec : public facebook::react::TurboModule { protected NativePerformanceCxxSpec(std::shared_ptr jsInvoker); @@ -8903,18 +8850,6 @@ class facebook::react::NativePlatformConstantsAndroidCxxSpec : public facebook:: public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativePlatformConstantsIOSCxxSpec : public facebook::react::TurboModule { - protected NativePlatformConstantsIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - -template -class facebook::react::NativePushNotificationManagerIOSCxxSpec : public facebook::react::TurboModule { - protected NativePushNotificationManagerIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeReactDevToolsRuntimeSettingsModuleCxxSpec : public facebook::react::TurboModule { protected NativeReactDevToolsRuntimeSettingsModuleCxxSpec(std::shared_ptr jsInvoker); @@ -8969,12 +8904,6 @@ class facebook::react::NativeStatusBarManagerAndroidCxxSpec : public facebook::r public static constexpr std::string_view kModuleName; } -template -class facebook::react::NativeStatusBarManagerIOSCxxSpec : public facebook::react::TurboModule { - protected NativeStatusBarManagerIOSCxxSpec(std::shared_ptr jsInvoker); - public static constexpr std::string_view kModuleName; -} - template class facebook::react::NativeTimingCxxSpec : public facebook::react::TurboModule { protected NativeTimingCxxSpec(std::shared_ptr jsInvoker); @@ -9243,27 +9172,6 @@ struct facebook::react::NativePlatformConstantsAndroidReactNativeVersionAndroidB public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); } -template -struct facebook::react::NativePlatformConstantsIOSPlatformConstantsIOSBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); -} - -template -struct facebook::react::NativePushNotificationManagerIOSNotificationBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); -} - -template -struct facebook::react::NativePushNotificationManagerIOSPermissionsBridging { - public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); - public static T types; - public static facebook::jsi::Object toJs(facebook::jsi::Runtime& rt, const T& value, const std::shared_ptr& jsInvoker); -} - template struct facebook::react::NativeReactDevToolsRuntimeSettingsModulePartialReloadAndProfileConfigBridging { public static T fromJs(facebook::jsi::Runtime& rt, const facebook::jsi::Object& value, const std::shared_ptr& jsInvoker); diff --git a/scripts/cxx-api/config.yml b/scripts/cxx-api/config.yml index f6cf24fbf8c..ec32f46ff0c 100644 --- a/scripts/cxx-api/config.yml +++ b/scripts/cxx-api/config.yml @@ -51,6 +51,7 @@ platforms: - "*/platform/ios/*" exclude_symbols: - "InputAccessory" + - "IOS" input_filter: false definitions: RN_SERIALIZABLE_STATE: 1