diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h index b0d0dabab85..48cbc130b8c 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h +++ b/ReactCommon/react/renderer/animations/LayoutAnimationDriver.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include #include #include diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp index dd55247ec48..b1af13cc6c6 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp @@ -27,10 +27,6 @@ #include -// Uncomment to enable verbose LayoutAnimation debug asserts, especially useful -// for Android -//#define VERBOSE_LAYOUT_ANIMATION_ASSERTS 1 - #ifdef VERBOSE_LAYOUT_ANIMATION_ASSERTS #define LA_ASSERT(cond) \ if (!(cond)) { \ diff --git a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h index f74d8009600..83c3014ea8f 100644 --- a/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +++ b/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h @@ -7,16 +7,11 @@ #pragma once -// Enable some or all of these to enable very verbose logging for -// LayoutAnimations -//#define LAYOUT_ANIMATION_VERBOSE_LOGGING 1 -//#define RN_SHADOW_TREE_INTROSPECTION -//#define RN_DEBUG_STRING_CONVERTIBLE 1 - #include #include #include #include +#include #include #include #include diff --git a/ReactCommon/react/renderer/debug/DebugStringConvertible.h b/ReactCommon/react/renderer/debug/DebugStringConvertible.h index de8ce9c6e53..da79c15afa3 100644 --- a/ReactCommon/react/renderer/debug/DebugStringConvertible.h +++ b/ReactCommon/react/renderer/debug/DebugStringConvertible.h @@ -13,25 +13,11 @@ #include #include +#include "flags.h" + namespace facebook { namespace react { -#ifndef NDEBUG -#define RN_DEBUG_STRING_CONVERTIBLE 1 -#endif - -// To Debug Yoga layout, uncomment the following line. -// #define RN_DEBUG_YOGA_LOGGER 1 -// -// Additional logging can be enabled editing yoga.cpp (e.g. gPrintChanges, -// gPrintSkips) - -// To Debug introspection of RN Shadow tree, uncomment the following line: -// #define RN_SHADOW_TREE_INTROSPECTION 1 - -// To enable asserts (crashing) when checking stub trees -// #define RN_VALIDATE_SHADOW_TREE_STUB 1 - #if RN_DEBUG_STRING_CONVERTIBLE class DebugStringConvertible; diff --git a/ReactCommon/react/renderer/debug/flags.h b/ReactCommon/react/renderer/debug/flags.h new file mode 100644 index 00000000000..929f5a845b7 --- /dev/null +++ b/ReactCommon/react/renderer/debug/flags.h @@ -0,0 +1,48 @@ +/* + * 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 + +// +// This file contains flags that should __never__ be enabled for +// release-mode/production builds, unless explicitly noted. You can enable some +// of these for debug or local builds to assist in logging / debugging specific +// features. +// + +// Enables verbose logging for the LayoutAnimations subsystem. +//#define LAYOUT_ANIMATION_VERBOSE_LOGGING 1 + +// Logs information before running `assert` in LayoutAnimations. More useful on +// Android vs other platforms. +//#define VERBOSE_LAYOUT_ANIMATION_ASSERTS 1 + +// Enables some Shadow Tree introspection features (maintains a StubViewTree, +// and logs prev/next tree and mutations if there are any discrepancies). If you +// define this, also define `RN_DEBUG_STRING_CONVERTIBLE`. +#ifndef NDEBUG +#define RN_SHADOW_TREE_INTROSPECTION 1 +#endif + +// This enables certain object-to-string debug conversions to be compiled. +// Enable if `RN_SHADOW_TREE_INTROSPECTION` is enabled. +#ifdef RN_SHADOW_TREE_INTROSPECTION +#define RN_DEBUG_STRING_CONVERTIBLE 1 +#endif + +// Enables *very* verbose, noisy logs in the differ. Useful for debugging +// specifically the differ, but not much else. +//#define DEBUG_LOGS_DIFFER + +// Uncomment to enable verbose StubViewTree debug logs. This ensures that errors +// are logged to console before the `assert` is fired. More useful on Android vs +// other platforms. +//#define STUB_VIEW_TREE_VERBOSE 1 + +// Verbose logging for certain Yoga-related things in the RN codebase (not Yoga +// codebase). Useful for debugging layout. +//#define RN_DEBUG_YOGA_LOGGER 1 diff --git a/ReactCommon/react/renderer/mounting/Differentiator.cpp b/ReactCommon/react/renderer/mounting/Differentiator.cpp index 79879a5dce2..7d84711daa1 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.cpp +++ b/ReactCommon/react/renderer/mounting/Differentiator.cpp @@ -14,10 +14,6 @@ #include #include "ShadowView.h" -// Uncomment this to enable verbose diffing logs, which can be useful for -// debugging. -// #define DEBUG_LOGS_DIFFER - #ifdef DEBUG_LOGS_DIFFER #include #define DEBUG_LOGS(code) code diff --git a/ReactCommon/react/renderer/mounting/Differentiator.h b/ReactCommon/react/renderer/mounting/Differentiator.h index 15ba37f4088..7601a13e248 100644 --- a/ReactCommon/react/renderer/mounting/Differentiator.h +++ b/ReactCommon/react/renderer/mounting/Differentiator.h @@ -8,6 +8,7 @@ #pragma once #include +#include #include namespace facebook { diff --git a/ReactCommon/react/renderer/mounting/MountingCoordinator.h b/ReactCommon/react/renderer/mounting/MountingCoordinator.h index 9356126ed4e..00c12ba0685 100644 --- a/ReactCommon/react/renderer/mounting/MountingCoordinator.h +++ b/ReactCommon/react/renderer/mounting/MountingCoordinator.h @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -17,10 +18,6 @@ #include #include "ShadowTreeRevision.h" -#ifndef NDEBUG -#define RN_SHADOW_TREE_INTROSPECTION 1 -#endif - #ifdef RN_SHADOW_TREE_INTROSPECTION #include #endif diff --git a/ReactCommon/react/renderer/mounting/StubViewTree.cpp b/ReactCommon/react/renderer/mounting/StubViewTree.cpp index 306076bdd73..d7a6e426655 100644 --- a/ReactCommon/react/renderer/mounting/StubViewTree.cpp +++ b/ReactCommon/react/renderer/mounting/StubViewTree.cpp @@ -9,9 +9,6 @@ #include -// Uncomment to enable verbose StubViewTree debug logs -// #define STUB_VIEW_TREE_VERBOSE 1 - // For iOS especially: flush logs because some might be lost on iOS if an // assert is hit right after this. #define STUB_VIEW_ASSERT(cond) \ diff --git a/packages/rn-tester/Gemfile b/packages/rn-tester/Gemfile index 03d842220cf..67b0c7bd80f 100644 --- a/packages/rn-tester/Gemfile +++ b/packages/rn-tester/Gemfile @@ -1,4 +1,4 @@ # Gemfile source 'https://rubygems.org' -gem 'cocoapods', '= 1.10.0' +gem 'cocoapods', '= 1.10.1' diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 2d7c3de9247..f4e215b80b4 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -841,4 +841,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 799678aa4c11e7c6d8a431a3883e94b09b8dd0f1 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1