From 16f8889908e8b6e23a66f3d8e727e67d688b95a8 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Wed, 2 Sep 2026 09:39:39 -0700 Subject: [PATCH] Cover `react/nativemodule/microtasks:microtasks` with Stable API guards (#58027) Summary: Pull Request resolved: https://github.com/react/react-native/pull/58027 Classifies `react/nativemodule/microtasks:microtasks` as a private target under the C++ stable API three-tier visibility model. Adds `#include ` to the module's only header, `NativeMicrotasks.h`, and declares the guard dependency in BUCK, CMake, and the podspec. Consumers that opt into `RN_STRICT_API` now get a hard error if they include it directly, with no escape hatch; without that flag the guard is inert, so no existing build changes behaviour. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D116612641 fbshipit-source-id: e72af6de67f4e632547528bfbfe9cbd3a2ecd52a --- .../ReactCommon/react/nativemodule/microtasks/CMakeLists.txt | 1 + .../react/nativemodule/microtasks/NativeMicrotasks.h | 2 ++ .../microtasks/React-microtasksnativemodule.podspec | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/react-native/ReactCommon/react/nativemodule/microtasks/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/microtasks/CMakeLists.txt index 42bb6672d44..748b1b4e196 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/microtasks/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/nativemodule/microtasks/CMakeLists.txt @@ -16,6 +16,7 @@ target_include_directories(react_nativemodule_microtasks PUBLIC ${REACT_COMMON_D target_link_libraries(react_nativemodule_microtasks react_codegen_rncore react_cxxreact + react_cxxstableapi ) target_compile_reactnative_options(react_nativemodule_microtasks PRIVATE) target_compile_options(react_nativemodule_microtasks PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCommon/react/nativemodule/microtasks/NativeMicrotasks.h b/packages/react-native/ReactCommon/react/nativemodule/microtasks/NativeMicrotasks.h index 40b6949ea77..52efd2aae57 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/microtasks/NativeMicrotasks.h +++ b/packages/react-native/ReactCommon/react/nativemodule/microtasks/NativeMicrotasks.h @@ -7,6 +7,8 @@ #pragma once +#include + #if __has_include("FBReactNativeSpecJSI.h") // CocoaPod headers on Apple #include "FBReactNativeSpecJSI.h" #else diff --git a/packages/react-native/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec b/packages/react-native/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec index 37508bc4344..06aabfc4fc4 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec @@ -48,6 +48,7 @@ Pod::Spec.new do |s| add_rncore_dependency(s) s.dependency "ReactCommon/turbomodule/core" + s.dependency "React-cxxstableapi" add_dependency(s, "React-RCTFBReactNativeSpec") mark_as_react_native_build(s)