MCPcopy Create free account
hub / github.com/Lobos/react-ui / getUnchangedComponents

Function getUnchangedComponents

docs/lib/react.js:9845–9879  ·  view source on GitHub ↗
(measurement)

Source from the content-addressed store, hash-verified

9843}
9844
9845function getUnchangedComponents(measurement) {
9846 // For a given reconcile, look at which components did not actually
9847 // render anything to the DOM and return a mapping of their ID to
9848 // the amount of time it took to render the entire subtree.
9849 var cleanComponents = {};
9850 var writes = measurement.writes;
9851 var dirtyComposites = {};
9852 Object.keys(writes).forEach(function (id) {
9853 writes[id].forEach(function (write) {
9854 // Root mounting (innerHTML set) is recorded with an ID of ''
9855 if (id !== '') {
9856 measurement.hierarchy[id].forEach(function (c) {
9857 return dirtyComposites[c] = true;
9858 });
9859 }
9860 });
9861 });
9862 var allIDs = _assign({}, measurement.exclusive, measurement.inclusive);
9863
9864 for (var id in allIDs) {
9865 var isDirty = false;
9866 // See if any of the DOM operations applied to this component's subtree.
9867 if (dirtyComposites[id]) {
9868 isDirty = true;
9869 }
9870 // check if component newly created
9871 if (measurement.created[id]) {
9872 isDirty = true;
9873 }
9874 if (!isDirty && measurement.counts[id] > 0) {
9875 cleanComponents[id] = true;
9876 }
9877 }
9878 return cleanComponents;
9879}
9880
9881var ReactDefaultPerfAnalysis = {
9882 getExclusiveSummary: getExclusiveSummary,

Callers 1

getInclusiveSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…