@sentry/component-annotate-plugin
TypeScript icon, indicating that this package has built-in type declarations

2.11.0 • Public • Published

Sentry

Sentry Component Annotate Plugin (Beta)

npm version npm dm npm dt

This plugin is currently in beta. Please help us improve by reporting any issues or giving us feedback.

A Babel plugin that automatically annotates your output DOM with their respective frontend component names. This will unlock the capability to search for Replays in Sentry by component name, as well as see component names in breadcrumbs and performance monitoring. Please note that your Sentry JavaScript SDK version must be at least 7.91.0 to take advantage of these features. Currently, this plugin only works with React, and will exclusively parse .jsx and .tsx files.

Note

This plugin comes included in Sentry's bundler plugins, alongside many other features to improve your Sentry workflow. It can be downloaded individually, but it is recommended that you install the bundler plugins for your respective bundler, and enable this feature through the config object.

Check out the supported bundler plugin packages for installation instructions:

Installation

Using npm:

npm install @sentry/component-annotate-plugin --save-dev

Using yarn:

yarn add @sentry/component-annotate-plugin --dev

Using pnpm:

pnpm install @sentry/component-annotate-plugin --dev

Example

// babel.config.js

{
  // ... other config above ...

  plugins: [
    // Put this plugin before any other plugins you have that transform JSX code
    ['@sentry/component-annotate-plugin']
  ],
}

Or alternatively, configure the plugin by directly importing it:

// babel.config.js

import {componentNameAnnotatePlugin} from '@sentry/component-annotate-plugin';

{
  // ... other config above ...

  plugins: [
    // Put this plugin before any other plugins you have that transform JSX code
    [componentNameAnnotatePlugin]
  ],
}

More information

Package Sidebar

Install

npm i @sentry/component-annotate-plugin

Weekly Downloads

1,704

Version

2.11.0

License

MIT

Unpacked Size

110 kB

Total Files

9

Last publish

Collaborators

  • benvinegar
  • billyvg
  • mitsuhiko
  • haza
  • jauer
  • sentry-bot
  • evanpurkhiser
  • lynnagara
  • leedongwei
  • markstory
  • zeeg