mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Make react/renderer/components/image public (#58437)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/58437 Classifies `react/renderer/components/image:image` as a public target under the C++ stable API three-tier visibility model. Replaces the `FrameworksGuard.h` include in the module's 6 exported headers with `<react/cxxstableapi/UmbrellaGuard.h>` and introduces the module umbrella `React/Image.h`, wiring the umbrella into BUCK, CMake, CocoaPods, the iOS prebuild header config and the Android prefab export. Changelog: [General][Added] - Added umbrella header for the `react/renderer/components/image` module Reviewed By: christophpurrer Differential Revision: D119477736 fbshipit-source-id: 42afb8675fe1347775a1c6172be2c64366e5fe2f
This commit is contained in:
1 parent
1a48d82d33
commit
a9203b8fdd
11 files changed
+69
-7
No files matched your search
@@ -173,6 +173,7 @@ val preparePrefab by
|
||||
"../ReactCommon/react/renderer/components/image/",
|
||||
"react/renderer/components/image/",
|
||||
),
|
||||
Pair("../ReactCommon/react/renderer/components/image/React/", "React/"),
|
||||
// rrc_view
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/components/view/",
|
||||
|
||||
@@ -43,13 +43,19 @@ Pod::Spec.new do |s|
|
||||
s.platforms = min_supported_versions
|
||||
s.source = source
|
||||
s.source_files = podspec_sources("react/renderer/components/image/**/*.{m,mm,cpp,h}", "react/renderer/components/image/**/*.h")
|
||||
s.exclude_files = "react/renderer/components/image/tests"
|
||||
s.exclude_files = ["react/renderer/components/image/tests", "react/renderer/components/image/React"]
|
||||
s.header_dir = "react/renderer/components/image"
|
||||
s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
|
||||
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
||||
"HEADER_SEARCH_PATHS" => header_search_path.join(" ")
|
||||
}
|
||||
|
||||
s.subspec "imageUmbrella" do |ss|
|
||||
ss.source_files = "react/renderer/components/image/React/*.h"
|
||||
ss.header_dir = ""
|
||||
ss.header_mappings_dir = "react/renderer/components/image"
|
||||
end
|
||||
|
||||
resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_FabricImage")
|
||||
|
||||
s.dependency "React-jsiexecutor", version
|
||||
|
||||
@@ -12,6 +12,7 @@ file(GLOB rrc_image_SRC CONFIGURE_DEPENDS *.cpp)
|
||||
add_library(rrc_image OBJECT ${rrc_image_SRC})
|
||||
|
||||
target_include_directories(rrc_image PUBLIC ${REACT_COMMON_DIR})
|
||||
target_include_directories(rrc_image INTERFACE ${REACT_COMMON_DIR}/react/renderer/components/image)
|
||||
|
||||
target_link_libraries(rrc_image
|
||||
glog
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <react/renderer/components/image/ImageShadowNode.h>
|
||||
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <react/renderer/components/view/ViewEventEmitter.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <react/renderer/components/image/ImageEventEmitter.h>
|
||||
#include <react/renderer/components/image/ImageProps.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <react/renderer/imagemanager/ImageRequest.h>
|
||||
#include <react/renderer/imagemanager/ImageRequestParams.h>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// =============================================================================
|
||||
// Umbrella header for the `react/renderer/components/image` module - public
|
||||
// entry point.
|
||||
//
|
||||
// #include <React/Image.h>
|
||||
//
|
||||
// Re-exports the module's public interface headers. React Native's own code
|
||||
// should keep using the fine-grained `<react/renderer/components/image/...>`
|
||||
// includes; only outside consumers use this umbrella.
|
||||
// =============================================================================
|
||||
|
||||
// Marks that the following headers are pulled in through the umbrella, so their
|
||||
// shared guard (<react/cxxstableapi/UmbrellaGuard.h>) accepts them. The marker
|
||||
// is saved and restored rather than defined and undefined: the scope ends at
|
||||
// this block, so later *direct* includes in the same TU are still caught, and
|
||||
// it nests inside an enclosing umbrella rather than disarming it.
|
||||
#pragma push_macro("RN_UMBRELLA_CONTEXT")
|
||||
#undef RN_UMBRELLA_CONTEXT
|
||||
#define RN_UMBRELLA_CONTEXT 1
|
||||
|
||||
#include <react/renderer/components/image/ImageComponentDescriptor.h>
|
||||
#include <react/renderer/components/image/ImageEventEmitter.h>
|
||||
#include <react/renderer/components/image/ImageProps.h>
|
||||
#include <react/renderer/components/image/ImageShadowNode.h>
|
||||
#include <react/renderer/components/image/ImageState.h>
|
||||
#include <react/renderer/components/image/conversions.h>
|
||||
|
||||
#undef RN_UMBRELLA_CONTEXT
|
||||
#pragma pop_macro("RN_UMBRELLA_CONTEXT")
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/cxxstableapi/FrameworksGuard.h>
|
||||
#include <react/cxxstableapi/UmbrellaGuard.h>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
@@ -455,6 +455,22 @@ const PodspecExceptions /*: {[key: string]: PodSpecConfiguration} */ = {
|
||||
},
|
||||
],
|
||||
},
|
||||
'ReactCommon/React-FabricImage.podspec': {
|
||||
name: 'React-FabricImage',
|
||||
headerPatterns: ['react/renderer/components/image/**/*.h'],
|
||||
excludePatterns: [
|
||||
'react/renderer/components/image/tests',
|
||||
'react/renderer/components/image/React',
|
||||
],
|
||||
headerDir: 'react/renderer/components/image',
|
||||
subSpecs: [
|
||||
{
|
||||
name: 'imageUmbrella',
|
||||
headerPatterns: ['react/renderer/components/image/React/*.h'],
|
||||
headerDir: 'React',
|
||||
},
|
||||
],
|
||||
},
|
||||
'ReactCommon/React-Mapbuffer.podspec': {
|
||||
name: 'React-Mapbuffer',
|
||||
headerPatterns: ['react/renderer/mapbuffer/**/*.h'],
|
||||
|
||||
Reference in new issue
Block a user