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

@autotracer/inject-react18

v1.0.0-alpha.55

Published

Shared AST transform logic for auto-injecting useReactTracer

Readme

@autotracer/inject-react18

Overview

@autotracer/inject-react18 is the shared low-level transform package behind the ReactTracer build plugins. It is for tool authors who need direct control over the AST transform instead of using the Vite or Babel integration packages.

Why Use It

This package exposes the shared transform pipeline directly. That gives custom tooling access to transform(), normalizeConfig(), the shared eligibility helpers, and the shared config model without having to reimplement React component detection and hook-label injection yourself.

Installation

pnpm add -D @autotracer/inject-react18

Most app integrations should use @autotracer/plugin-vite-react18 or @autotracer/plugin-babel-react18 instead.

Configuration

Start from normalizeConfig() so the shared defaults are applied before you call transform():

import { normalizeConfig } from "@autotracer/inject-react18";

const config = normalizeConfig({
  mode: "opt-out",
});

Use these documentation pages for exact behavior:

  • Shared transform overview: https://docs.autotracer.dev/reference/build/react18/inject/
  • Shared transform API: https://docs.autotracer.dev/api/inject-react18
  • mode: https://docs.autotracer.dev/reference/build/react18/inject/config/mode
  • include: https://docs.autotracer.dev/reference/build/react18/inject/config/include
  • exclude: https://docs.autotracer.dev/reference/build/react18/inject/config/exclude
  • serverComponents: https://docs.autotracer.dev/reference/build/react18/inject/config/serverComponents
  • importSource: https://docs.autotracer.dev/reference/build/react18/inject/config/importSource
  • labelHooks: https://docs.autotracer.dev/reference/build/react18/inject/config/labelHooks
  • labelHooksPattern: https://docs.autotracer.dev/reference/build/react18/inject/config/labelHooksPattern

This package does not initialize reactTracer(), does not expose globalThis.autoTracer, and does not load theme files.

Usage

Use the shared transform directly only in custom tooling:

import { normalizeConfig, transform } from "@autotracer/inject-react18";

const config = normalizeConfig({
  mode: "opt-out",
  labelHooks: ["useSelector"],
});

const result = transform(sourceCode, {
  filename: "Widget.tsx",
  config,
  prefix: "ShellA",
});

Use prefix when multiple islands, micro-frontends, or other independent React entry points share one browser tab and you need injected component names to stay distinguishable as prefix:ComponentName.

For the exported helper surface and type shapes, use the package API page:

  • https://docs.autotracer.dev/api/inject-react18

For normal app integrations, use these packages instead:

  • Vite path: https://docs.autotracer.dev/api/plugin-vite-react18
  • Babel path: https://docs.autotracer.dev/api/plugin-babel-react18

License

MIT © Carl Ribbegårdh