-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from nextstrain/react-16
React 16
- Loading branch information
Showing
6 changed files
with
54 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
|
||
export const setUpPerf = function () { | ||
window.Perf = require("react-addons-perf"); | ||
window.Perf.counter = -1; | ||
window.Perf.show = function () { | ||
const measurements = window.Perf.getLastMeasurements(); | ||
console.log("REACT PERFORMANCE INFO"); | ||
// console.log("inclusive times"); | ||
// window.Perf.printInclusive(measurements); | ||
console.log("exclusive times"); | ||
window.Perf.printExclusive(measurements); | ||
} | ||
window.Perf.bump = function () { | ||
window.Perf.counter += 1; | ||
if (window.Perf.counter === 0) { | ||
window.Perf.start(); | ||
} | ||
if (window.Perf.counter === 1) { | ||
/* display a single tick */ | ||
console.log("Performance for a single animation tick:"); | ||
window.Perf.show(); | ||
} | ||
if (window.Perf.counter === 50) { | ||
console.log("Performance for 50 animation ticks:"); | ||
window.Perf.show(); | ||
window.Perf.stop(); | ||
} | ||
}; | ||
window.Perf.resetCount = function () { | ||
window.Perf.counter = -1; | ||
}; | ||
}; | ||
/* | ||
This function uses react-addons-perf which is no longer available in react 16. | ||
My general plan is to move these into automatic tests which we can run. | ||
*/ | ||
|
||
// export const setUpPerf = function () { | ||
// window.Perf = require("react-addons-perf"); | ||
// window.Perf.counter = -1; | ||
// window.Perf.show = function () { | ||
// const measurements = window.Perf.getLastMeasurements(); | ||
// console.log("REACT PERFORMANCE INFO"); | ||
// // console.log("inclusive times"); | ||
// // window.Perf.printInclusive(measurements); | ||
// console.log("exclusive times"); | ||
// window.Perf.printExclusive(measurements); | ||
// } | ||
// window.Perf.bump = function () { | ||
// window.Perf.counter += 1; | ||
// if (window.Perf.counter === 0) { | ||
// window.Perf.start(); | ||
// } | ||
// if (window.Perf.counter === 1) { | ||
// /* display a single tick */ | ||
// console.log("Performance for a single animation tick:"); | ||
// window.Perf.show(); | ||
// } | ||
// if (window.Perf.counter === 50) { | ||
// console.log("Performance for 50 animation ticks:"); | ||
// window.Perf.show(); | ||
// window.Perf.stop(); | ||
// } | ||
// }; | ||
// window.Perf.resetCount = function () { | ||
// window.Perf.counter = -1; | ||
// }; | ||
// }; |