forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include native module for DOM APIs by default in all apps using the n…
…ew architecture (facebook#43653) Summary: Pull Request resolved: facebook#43653 Changelog: [internal] This will allow us to clean up some code in `UIManager` (using methods in the native module instead) and prepare to use the DOM APIs in OSS behind a feature flag. This doesn't enable the DOM APIs in OSS, only the native module. Differential Revision: D55365252
- Loading branch information
1 parent
8bf4cbd
commit 7ea128c
Showing
9 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/react-native/ReactCommon/react/nativemodule/dom/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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. | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE on) | ||
|
||
add_compile_options( | ||
-fexceptions | ||
-frtti | ||
-std=c++20 | ||
-Wall | ||
-Wpedantic | ||
-DLOG_TAG=\"ReactNative\") | ||
|
||
file(GLOB react_nativemodule_dom_SRC CONFIGURE_DEPENDS *.cpp) | ||
add_library(react_nativemodule_dom SHARED ${react_nativemodule_dom_SRC}) | ||
|
||
target_include_directories(react_nativemodule_dom PUBLIC ${REACT_COMMON_DIR}) | ||
|
||
target_link_libraries(react_nativemodule_dom | ||
rrc_root | ||
react_render_dom | ||
react_render_uimanager | ||
react_codegen_rncore | ||
reactnative) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 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. | ||
|
||
require "json" | ||
|
||
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "package.json"))) | ||
version = package['version'] | ||
|
||
source = { :git => 'https://github.com/facebook/react-native.git' } | ||
if version == '1000.0.0' | ||
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in. | ||
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1") | ||
else | ||
source[:tag] = "v#{version}" | ||
end | ||
|
||
header_search_paths = [] | ||
|
||
if ENV['USE_FRAMEWORKS'] | ||
header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" # this is needed to allow the domnativemodule to access its own files | ||
end | ||
|
||
Pod::Spec.new do |s| | ||
s.name = "React-domnativemodule" | ||
s.version = version | ||
s.summary = "React Native DOM native module" | ||
s.homepage = "https://reactnative.dev/" | ||
s.license = package["license"] | ||
s.author = "Meta Platforms, Inc. and its affiliates" | ||
s.platforms = min_supported_versions | ||
s.source = source | ||
s.source_files = "*.{cpp,h}" | ||
s.header_dir = "react/nativemodule/dom" | ||
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", | ||
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '), | ||
"DEFINES_MODULE" => "YES" } | ||
|
||
if ENV['USE_FRAMEWORKS'] | ||
s.module_name = "React_domnativemodule" | ||
s.header_mappings_dir = "../.." | ||
end | ||
|
||
install_modules_dependencies(s) | ||
|
||
s.dependency "ReactCommon/turbomodule/core" | ||
s.dependency "React-Fabric/uimanager" | ||
s.dependency "React-Fabric/dom" | ||
s.dependency "React-Fabric/components/root" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters