From 571c0103b90cd28f11f01828f12753305862d231 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Tue, 15 Sep 2026 01:29:52 -0700 Subject: [PATCH] Update module umbrella headers Summary: Every umbrella header told the reader that React Native's own code should keep using the fine-grained includes. That is wrong for a header React Native exports to consumers: it is preprocessed in the consumer's translation unit, where the fine-grained include raises a hard error from `UmbrellaGuard.h` that `RN_ALLOW_FRAMEWORKS` does not suppress. This diff updates the comment in all 14 umbrella headers to cover that case. Changelog: [Internal] Differential Revision: D120116214 --- .../ReactCommon/callinvoker/React/CallInvoker.h | 8 ++++++-- .../react-native/ReactCommon/cxxreact/React/JSBigString.h | 8 ++++++-- .../react-native/ReactCommon/react/debug/React/Debug.h | 8 ++++++-- .../ReactCommon/react/featureflags/React/FeatureFlags.h | 8 ++++++-- .../react/nativemodule/core/React/NativeModuleCore.h | 8 ++++++-- .../renderer/componentregistry/React/ComponentRegistry.h | 6 +++++- .../react/renderer/components/image/React/Image.h | 6 +++++- .../react/renderer/components/view/React/View.h | 6 +++++- .../ReactCommon/react/renderer/css/React/CSS.h | 8 ++++++-- .../react/renderer/imagemanager/React/ImageManager.h | 6 +++++- .../react/renderer/mapbuffer/React/MapBuffer.h | 8 ++++++-- .../react-native/ReactCommon/react/timing/React/Timing.h | 8 ++++++-- .../react-native/ReactCommon/react/utils/React/Utils.h | 8 ++++++-- .../ReactCommon/runtimeexecutor/React/RuntimeExecutor.h | 8 ++++++-- 14 files changed, 80 insertions(+), 24 deletions(-) diff --git a/packages/react-native/ReactCommon/callinvoker/React/CallInvoker.h b/packages/react-native/ReactCommon/callinvoker/React/CallInvoker.h index f77c0725d1ee..9225badcb6eb 100644 --- a/packages/react-native/ReactCommon/callinvoker/React/CallInvoker.h +++ b/packages/react-native/ReactCommon/callinvoker/React/CallInvoker.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/cxxreact/React/JSBigString.h b/packages/react-native/ReactCommon/cxxreact/React/JSBigString.h index d1dbafbbcd06..0b068301c5fa 100644 --- a/packages/react-native/ReactCommon/cxxreact/React/JSBigString.h +++ b/packages/react-native/ReactCommon/cxxreact/React/JSBigString.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/debug/React/Debug.h b/packages/react-native/ReactCommon/react/debug/React/Debug.h index 4957eaa6a669..36c872f15613 100644 --- a/packages/react-native/ReactCommon/react/debug/React/Debug.h +++ b/packages/react-native/ReactCommon/react/debug/React/Debug.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // // The `redbox/` headers are deliberately absent: they are implementation // details of the dev-menu red box and carry no stability guarantee. diff --git a/packages/react-native/ReactCommon/react/featureflags/React/FeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/React/FeatureFlags.h index f7c0591441d5..2196f3fe14f4 100644 --- a/packages/react-native/ReactCommon/react/featureflags/React/FeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/React/FeatureFlags.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only -// outside consumers use this umbrella. +// should keep using the fine-grained `` includes, +// except in headers it exports to consumers: those are preprocessed in the +// consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // // The headers below are generated from // `scripts/featureflags/ReactNativeFeatureFlags.config.js`, but this file is diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/React/NativeModuleCore.h b/packages/react-native/ReactCommon/react/nativemodule/core/React/NativeModuleCore.h index 96aff2ae59c5..3428575914d7 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/React/NativeModuleCore.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/React/NativeModuleCore.h @@ -14,8 +14,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/componentregistry/React/ComponentRegistry.h b/packages/react-native/ReactCommon/react/renderer/componentregistry/React/ComponentRegistry.h index c9d2db6a481f..be9dcb54857f 100644 --- a/packages/react-native/ReactCommon/react/renderer/componentregistry/React/ComponentRegistry.h +++ b/packages/react-native/ReactCommon/react/renderer/componentregistry/React/ComponentRegistry.h @@ -15,7 +15,11 @@ // // Re-exports the module's public interface headers. React Native's own code // should keep using the fine-grained `` -// includes; only outside consumers use this umbrella. +// includes, except in headers it exports to consumers: those are preprocessed +// in the consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/components/image/React/Image.h b/packages/react-native/ReactCommon/react/renderer/components/image/React/Image.h index e9a836963788..f57ccab3a4e6 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/image/React/Image.h +++ b/packages/react-native/ReactCommon/react/renderer/components/image/React/Image.h @@ -15,7 +15,11 @@ // // Re-exports the module's public interface headers. React Native's own code // should keep using the fine-grained `` -// includes; only outside consumers use this umbrella. +// includes, except in headers it exports to consumers: those are preprocessed +// in the consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/React/View.h b/packages/react-native/ReactCommon/react/renderer/components/view/React/View.h index de36f85ecddc..70357d7fcaea 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/React/View.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/React/View.h @@ -15,7 +15,11 @@ // // Re-exports the module's public interface headers. React Native's own code // should keep using the fine-grained `` -// includes; only outside consumers use this umbrella. +// includes, except in headers it exports to consumers: those are preprocessed +// in the consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/css/React/CSS.h b/packages/react-native/ReactCommon/react/renderer/css/React/CSS.h index 82f500a1f0ad..b36d471b43fb 100644 --- a/packages/react-native/ReactCommon/react/renderer/css/React/CSS.h +++ b/packages/react-native/ReactCommon/react/renderer/css/React/CSS.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only -// outside consumers use this umbrella. +// should keep using the fine-grained `` includes, +// except in headers it exports to consumers: those are preprocessed in the +// consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/imagemanager/React/ImageManager.h b/packages/react-native/ReactCommon/react/renderer/imagemanager/React/ImageManager.h index 2fb8d1629fa9..fcd1226f3563 100644 --- a/packages/react-native/ReactCommon/react/renderer/imagemanager/React/ImageManager.h +++ b/packages/react-native/ReactCommon/react/renderer/imagemanager/React/ImageManager.h @@ -15,7 +15,11 @@ // // Re-exports the module's public interface headers. React Native's own code // should keep using the fine-grained `` -// includes; only outside consumers use this umbrella. +// includes, except in headers it exports to consumers: those are preprocessed +// in the consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/renderer/mapbuffer/React/MapBuffer.h b/packages/react-native/ReactCommon/react/renderer/mapbuffer/React/MapBuffer.h index aed8b6dc8219..ca6447119e36 100644 --- a/packages/react-native/ReactCommon/react/renderer/mapbuffer/React/MapBuffer.h +++ b/packages/react-native/ReactCommon/react/renderer/mapbuffer/React/MapBuffer.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; -// only outside consumers use this umbrella. +// should keep using the fine-grained `` includes, +// except in headers it exports to consumers: those are preprocessed in the +// consumer's translation unit, where the fine-grained include hits this +// module's . `RN_ALLOW_FRAMEWORKS` does not +// suppress that guard, so a "for frameworks" header must reach this module +// through the umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/timing/React/Timing.h b/packages/react-native/ReactCommon/react/timing/React/Timing.h index bfac6c96fcb1..db44ee0fe91d 100644 --- a/packages/react-native/ReactCommon/react/timing/React/Timing.h +++ b/packages/react-native/ReactCommon/react/timing/React/Timing.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only -// outside consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/react/utils/React/Utils.h b/packages/react-native/ReactCommon/react/utils/React/Utils.h index 83eed1d75d36..3de7c1ad1ba8 100644 --- a/packages/react-native/ReactCommon/react/utils/React/Utils.h +++ b/packages/react-native/ReactCommon/react/utils/React/Utils.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their diff --git a/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h b/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h index 52e09e56a792..7638f577a4ec 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h @@ -13,8 +13,12 @@ // #include // // Re-exports the module's public interface headers. React Native's own code -// should keep using the fine-grained `` includes; only outside -// consumers use this umbrella. +// should keep using the fine-grained `` includes, except in +// headers it exports to consumers: those are preprocessed in the consumer's +// translation unit, where the fine-grained include hits this module's +// . `RN_ALLOW_FRAMEWORKS` does not suppress +// that guard, so a "for frameworks" header must reach this module through the +// umbrella. // ============================================================================= // Marks that the following headers are pulled in through the umbrella, so their