rename ReactBytecode -> UITemplate

Summary: React bytecode is kind of a different thing that sebmarkbage already has in mind so lets keep the namespace separate.

Reviewed By: mdvacca

Differential Revision: D12896293

fbshipit-source-id: e0f266da6e7a051bcf5defea49b958452342754d
This commit is contained in:
Spencer Ahrens
2018-11-05 15:32:47 -08:00
committed by Facebook Github Bot
parent ccc8a425ad
commit ac9e09d079
4 changed files with 13 additions and 13 deletions

View File

@@ -11,7 +11,7 @@
#include <fabric/uimanager/ComponentDescriptorRegistry.h>
#include <fabric/uimanager/FabricUIManager.h>
#include <fabric/uimanager/JSIFabricUIManager.h>
#include <fabric/uimanager/ReactBytecodeInterpreter.h>
#include <fabric/uimanager/UITemplateProcessor.h>
#include "ComponentDescriptorFactory.h"
#include "Differentiator.h"
@@ -85,7 +85,7 @@ void Scheduler::renderTemplateToSurface(
return;
}
NativeModuleRegistry nMR;
auto tree = ReactBytecodeInterpreter::buildShadowTree(
auto tree = UITemplateProcessor::buildShadowTree(
uiTemplate,
surfaceId,
folly::dynamic::object(),

View File

@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
#include "ReactBytecodeInterpreter.h"
#include "UITemplateProcessor.h"
#include <fabric/components/view/ViewComponentDescriptor.h>
#include <fabric/components/view/ViewProps.h>
@@ -32,7 +32,7 @@ struct RBCContext {
};
// TODO: use RBCContext instead of all the separate arguments.
SharedShadowNode ReactBytecodeInterpreter::runCommand(
SharedShadowNode UITemplateProcessor::runCommand(
const folly::dynamic &command,
Tag rootTag,
std::vector<SharedShadowNode> &nodes,
@@ -97,14 +97,14 @@ SharedShadowNode ReactBytecodeInterpreter::runCommand(
return nullptr;
}
SharedShadowNode ReactBytecodeInterpreter::buildShadowTree(
SharedShadowNode UITemplateProcessor::buildShadowTree(
const std::string &jsonStr,
Tag rootTag,
const folly::dynamic &params,
const ComponentDescriptorRegistry &componentDescriptorRegistry,
const NativeModuleRegistry &nativeModuleRegistry) {
LOG(INFO)
<< "(strt) ReactBytecodeInterpreter inject hardcoded 'server rendered' view tree";
<< "(strt) UITemplateProcessor inject hardcoded 'server rendered' view tree";
std::string content = jsonStr;
for (const auto &param : params.items()) {

View File

@@ -41,7 +41,7 @@ class NativeModuleRegistry {
std::unordered_map<std::string, NativeModuleCallFn> modules_;
};
class ReactBytecodeInterpreter {
class UITemplateProcessor {
public:
static SharedShadowNode buildShadowTree(
const std::string &jsonStr,

View File

@@ -8,7 +8,7 @@
#include <exception>
#include <fabric/uimanager/ComponentDescriptorFactory.h>
#include <fabric/uimanager/ReactBytecodeInterpreter.h>
#include <fabric/uimanager/UITemplateProcessor.h>
#include <gtest/gtest.h>
using namespace facebook::react;
@@ -66,7 +66,7 @@ NativeModuleRegistry buildNativeModuleRegistry() {
} // namespace react
} // namespace facebook
TEST(ReactBytecodeInterpreterTest, testSimpleBytecode) {
TEST(UITemplateProcessorTest, testSimpleBytecode) {
auto surfaceId = 11;
auto componentDescriptorRegistry =
ComponentDescriptorFactory::buildRegistry(nullptr, nullptr);
@@ -80,7 +80,7 @@ TEST(ReactBytecodeInterpreterTest, testSimpleBytecode) {
mockSimpleTestValue_ = true;
auto root1 = ReactBytecodeInterpreter::buildShadowTree(
auto root1 = UITemplateProcessor::buildShadowTree(
bytecode,
surfaceId,
folly::dynamic::object(),
@@ -97,7 +97,7 @@ TEST(ReactBytecodeInterpreterTest, testSimpleBytecode) {
ASSERT_STREQ(child_props1->testId.c_str(), "child");
}
TEST(ReactBytecodeInterpreterTest, testConditionalBytecode) {
TEST(UITemplateProcessorTest, testConditionalBytecode) {
auto surfaceId = 11;
auto componentDescriptorRegistry =
ComponentDescriptorFactory::buildRegistry(nullptr, nullptr);
@@ -115,7 +115,7 @@ TEST(ReactBytecodeInterpreterTest, testConditionalBytecode) {
mockSimpleTestValue_ = true;
auto root1 = ReactBytecodeInterpreter::buildShadowTree(
auto root1 = UITemplateProcessor::buildShadowTree(
bytecode,
surfaceId,
folly::dynamic::object(),
@@ -132,7 +132,7 @@ TEST(ReactBytecodeInterpreterTest, testConditionalBytecode) {
mockSimpleTestValue_ = false;
auto root2 = ReactBytecodeInterpreter::buildShadowTree(
auto root2 = UITemplateProcessor::buildShadowTree(
bytecode,
surfaceId,
folly::dynamic::object(),