mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Our long-term plan is to completely illuminate `jsi::Value`-to-`folly::dynamic` serialization step in prop parsing process improving performance and memory pressure. At the same time, we don't want to introduce a hard dependency in application code to JSI because it exposes direct access to VM and prevents parsing some data that come *NOT* from JSVM. RawValue is an extremely light-weight (hopefully fully optimized-out) abstraction that provides limited JSON-like and C++-idiomatic interface. The current particular implementation is still using `folly::dynamic` inside, but I have fully JSI-powered one which will replace the current one right after we figure out how to deal with folly::dynamic-specific callsites. Or we can implement RawValue in a hybrid manner if a code-size implication of that will be minimal. Reviewed By: JoshuaGross, mdvacca Differential Revision: D13962466 fbshipit-source-id: e848522fd242f21e9e771773f2103f1c1d9d7f21
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its 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 <folly/dynamic.h>
|
|
#include <react/core/RawProps.h>
|
|
#include <react/core/RawValue.h>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* `Tag` and `InstanceHandle` are used to address React Native components.
|
|
*/
|
|
using Tag = int32_t;
|
|
using InstanceHandle = struct InstanceHandleDummyStruct {
|
|
} *;
|
|
|
|
/*
|
|
* An id of a running Surface instance that is used to refer to the instance.
|
|
*/
|
|
using SurfaceId = int32_t;
|
|
|
|
/*
|
|
* Universal component handle which allows to refer to `ComponentDescriptor`s
|
|
* in maps efficiently.
|
|
* Practically, it's something that concrete ShadowNode and concrete
|
|
* ComponentDescriptor have in common.
|
|
*/
|
|
using ComponentHandle = int64_t;
|
|
|
|
/*
|
|
* String identifier for components used for addressing them from
|
|
* JavaScript side.
|
|
*/
|
|
using ComponentName = std::string;
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|