Skip to content

feat(nextjs): Unify reactComponentAnnotation across webpack and Turbopack - #23268

Merged
chargome merged 1 commit into
developfrom
charlygomez/unify-react-component-annotation
Aug 13, 2026
Merged

feat(nextjs): Unify reactComponentAnnotation across webpack and Turbopack#23268
chargome merged 1 commit into
developfrom
charlygomez/unify-react-component-annotation

Conversation

@chargome

@chargomechargome commented Aug 11, 2026

Copy link
Copy Markdown
Member

Unifies React component annotation into a single top-level reactComponentAnnotation for both webpack and Turbopack, mirroring applicationKey (#20794).

Removing the top-level option in #23221 was an oversight - it was deprecated back when annotation was webpack-only, but Turbopack supports it now.

webpack.reactComponentAnnotation and _experimental.turbopackReactComponentAnnotation are deprecated but still work, removal in v12. We only moved users onto the webpack one in 10.30.0, so removing it now would mean two migrations in a row.

Also warns when annotation is enabled on Turbopack + Next.js < 16, where it previously no-opped
silently.

…pack
Add a top-level `reactComponentAnnotation` option that applies to both webpack
and Turbopack builds, mirroring `applicationKey`. Both bundler paths already
call the same `createComponentNameAnnotateHooks`, so the split was historical.
Deprecate `webpack.reactComponentAnnotation` and
`_experimental.turbopackReactComponentAnnotation` without removing them, since
10.30.0 only recently moved users onto the webpack-scoped option. Bundler-scoped
options win over the top-level one, matching current behaviour.
Also warn when annotation is enabled on Turbopack with Next.js < 16, where it
previously no-opped silently.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargomechargome self-assigned this Aug 11, 2026
@chargome

Copy link
Copy Markdown
MemberAuthor

bugbot run

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit affa875. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser30.26 kB--
@sentry/browser - with treeshaking flags28.44 kB--
@sentry/browser - with treeshaking flags tracing without tracing26.78 kB--
@sentry/browser (incl. Tracing)48.5 kB--
@sentry/browser (incl. Tracing + Span Streaming)48.52 kB--
@sentry/browser (incl. Tracing, Profiling)51.4 kB--
@sentry/browser (incl. Tracing, Replay)87.94 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags77.3 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)92.65 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)105.32 kB--
@sentry/browser (incl. Feedback)47.58 kB--
@sentry/browser (incl. sendFeedback)35.08 kB--
@sentry/browser (incl. FeedbackAsync)40.23 kB--
@sentry/browser (incl. Metrics)31.29 kB--
@sentry/browser (incl. Logs)31.55 kB--
@sentry/browser (incl. Metrics & Logs)32.24 kB--
@sentry/react32.06 kB--
@sentry/react (incl. Tracing)50.69 kB--
@sentry/vue35.32 kB--
@sentry/vue (incl. Tracing)50.45 kB--
@sentry/svelte30.28 kB--
CDN Bundle31.52 kB--
CDN Bundle (incl. Tracing)48.78 kB--
CDN Bundle (incl. Logs, Metrics)33.75 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)50.76 kB--
CDN Bundle (incl. Replay, Logs, Metrics)74.3 kB--
CDN Bundle (incl. Tracing, Replay)86.38 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)88.29 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)92.08 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)94.1 kB--
CDN Bundle - uncompressed93.59 kB--
CDN Bundle (incl. Tracing) - uncompressed146.5 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed100.06 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed152.36 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed228.98 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed265.75 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed271.6 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed279.45 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed285.28 kB--
@sentry/nextjs (client)53.24 kB--
@sentry/sveltekit (client)48.91 kB--
@sentry/core/server65.45 kB--
@sentry/core/browser51.79 kB--
@sentry/node117.89 kB-0.01%-1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection)0 Baddedadded
@sentry/node - without tracing82.05 kB-0.01%-2 B 🔽
@sentry/aws-serverless91.42 kB--
@sentry/cloudflare (withSentry) - minified214.07 kB--
@sentry/cloudflare (withSentry)528.94 kB--

View base workflow run

@chargome
chargome marked this pull request as ready for review August 11, 2026 09:51
@chargome
chargome requested a review from a team as a code ownerAugust 11, 2026 09:51
@chargome
chargome requested review from logaretm, mydea, nicohrubec and s1gr1d and removed request for a team and s1gr1dAugust 11, 2026 09:51
Comment on lines 170 to 175
enabled?: boolean;

/**
* A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
*/
ignoredComponents?: string[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the @deprecated note needs to be added to each option within reactComponentAnnotation as well so the code editors can pick this up properly (same for the other occurrence)

@chargome
chargome merged commit 324f542 into developAug 13, 2026
81 checks passed
@chargome
chargome deleted the charlygomez/unify-react-component-annotation branch August 13, 2026 08:03
chargome added a commit that referenced this pull request Aug 13, 2026
…on options (#23394)
Follow-up to #23268. Adds `@deprecated` to the individual properties
inside
`webpack.reactComponentAnnotation` and
`_experimental.turbopackReactComponentAnnotation`, so hovering
`enabled` or `ignoredComponents` surfaces the notice too, not just the
parent option.
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@chargome@s1gr1d