Improve React fb-www debugging output

Summary:
Release note: none

Improves the debugging verbose output of fb-www React logs.
Closes https://github.com/facebook/prepack/pull/1862

Reviewed By: gaearon

Differential Revision: D7862544

Pulled By: trueadm

fbshipit-source-id: ccd995d1ea1f2f2ef49962897a64334bb30de91f
This commit is contained in:
Dominic Gannaway 2018-05-03 12:50:36 -07:00 committed by Facebook Github Bot
parent 4af05bd908
commit b55c484d1d
2 changed files with 12 additions and 0 deletions

View File

@ -1172,6 +1172,9 @@ export class Reconciler {
null,
evaluatedChildNode
);
if (this.realm.react.verbose && evaluatedChildNode.status === "INLINED") {
this.logger.logInformation(`${evaluatedNode.name} (inlined)`);
}
evaluatedNode.children.push(evaluatedChildNode);
result = render.result;
this.statistics.inlinedComponents++;

View File

@ -321,6 +321,9 @@ export class Functions {
if (reconciler.hasEvaluatedRootNode(componentType, evaluatedRootNode)) {
continue;
}
if (this.realm.react.verbose) {
logger.logInformation(` Evaluating ${evaluatedRootNode.name} (root)`);
}
let componentTreeEffects = reconciler.renderReactComponentTree(componentType, null, null, evaluatedRootNode);
if (componentTreeEffects === null) {
if (this.realm.react.verbose) {
@ -379,6 +382,9 @@ export class Functions {
if (func instanceof ECMAScriptSourceFunctionValue && reconciler.hasEvaluatedRootNode(func, evaluatedNode)) {
continue;
}
if (this.realm.react.verbose) {
logger.logInformation(` Evaluating function "${getComponentName(this.realm, func)}"`);
}
let closureEffects = reconciler.renderNestedOptimizedClosure(
func,
nestedEffects,
@ -441,6 +447,9 @@ export class Functions {
continue;
}
reconciler.clearComponentTreeState();
if (this.realm.react.verbose) {
logger.logInformation(` Evaluating ${evaluatedNode.name} (branch)`);
}
let branchEffects = reconciler.renderReactComponentTree(branchComponentType, null, null, evaluatedNode);
if (branchEffects === null) {
if (this.realm.react.verbose) {