npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@oxog/reactscope

v1.0.0

Published

Zero-dependency React performance profiler with micro-kernel plugin architecture

Readme

ReactScope

Zero-dependency React performance profiler with micro-kernel plugin architecture.

npm version License: MIT TypeScript

Track renders, detect wasted updates, monitor memory, and optimize your React applications with a powerful micro-kernel plugin architecture.

Features

  • Zero Dependencies - No runtime dependencies, everything implemented from scratch
  • Render Tracking - Track every render with precise timing and phase detection
  • Wasted Render Detection - Automatically detect unnecessary re-renders
  • Props Diffing - Deep comparison of props between renders
  • Memory Monitoring - Track heap usage and detect potential memory leaks
  • Network Correlation - Correlate network requests with component renders
  • Visual Dashboard - Real-time monitoring with Shadow DOM isolation
  • Plugin Architecture - Extensible micro-kernel design
  • TypeScript First - Full type safety with strict mode
  • Tree Shakeable - Only include what you use

Installation

npm install @oxog/reactscope
yarn add @oxog/reactscope
pnpm add @oxog/reactscope

Quick Start

1. Wrap your app with the Provider

import { ReactScopeProvider } from '@oxog/reactscope'

function App() {
  return (
    <ReactScopeProvider>
      <YourApp />
    </ReactScopeProvider>
  )
}

2. Use the useScope hook to track components

import { useScope } from '@oxog/reactscope'

function MyComponent({ data }) {
  const scope = useScope('MyComponent')

  // Access metrics
  console.log('Renders:', scope.renderCount)
  console.log('Avg time:', scope.averageRenderTime)

  return <div>{data}</div>
}

3. Or wrap components with the Scope component

import { Scope } from '@oxog/reactscope'

function App() {
  return (
    <Scope name="ExpensiveList">
      <ExpensiveList items={items} />
    </Scope>
  )
}

4. Enable the Dashboard

import { ReactScopeProvider, createDashboardUIPlugin } from '@oxog/reactscope'

function App() {
  return (
    <ReactScopeProvider
      plugins={[createDashboardUIPlugin()]}
      onReady={(kernel) => {
        // Open with Ctrl+Shift+R or programmatically
        kernel.getPlugin('dashboard-ui')?.api.show()
      }}
    >
      <YourApp />
    </ReactScopeProvider>
  )
}

API Reference

Provider

<ReactScopeProvider
  enabled={true}                    // Enable/disable profiling
  plugins={[customPlugin]}          // Additional plugins
  onReady={(kernel) => {}}          // Callback when ready
  options={{
    trackAllComponents: false,      // Auto-track all components
    sampleRate: 1,                  // 0-1, for performance
    maxHistorySize: 1000,           // Limit stored events
  }}
>
  {children}
</ReactScopeProvider>

Hooks

// Main profiling hook
const scope = useScope('ComponentName', options)
scope.renderCount       // number
scope.lastRenderTime    // number (ms)
scope.averageRenderTime // number (ms)
scope.wastedRenders     // number

// Read-only metrics hook
const metrics = useScopeMetrics('ComponentId')

// Access kernel directly
const kernel = useScopeContext()

HOC

import { withScope } from '@oxog/reactscope'

const ProfiledComponent = withScope(MyComponent, {
  name: 'MyComponent',
  trackProps: true,
  onRender: (metrics) => console.log(metrics),
})

Plugins

ReactScope comes with 10 built-in plugins:

| Plugin | Description | |--------|-------------| | render-tracker | Tracks render count and duration | | props-differ | Analyzes props changes between renders | | wasted-render-detector | Detects unnecessary re-renders | | lifecycle-tracker | Tracks mount/unmount events | | console-reporter | Logs profiling data to console | | json-exporter | Exports metrics as JSON | | timeline-recorder | Records events for playback | | memory-tracker | Monitors memory usage | | network-correlator | Correlates renders with network requests | | dashboard-ui | Visual overlay panel |

Creating Custom Plugins

import { createPlugin } from '@oxog/reactscope'

const myPlugin = createPlugin({
  name: 'my-plugin',
  version: '1.0.0',
  hooks: {
    onRender: (event) => {
      console.log(`${event.componentName} rendered in ${event.duration}ms`)
    },
  },
  api: {
    customMethod: () => 'custom data',
  },
})

Programmatic API

import { getKernel, getMetrics, exportMetrics, clearMetrics } from '@oxog/reactscope'

// Access global kernel
const kernel = getKernel()

// Get metrics store
const metrics = getMetrics()

// Export as JSON
const json = exportMetrics()

// Clear all data
clearMetrics()

Browser Support

  • Chrome 80+
  • Firefox 75+
  • Safari 14+
  • Edge 80+

Performance

ReactScope is designed to have minimal impact on your application:

  • Uses requestIdleCallback for non-critical updates
  • Batches metric updates
  • Throttles dashboard renders
  • Supports sampling rate for high-frequency renders
  • Lazy initializes plugins

License

MIT

Links