react-perf-devtool
Advanced tools
Comparing version 3.0.0-beta1 to 3.0.0-beta2
{ | ||
"name": "react-perf-devtool", | ||
"version": "3.0.0-beta1", | ||
"version": "3.0.0-beta2", | ||
"description": | ||
@@ -5,0 +5,0 @@ "A chrome devtool extension for inspecting performance of React Components", |
var getReactPerformanceData = require('../shared/parse') | ||
var generateDataFromMeasures = require('../shared/generate') | ||
function registerListener() { | ||
var observer = new window.PerformanceObserver(list => { | ||
// var options = { | ||
// logToConsole: false | ||
// } | ||
function registerListener(options) { | ||
var observer = new window.PerformanceObserver(list => { | ||
// window.__REACT_PERF_DEVTOOL_GLOBAL_STORE___ = list.getEntries() | ||
@@ -16,2 +20,6 @@ | ||
} | ||
if (options.logToConsole) { | ||
logToConsole(measures) | ||
} | ||
}) | ||
@@ -24,36 +32,16 @@ | ||
function logToConsole(measures) { | ||
measures.forEach((measure) => { | ||
window.navigator.sendBeacon( | ||
'http://127.0.0.1:3000', { | ||
name: measure.componentName, | ||
render: measure.render, | ||
update: measure.update, | ||
mount: measure.mount, | ||
unmount: measure.unmount | ||
} | ||
) | ||
}) | ||
} | ||
module.exports = registerListener | ||
// function logToConsole(measures) { | ||
// measures.forEach(({ componentName, mount, render, update }) => { | ||
// const data = { | ||
// componentName, | ||
// mount, | ||
// render, | ||
// update, | ||
// } | ||
// | ||
// window.navigator.sendBeacon('http://127.0.0.1:3000', JSON.stringify(data)) | ||
// }) | ||
// } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40761
795