Remove public APIs for YGNodePrint and YGConfigSetPrintTreeFlag (#1567)

Summary:
X-link: https://github.com/facebook/react-native/pull/42688

Pull Request resolved: https://github.com/facebook/yoga/pull/1567

We are planning on overhauling NodeToString to output JSON instead of HTML for the purposes of better benchmarking and capturing trees in JSON format to benchmark later. This gives us a bit of a headache as we have to revise several build files to ensure this new library works, ensure that it is only included in certain debug builds, and deal with the benchmark <-> internal cross boundary that arises as the benchmark code (which is a separate binary) tries to interact with it.

On top of it all this is really not used at all.

The plan is to rip out this functionality and just put it in a separate binary that one can include if they really want to debug. That means that it cannot exist in the public API, so I am removing it here.

Private internals come next

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53137544

fbshipit-source-id: 7571d243b914cd9bf09ac2418d9a1b86d1bee64a
This commit is contained in:
Joe Vilches
2024-02-02 15:44:23 -08:00
committed by Facebook GitHub Bot
parent 58aa090774
commit 28975a6053
11 changed files with 0 additions and 201 deletions

View File

@@ -90,7 +90,3 @@ void YGConfigSetCloneNodeFunc(
const YGCloneNodeFunc callback) {
resolveRef(config)->setCloneNodeCallback(callback);
}
void YGConfigSetPrintTreeFlag(YGConfigRef config, bool enabled) {
resolveRef(config)->setShouldPrintTree(enabled);
}

View File

@@ -155,9 +155,4 @@ YG_EXPORT void YGConfigSetCloneNodeFunc(
YGConfigRef config,
YGCloneNodeFunc callback);
/**
* Allows printing the Yoga node tree during layout for debugging purposes.
*/
YG_EXPORT void YGConfigSetPrintTreeFlag(YGConfigRef config, bool enabled);
YG_EXTERN_C_END

View File

@@ -11,7 +11,6 @@
#include <yoga/algorithm/CalculateLayout.h>
#include <yoga/debug/AssertFatal.h>
#include <yoga/debug/Log.h>
#include <yoga/debug/NodeToString.h>
#include <yoga/event/event.h>
#include <yoga/node/Node.h>
@@ -330,12 +329,6 @@ void YGNodeSetAlwaysFormsContainingBlock(
resolveRef(node)->setAlwaysFormsContainingBlock(alwaysFormsContainingBlock);
}
#ifdef DEBUG
void YGNodePrint(const YGNodeConstRef node, const YGPrintOptions options) {
yoga::print(resolveRef(node), scopedEnum(options));
}
#endif
// TODO: This leaks internal details to the public API. Remove after removing
// ComponentKit usage of it.
bool YGNodeCanUseCachedMeasurement(

View File

@@ -273,11 +273,6 @@ YG_EXPORT void YGNodeSetAlwaysFormsContainingBlock(
YGNodeRef node,
bool alwaysFormsContainingBlock);
/**
* Print a node to log output.
*/
YG_EXPORT void YGNodePrint(YGNodeConstRef node, YGPrintOptions options);
/**
* @deprecated
*/