Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39778

Used with `IS_DEVELOPMENT_ENVIRONMENT` and `ReactFeatureFlags.enableFabricLogs`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D49864983

fbshipit-source-id: bf912abd765ff74e9ed8b94571293f79458feca2
This commit is contained in:
Pieter De Baets 2023-10-03 16:04:51 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 72d0fed272
Коммит c604f10d4a
3 изменённых файлов: 19 добавлений и 7 удалений

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

@ -83,4 +83,18 @@ public class StateWrapperImpl implements StateWrapper {
mHybridData.resetNative(); mHybridData.resetNative();
} }
} }
@Override
public String toString() {
if (mDestroyed) {
return "<destroyed>";
}
ReadableNativeMap map = getStateDataImpl();
if (map == null) {
return "<unexpected null>";
}
return map.toString();
}
} }

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

@ -247,12 +247,13 @@ public class MountItemDispatcher {
// If there are MountItems to dispatch, we make sure all the "pre mount items" are executed // If there are MountItems to dispatch, we make sure all the "pre mount items" are executed
// first // first
Collection<MountItem> preMountItemsToDispatch = getAndResetPreMountItems(); Collection<MountItem> preMountItemsToDispatch = getAndResetPreMountItems();
if (preMountItemsToDispatch != null) { if (preMountItemsToDispatch != null) {
Systrace.beginSection( Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricUIManager::mountViews preMountItems"); Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricUIManager::mountViews preMountItems");
for (MountItem preMountItem : preMountItemsToDispatch) { for (MountItem preMountItem : preMountItemsToDispatch) {
if (ENABLE_FABRIC_LOGS) {
printMountItem(preMountItem, "dispatchMountItems: Executing preMountItem");
}
executeOrEnqueue(preMountItem); executeOrEnqueue(preMountItem);
} }
@ -330,11 +331,8 @@ public class MountItemDispatcher {
} }
if (ENABLE_FABRIC_LOGS) { if (ENABLE_FABRIC_LOGS) {
printMountItem( printMountItem(preMountItemToDispatch, "dispatchPreMountItems");
preMountItemToDispatch,
"dispatchPreMountItems: Dispatching PreAllocateViewMountItem");
} }
executeOrEnqueue(preMountItemToDispatch); executeOrEnqueue(preMountItemToDispatch);
} }
} finally { } finally {

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

@ -242,7 +242,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
StateWrapper state = castToState(mObjBuffer[j++]); StateWrapper state = castToState(mObjBuffer[j++]);
String stateString = String stateString =
IS_DEVELOPMENT_ENVIRONMENT IS_DEVELOPMENT_ENVIRONMENT
? (state != null ? state.getStateData().toString() : "<null>") ? (state != null ? state.toString() : "<null>")
: "<hidden>"; : "<hidden>";
s.append(String.format("UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString)); s.append(String.format("UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString));
} else if (type == INSTRUCTION_UPDATE_LAYOUT) { } else if (type == INSTRUCTION_UPDATE_LAYOUT) {