first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -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)
include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake)
file(GLOB rrc_native_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_native OBJECT ${rrc_native_SRC})
target_include_directories(rrc_native PUBLIC ${REACT_COMMON_DIR})
target_link_libraries(rrc_native
folly_runtime
glog_init
jsi
react_debug
react_renderer_core
react_renderer_debug
react_utils
callinvoker
)
target_compile_reactnative_options(rrc_native PRIVATE)
target_compile_options(rrc_native PRIVATE -Wpedantic)

View File

@@ -0,0 +1,28 @@
/*
* 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.
*/
#include "NativeComponentRegistryBinding.h"
#include <react/bridging/Bridging.h>
#include <stdexcept>
#include <string>
namespace facebook::react {
/**
* Public API to install the Native Component Registry bindings.
*/
void bindHasComponentProvider(
jsi::Runtime& runtime,
HasComponentProviderFunctionType&& provider) {
runtime.global().setProperty(
runtime,
"__nativeComponentRegistry__hasComponent",
bridging::toJs(runtime, provider, {}));
}
} // namespace facebook::react

View File

@@ -0,0 +1,28 @@
/*
* 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
#include <string>
#include <jsi/jsi.h>
namespace facebook::react {
/**
* An app/platform-specific provider function to determine if a component
* is registered in the native platform.
*/
using HasComponentProviderFunctionType = std::function<bool(const std::string &name)>;
/*
* Installs HasComponentProviderFunction into JavaScript runtime.
* Thread synchronization must be enforced externally.
*/
void bindHasComponentProvider(jsi::Runtime &runtime, HasComponentProviderFunctionType &&provider);
} // namespace facebook::react