Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-perf-devtool

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-perf-devtool - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

45

lib/npm/hook.js

@@ -45,29 +45,32 @@ 'use strict';

var _params = params,
shouldLog = _params.shouldLog,
port = _params.port,
components = _params.components;
// TODO: Is there any way to polyfill this API ?
if (window.PerformanceObserver) {
var _params = params,
shouldLog = _params.shouldLog,
port = _params.port,
components = _params.components;
var observer = new window.PerformanceObserver(function (list) {
var measures = (0, _generate.generateDataFromMeasures)((0, _parse.getReactPerformanceData)(list.getEntries()));
var observer = new window.PerformanceObserver(function (list) {
var measures = (0, _generate.generateDataFromMeasures)((0, _parse.getReactPerformanceData)(list.getEntries()));
if (callback && typeof callback === 'function') {
callback(measures);
}
if (callback && typeof callback === 'function') {
callback(measures);
}
window.__REACT_PERF_DEVTOOL_GLOBAL_STORE__ = {
measures: measures,
length: list.getEntries().length,
rawMeasures: list.getEntries()
window.__REACT_PERF_DEVTOOL_GLOBAL_STORE__ = {
measures: measures,
length: list.getEntries().length,
rawMeasures: list.getEntries()
// For logging to console
};if (shouldLog) {
logToConsole(params, measures);
}
});
// For logging to console
};if (shouldLog) {
logToConsole(params, measures);
}
});
observer.observe({
entryTypes: ['measure']
});
observer.observe({
entryTypes: ['measure']
});
}
};

@@ -74,0 +77,0 @@

{
"name": "react-perf-devtool",
"version": "3.0.4",
"version": "3.0.5",
"description": "A devtool for inspecting the performance of React Components",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,2 +6,3 @@ # React Performance Devtool

![Author](https://img.shields.io/badge/author-Nitin%20Tulswani-lightgrey.svg)
![current-version](https://img.shields.io/badge/version-3.0.5-blue.svg)

@@ -112,5 +113,4 @@ > A devtool for inspecting the performance of React Components

```js
var registerObserver = require('react-perf-devtool')
const { registerObserver } = require('react-perf-devtool')
// Simple, no?
registerObserver()

@@ -140,3 +140,3 @@ ```

```js
const registerObserver = require('react-perf-devtool')
const { registerObserver } = require('react-perf-devtool')

@@ -191,9 +191,9 @@ function callback(measures) {

var React = require('react')
var ReactDOM = require('react-dom')
var registerObserver = require('react-perf-devtool')
const React = require('react')
const ReactDOM = require('react-dom')
const { registerObserver } = require('react-perf-devtool')
var Component = require('./Component') // Some React Component
const Component = require('./Component') // Some React Component
var options = {
const options = {
shouldLog: true,

@@ -214,3 +214,3 @@ port: 8080

// server.js
var { json } = require('micro')
const { json } = require('micro')

@@ -314,3 +314,3 @@ module.exports = async req => {

```js
var options = {
const options = {
shouldLog: true,

@@ -400,3 +400,3 @@ port: 3000,

```js
const registerObserver = require('react-perf-devtool')
const { registerObserver } = require('react-perf-devtool')

@@ -403,0 +403,0 @@ registerObserver()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc