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,29 @@
# 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_unimplementedview_SRC CONFIGURE_DEPENDS *.cpp)
add_library(rrc_unimplementedview STATIC ${rrc_unimplementedview_SRC})
target_include_directories(rrc_unimplementedview PUBLIC ${REACT_COMMON_DIR})
target_link_libraries(rrc_unimplementedview
glog
folly_runtime
glog_init
jsi
react_debug
react_renderer_core
react_renderer_debug
react_renderer_graphics
rrc_view
yoga
)
target_compile_reactnative_options(rrc_unimplementedview PRIVATE)
target_compile_options(rrc_unimplementedview PRIVATE -Wpedantic)

View File

@@ -0,0 +1,42 @@
/*
* 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 "UnimplementedViewComponentDescriptor.h"
namespace facebook::react {
ComponentHandle UnimplementedViewComponentDescriptor::getComponentHandle()
const {
return reinterpret_cast<ComponentHandle>(getComponentName());
}
ComponentName UnimplementedViewComponentDescriptor::getComponentName() const {
return static_cast<const std::string*>(flavor_.get())->c_str();
}
Props::Shared UnimplementedViewComponentDescriptor::cloneProps(
const PropsParserContext& context,
const Props::Shared& props,
RawProps rawProps) const {
auto clonedProps =
ConcreteComponentDescriptor<UnimplementedViewShadowNode>::cloneProps(
context, props, std::move(rawProps));
// We have to clone `Props` object one more time to make sure that we have
// an unshared (and non-`const`) copy of it which we can mutate.
RawProps emptyRawProps{};
emptyRawProps.parse(rawPropsParser_);
auto unimplementedViewProps = std::make_shared<UnimplementedViewProps>(
context,
static_cast<const UnimplementedViewProps&>(*clonedProps),
std::move(emptyRawProps));
unimplementedViewProps->setComponentName(getComponentName());
return unimplementedViewProps;
};
} // namespace facebook::react

View File

@@ -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
#include <react/renderer/components/unimplementedview/UnimplementedViewShadowNode.h>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/core/PropsParserContext.h>
namespace facebook::react {
/*
* Descriptor for <UnimplementedView> component.
*/
class UnimplementedViewComponentDescriptor final : public ConcreteComponentDescriptor<UnimplementedViewShadowNode> {
public:
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
/*
* Returns `name` and `handle` based on a `flavor`, not on static data from
* `UnimplementedViewShadowNode`.
*/
ComponentHandle getComponentHandle() const override;
ComponentName getComponentName() const override;
/*
* In addition to base implementation, stores a component name inside cloned
* `Props` object.
*/
Props::Shared cloneProps(const PropsParserContext &context, const Props::Shared &props, RawProps rawProps)
const override;
};
} // namespace facebook::react

View File

@@ -0,0 +1,41 @@
/*
* 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 <react/renderer/components/unimplementedview/UnimplementedViewProps.h>
namespace facebook::react {
void UnimplementedViewProps::setComponentName(ComponentName componentName) {
componentName_ = componentName;
}
ComponentName UnimplementedViewProps::getComponentName() const {
return componentName_;
}
#ifdef RN_SERIALIZABLE_STATE
folly::dynamic UnimplementedViewProps::getDiffProps(
const Props* prevProps) const {
static const auto defaultProps = UnimplementedViewProps();
const UnimplementedViewProps* oldProps = prevProps == nullptr
? &defaultProps
: static_cast<const UnimplementedViewProps*>(prevProps);
folly::dynamic result = ViewProps::getDiffProps(oldProps);
if (componentName_ != oldProps->componentName_) {
result["name"] = componentName_;
}
return result;
}
#endif
} // namespace facebook::react

View File

@@ -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
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
namespace facebook::react {
/*
* It's a normal `ViewProps` with additional information about the component
* name which is being updated manually in `ComponentDescriptor`.
*/
class UnimplementedViewProps final : public ViewProps {
public:
using ViewProps::ViewProps;
/*
* Should be called from a `ComponentDescriptor` to store information about
* the name of a particular component.
*/
void setComponentName(ComponentName componentName);
ComponentName getComponentName() const;
#ifdef RN_SERIALIZABLE_STATE
folly::dynamic getDiffProps(const Props *prevProps) const override;
#endif
private:
mutable ComponentName componentName_{};
};
} // namespace facebook::react

View File

@@ -0,0 +1,15 @@
/*
* 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 "UnimplementedViewShadowNode.h"
namespace facebook::react {
// NOLINTNEXTLINE(facebook-hte-CArray,modernize-avoid-c-arrays)
const char UnimplementedViewComponentName[] = "UnimplementedView";
} // namespace facebook::react

View File

@@ -0,0 +1,19 @@
/*
* 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 <react/renderer/components/unimplementedview/UnimplementedViewProps.h>
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
namespace facebook::react {
extern const char UnimplementedViewComponentName[];
using UnimplementedViewShadowNode = ConcreteViewShadowNode<UnimplementedViewComponentName, UnimplementedViewProps>;
} // namespace facebook::react