New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.3-beta3 to 3.0.4-beta0

2

package.json
{
"name": "react-perf-devtool",
"version": "3.0.3-beta3",
"version": "3.0.4-beta0",
"description": "A devtool for inspecting the performance of React Components",

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

# React Performance Devtool
[![Build Status](https://travis-ci.org/nitin42/react-perf-devtool.svg?branch=master)](https://travis-ci.org/nitin42/react-perf-devtool)

@@ -11,3 +12,3 @@ ![Release Status](https://img.shields.io/badge/status-stable-brightgreen.svg)

<p align="center">
<img src="./art/RPLogo.png" height="200" width="200">
<img src="https://i.gyazo.com/332f573872d396e4f665d58e491a8ccd.png">
</p>

@@ -300,2 +301,24 @@

**components**
You can also inspect the performance of specific components using options through **`components`** property.
<img src="http://g.recordit.co/sAQGSOrCA7.gif">
Example -
```js
var options = {
shouldLog: true,
port: 3000,
components: ['App', 'Main'] // Assuming you've these components in your project
}
function callback(measures) {
// do something with measures
}
registerObserver(options, callback)
```
## Description

@@ -302,0 +325,0 @@

@@ -34,3 +34,3 @@ var getReactPerformanceData = require('../shared/parse')

params = params || {}
var { shouldLog, port, components } = params
var { shouldLog, port, components, webService } = params
var observer = new window.PerformanceObserver(list => {

@@ -51,2 +51,23 @@ var measures = generateDataFromMeasures(

if (webService) {
var storage = window.localStorage
var KEY = '__REACT_PERF_DEVTOOL_GLOBAL_STORE__'
if (storage.getItem(KEY) === null || storage.getItem(KEY) === undefined) {
storage.setItem(KEY, {
measures,
length: list.getEntries().length,
rawMeasures: list.getEntries()
})
} else if (storage.getItem(KEY) !== null) {
storage.removeItem(KEY)
// New measures
storage.setItem(KEY, {
measures,
length: list.getEntries().length,
rawMeasures: list.getEntries()
})
}
}
// For logging to console

@@ -94,3 +115,3 @@ if (shouldLog) {

componentDidUpdate,
componentWillUnmount,
componentWillUnmount
}) => {

@@ -114,3 +135,3 @@ // The time is in millisecond (ms)

componentDidUpdate,
componentWillUnmount,
componentWillUnmount
}

@@ -117,0 +138,0 @@

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