Tweaked a few inline comments
Brian Vaughn committed
Jun 8, 2019 at 17:30 UTC
341d1574cbe11eae8c7bf4451428695a26124590
3 files changed
+7
-2
src/backend/renderer.js
+7
@@ -704,6 +704,7 @@ export function attach(
704
}
705
}
706
707
+ // Differentiates between a null context value and no context.
708
const NO_CONTEXT = {};
709
710
function getContextsForFiber(fiber: Fiber): [Object, any] | null {
@@ -731,6 +732,9 @@ export function attach(
732
}
733
}
734
735
+ // Record all contexts at the time profiling is started.
736
+ // Fibers only store the current context value,
737
+ // so we need to track them separatenly in order to determine changed keys.
738
function crawlToInitializeContextsMap(fiber: Fiber) {
739
updateContextsForFiber(fiber);
740
let current = fiber.child;
@@ -2390,6 +2394,9 @@ export function attach(
2394
);
2395
2396
if (shouldRecordChangeDescriptions) {
2397
+ // Record all contexts at the time profiling is started.
2398
+ // Fibers only store the current context value,
2399
+ // so we need to track them separatenly in order to determine changed keys.
2400
crawlToInitializeContextsMap(root.current);
2401
}
2402
});
src/backend/types.js
-1
@@ -112,7 +112,6 @@ export type ReactRenderer = {
112
currentDispatcherRef?: {| current: null | Dispatcher |},
113
};
114
115
-// TODO (change descriptions) Should we report changed hooks keys?
115
export type ChangeDescription = {|
116
context: Array<string> | boolean | null,
117
didHooksChange: boolean,
src/devtools/views/Profiler/types.js
-1
@@ -31,7 +31,6 @@ export type SnapshotNode = {|
31
type: ElementType,
32
|};
33
34
-// TODO (change descriptions) Should we report changed hooks keys?
34
export type ChangeDescription = {|
35
context: Array<string> | boolean | null,
36
didHooksChange: boolean,