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

@doist/react-compiler-tracker

v2.1.2

Published

A React Compiler violation tracker to help migrations and prevent regressions

Readme

React Compiler Tracker

npm version License: MIT Node.js

The React Compiler automatically memoizes your components, eliminating the need for useCallback and useMemo. However, certain code patterns cause the compiler to bail out. When this happens, your components lose automatic optimization, potentially causing performance regressions.

Inspired by esplint and react-compiler-marker, this tool tracks compiler errors in a .react-compiler.rec.json file and integrates with Git hooks and CI to prevent new violations from being introduced.

Prerequisites

This tool requires babel-plugin-react-compiler to be installed in your project:

npm install --save-dev babel-plugin-react-compiler

Installation

npm install --save-dev @doist/react-compiler-tracker

Configuration

Create a .react-compiler-tracker.config.json file in your project root to customize the tool's behavior:

{
    "recordsFile": ".react-compiler.rec.json",
    "sourceGlob": "src/**/*.{js,jsx,ts,tsx}"
}

All fields are optional. Default values are shown above.

| Option | Description | Default | |--------|-------------|---------| | recordsFile | Path to the records file | .react-compiler.rec.json | | sourceGlob | Glob pattern for source files | src/**/*.{js,jsx,ts,tsx} |

Monorepo Usage

In a monorepo, run the tool from your package directory. The config file and all paths are relative to where you run the command. The defaults typically work out of the box:

my-monorepo/
├── packages/
│   └── frontend/
│       ├── .react-compiler-tracker.config.json  # Optional config
│       ├── .react-compiler.rec.json             # Records file
│       └── src/
│           └── ...

If your source files are in a different location (e.g., app/ instead of src/), customize the config:

{
    "sourceGlob": "app/**/*.{ts,tsx}"
}

Usage

--overwrite

Regenerates the entire records file by scanning all source files matching sourceGlob. Useful for initialization or picking up changes from skipped Git hooks.

npx @doist/react-compiler-tracker --overwrite

--stage-record-file <file1> <file2> ...

Checks the provided files and updates the records. Exits with code 1 if errors increase (preventing the commit), otherwise updates the records file for the checked files. Reports when errors decrease, celebrating your progress. Deleted files are automatically removed from the records (no need to pass their paths).

npx @doist/react-compiler-tracker --stage-record-file src/components/Button.tsx src/hooks/useData.ts

If no files are provided, exits cleanly with a success message.

--check-files <file1> <file2> ...

Checks specific files without updating records. Exits with code 1 if checked files show increased error counts (or new errors), or if any provided file does not exist. Reports when errors decrease, celebrating your progress. Primarily for CI to ensure PRs don't introduce new compiler errors.

npx @doist/react-compiler-tracker --check-files src/components/Button.tsx src/hooks/useData.ts

No flags

Checks all source files matching sourceGlob and reports the total error count. The records file is not updated in this mode.

npx @doist/react-compiler-tracker

Integration Examples

lint-staged

In package.json:

{
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": "npx @doist/react-compiler-tracker --stage-record-file"
  }
}

With lint-staged, the matched files are automatically passed as arguments to the command.

GitHub Actions CI

- name: Check React Compiler violations
  run: |
    # Get changed files in the PR
    FILES=$(git diff --name-only origin/main...HEAD -- '*.tsx' '*.ts' '*.jsx' '*.js' | tr '\n' ' ')
    if [ -n "$FILES" ]; then
      npx @doist/react-compiler-tracker --check-files $FILES
    fi

Pre-commit hook (manual)

#!/bin/sh
# Get staged files and pass them to the tracker
# (deleted files are auto-detected from records, no need to pass them)
FILES=$(git diff --diff-filter=ACMR --cached --name-only -- '*.tsx' '*.ts' '*.jsx' '*.js' | tr '\n' ' ')
if [ -n "$FILES" ]; then
  npx @doist/react-compiler-tracker --stage-record-file $FILES
fi

License

Released under the MIT License.