Fabric: New props treatment in `core` module

Summary:
Same as previous one.
Adopting template-generated `convertRawProp` and `debugStringConvertibleItem` functions in `core` module.
Note, to do so we have to change signatures of some conversions functions to make them more overloading-friendly.

Reviewed By: fkgozali

Differential Revision: D7958243

fbshipit-source-id: 500ee420d9aa562ee3c5810ef625e06541eda8fb
This commit is contained in:
Valentin Shergin 2018-05-14 15:43:54 -07:00 коммит произвёл Facebook Github Bot
Родитель c19649cc16
Коммит 120dcec621
5 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#include "ParagraphAttributes.h"
#include <fabric/attributedstring/conversions.h>
#include <fabric/graphics/conversions.h>
#include <fabric/debug/debugStringConvertibleUtils.h>
namespace facebook {

Просмотреть файл

@ -8,8 +8,10 @@
#include "TextAttributes.h"
#include <fabric/attributedstring/conversions.h>
#include <fabric/core/conversions.h>
#include <fabric/graphics/conversions.h>
#include <fabric/core/debugStringConvertibleUtils.h>
#include <fabric/debug/debugStringConvertibleUtils.h>
namespace facebook {
namespace react {

Просмотреть файл

@ -12,7 +12,7 @@
namespace facebook {
namespace react {
inline std::string stringFromLayoutDirection(const LayoutDirection &layoutDirection) {
inline std::string toString(const LayoutDirection &layoutDirection) {
switch (layoutDirection) {
case LayoutDirection::Undefined: return "undefined";
case LayoutDirection::LeftToRight: return "ltr";
@ -20,7 +20,7 @@ inline std::string stringFromLayoutDirection(const LayoutDirection &layoutDirect
}
}
inline std::string stringFromDisplayType(const DisplayType &displayType) {
inline std::string toString(const DisplayType &displayType) {
switch (displayType) {
case DisplayType::None: return "none";
case DisplayType::Flex: return "flex";

Просмотреть файл

@ -1,20 +0,0 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* 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 <fabric/debug/debugStringConvertibleUtils.h>
#include <fabric/core/layoutValuesConversions.h>
namespace facebook {
namespace react {
DEBUG_STRING_CONVERTIBLE_TEMPLATE(LayoutDirection, stringFromLayoutDirection)
DEBUG_STRING_CONVERTIBLE_TEMPLATE(DisplayType, stringFromDisplayType)
} // namespace react
} // namespace facebook