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

@domscribe/react

v0.5.2

Published

React adapter for Domscribe

Readme

@domscribe/react

React adapter for Domscribe — fiber walking, props/state extraction, and bundler plugins.

Install

npm install -D @domscribe/react

Vite

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { domscribe } from '@domscribe/react/vite';

export default defineConfig({
  plugins: [react(), domscribe()],
});

Webpack

const { DomscribeWebpackPlugin } = require('@domscribe/react/webpack');

// Add to plugins array + add webpack loader rule
// (see @domscribe/transform README for full webpack config)

Plugin Options

The React plugin extends the base transform plugin options with runtime and capture namespaces:

interface DomscribeReactPluginOptions {
  // Base transform options
  include?: RegExp;
  exclude?: RegExp;
  debug?: boolean;
  relay?: { autoStart?: boolean; port?: number; host?: string };
  overlay?:
    | boolean
    | { initialMode?: 'collapsed' | 'expanded'; debug?: boolean };

  // React-specific
  runtime?: DomscribeRuntimeOptions;
  capture?: DomscribeReactCaptureOptions;
}

Runtime Options

| Option | Type | Default | Description | | ---------------- | -------------------------- | ----------- | ------------------------------------------------------------------------------------------------------ | | phase | 1 \| 2 | 1 | Feature phase gate (Phase 1: props/state, Phase 2: events/perf) | | redactPII | boolean | true | Redact sensitive values in captured data | | blockSelectors | string[] | [] | CSS selectors to exclude from capture | | serialization | SerializationConstraints | undefined | Serialization bounds (maxDepth, maxArrayLength, maxTotalBytes, etc.) — see @domscribe/runtime README |

Capture Options

| Option | Type | Default | Description | | ------------------- | ---------------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | strategy | 'devtools' \| 'fiber' \| 'best-effort' | 'best-effort' | Capture strategy. devtools uses React DevTools hook (most reliable), fiber accesses Fiber tree directly (fast), best-effort tries multiple strategies | | maxTreeDepth | number | 50 | Maximum component tree depth to traverse | | includeWrappers | boolean | true | Include HOC/memo/forwardRef wrapper components | | hookNameResolvers | Record<string, Record<number, string>> | undefined | Map component names to hook index to semantic name mappings. Keys are component names, values map hook index to name. Converted to Map<string, Map<number, string>> at runtime. |

Hook State Extraction

The React adapter classifies hooks by inspecting the structure of each hook's memoizedState and applies smart extraction:

  • Effect hooks (useEffect, useLayoutEffect) are excluded from captured state — they contain only internal scheduling data ({tag, create, destroy, deps}), not application state.
  • Memo/callback hooks (useMemo, useCallback) return only the cached value — the dependency array is discarded.
  • Ref hooks (useRef) are captured as {current: value}.
  • State/reducer hooks (useState, useReducer) are captured as-is.

Hooks use semantic names based on their inferred type: state_0, ref_0, memo_0, unknown_0.

Subpath Exports

  • @domscribe/react/vite — Vite plugin with React adapter
  • @domscribe/react/webpack — Webpack plugin with React adapter
  • @domscribe/react/auto-init — Auto-initialization module

Part of the Domscribe monorepo. License: MIT.