You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): Include component name annotation plugin with all bundler plugins except esbuild (#469)
* Add hook function for annotate plugin in core index
* Add options and typing
* Add to rollup, vite, webpack
* Allow conditional rendering of options in docs based on supported bundlers
Copy file name to clipboardExpand all lines: packages/bundler-plugin-core/src/types.ts
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -278,6 +278,20 @@ export interface Options {
278
278
excludeReplayWorker?: boolean;
279
279
};
280
280
281
+
/**
282
+
* Options related to react component name annotations.
283
+
* Disabled by default, unless a value is set for this option.
284
+
* When enabled, your app's DOM will automatically be annotated during build-time with their respective component names.
285
+
* 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.
286
+
* Please note that this feature is not currently supported by the esbuild bundler plugins, and will only annotate React components
287
+
*/
288
+
reactComponentAnnotation?: {
289
+
/**
290
+
* Whether the component name annotate plugin should be enabled or not.
291
+
*/
292
+
enabled?: boolean;
293
+
};
294
+
281
295
/**
282
296
* Options that are considered experimental and subject to change.
Copy file name to clipboardExpand all lines: packages/dev-utils/src/generate-documentation-table.ts
+38-7Lines changed: 38 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,11 @@
1
+
typeBundler="webpack"|"vite"|"rollup"|"esbuild";
2
+
1
3
typeOptionDocumentation={
2
4
name: string;
3
5
fullDescription: string;
4
6
type?: string;
5
7
children?: OptionDocumentation[];
8
+
supportedBundlers?: Bundler[];
6
9
};
7
10
8
11
constoptions: OptionDocumentation[]=[
@@ -332,6 +335,24 @@ type IncludeEntry = {
332
335
},
333
336
],
334
337
},
338
+
{
339
+
name: "reactComponentAnnotation",
340
+
fullDescription: `Options related to react component name annotations.
341
+
Disabled by default, unless a value is set for this option.
342
+
When enabled, your app's DOM will automatically be annotated during build-time with their respective component names.
343
+
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.
344
+
Please note that this feature is not currently supported by the esbuild bundler plugins, and will only annotate React components
345
+
`,
346
+
supportedBundlers: ["webpack","vite","rollup"],
347
+
children: [
348
+
{
349
+
name: "enabled",
350
+
type: "boolean",
351
+
fullDescription: "Whether the component name annotate plugin should be enabled or not.",
0 commit comments