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

monkey-patch-fire

v1.0.0

Published

React Performance Tool for investigating Rerenders

Readme

Monkey-Patch-Fire

Just another React Performance Tool.

ETHOS

For a MVP i would like to see:

  • all re-renders for all types of rendered components.
  • how long each Components re-renders are taking
  • exactly what prop / state is causing the render.

TODO:

  1. Update inject script to patch over React.createElement or use react.__REACT_DEVTOOLS_GLOBAL_HOOK__ so that can check re-renders in SFC & not have the collector overridden via custom ComponentWillMount() inside components.

  2. Use the browser + PerformanceObeserver api to build and agregate all the component renders. ie How long its all taking

  3. Display / visualise all of re-renderings. Flame graph, heats map, tables?

  4. Have it injected via a browser addon vs having to import it inside and use on client load.

  5. Differ on the different type of re-renders:

components can update for multiple reasons (e.g. new objects and new functions). Ideally all reasons would be displayed at once to make the debugging experience easier.

E.g., if we render this twice:

// (ClassDemo is not a PureComponent)

<ClassDemo a={1} b={{c: {d: 4}}} e={function something () {}} f={1} />

There are multiple avoidable reasons why ClassDemo will update:

  • Functions for props e are not reference equal but are similar.
  • Objects for props b are not reference equal but are deep equal.
  • Props a and f are reference equal, but component is not PureComponent.

Currently we only log:

ClassDemo.props: Changes are in functions only. Possibly avoidable re-render?

Functions before: {e: ƒ}
Functions after: {e: ƒ}

After fixing prop e so the functions are the same, the next error is uncovered:

ClassDemo.props: Value did not change. Avoidable re-render!

Before: {a: 1, b: {…}, e: 1, f: 1}
After: {a: 1, b: {…}, e: 1, f: 1}
"b" property is not equal by reference

After fixing prop b so the objects are the same, the next (final) error is uncovered:

ClassDemo.props: Value did not change. Avoidable re-render!

Before: {a: 1, b: 1, e: 1, f: 1}
After: {a: 1, b: 1, e: 1, f: 1}

After making the component a PureComponent, finally we have fixed all the errors.

Ideally, we would aggregate all reasons into one log. E.g.

ClassDemo.props:

  • Functions for props e are not reference equal but are similar.
  • Objects for props b are not reference equal but are deep equal.
  • Props a and f are reference equal, but component is not PureComponent. Possibly avoidable re-render?