diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 1f4983f6abc3..89bafe860cd6 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -85,7 +85,7 @@ "@sentry/opentelemetry": "9.0.0-alpha.2", "@sentry/react": "9.0.0-alpha.2", "@sentry/vercel-edge": "9.0.0-alpha.2", - "@sentry/webpack-plugin": "2.22.7", + "@sentry/webpack-plugin": "3.1.2", "chalk": "3.0.0", "resolve": "1.22.8", "rollup": "3.29.5", diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index 0a188341ce58..a747684cc753 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -363,6 +363,11 @@ export type SentryBuildOptions = { * Whether the component name annotate plugin should be enabled or not. */ 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[]; }; /** diff --git a/packages/nextjs/test/config/webpack/webpackPluginOptions.test.ts b/packages/nextjs/test/config/webpack/webpackPluginOptions.test.ts index c987cda267e4..55f394fd268f 100644 --- a/packages/nextjs/test/config/webpack/webpackPluginOptions.test.ts +++ b/packages/nextjs/test/config/webpack/webpackPluginOptions.test.ts @@ -34,6 +34,7 @@ describe('getWebpackPluginOptions()', () => { telemetry: false, reactComponentAnnotation: { enabled: true, + ignoredComponents: ['myComponent'], }, silent: false, debug: true, @@ -65,6 +66,7 @@ describe('getWebpackPluginOptions()', () => { expect(generatedPluginOptions.org).toBe('my-org'); expect(generatedPluginOptions.project).toBe('my-project'); expect(generatedPluginOptions.reactComponentAnnotation?.enabled).toBe(true); + expect(generatedPluginOptions.reactComponentAnnotation?.ignoredComponents).toStrictEqual(['myComponent']); expect(generatedPluginOptions.release?.create).toBe(false); expect(generatedPluginOptions.release?.deploy?.env).toBe('my-env'); expect(generatedPluginOptions.release?.dist).toBe('my-dist'); @@ -88,6 +90,7 @@ describe('getWebpackPluginOptions()', () => { project: 'my-project', reactComponentAnnotation: { enabled: true, + ignoredComponents: ['myComponent'], }, release: { create: false, diff --git a/yarn.lock b/yarn.lock index 83ff270a83f9..74495b18f457 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6582,6 +6582,11 @@ resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.22.7.tgz#604c7e33d48528a13477e7af597c4d5fca51b8bd" integrity sha512-aa7XKgZMVl6l04NY+3X7BP7yvQ/s8scn8KzQfTLrGRarziTlMGrsCOBQtCNWXOPEbtxAIHpZ9dsrAn5EJSivOQ== +"@sentry/babel-plugin-component-annotate@3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-3.1.2.tgz#5497ca5adbe775955e96c566511a0bed3ab0a3ce" + integrity sha512-5h2WXRJ6swKA0TwxHHryC8M2QyOfS9QhTAL6ElPfkEYe9HhJieXmxsDpyspbqAa26ccnCUcmwE5vL34jAjt4sQ== + "@sentry/bundler-plugin-core@2.22.6": version "2.22.6" resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.22.6.tgz#a1ea1fd43700a3ece9e7db016997e79a2782b87d" @@ -6610,6 +6615,20 @@ magic-string "0.30.8" unplugin "1.0.1" +"@sentry/bundler-plugin-core@3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-3.1.2.tgz#29e4e686c5893b41a0d98a1bef6f0315a610bd59" + integrity sha512-lqOCvmOPzKiQenIMhmm5/mwCntwFy0dPZbVD28Dnr3MXpT1rIBg1HXjfnqQWFlMRbL9haSsWiY/TQyR/6b30YA== + dependencies: + "@babel/core" "^7.18.5" + "@sentry/babel-plugin-component-annotate" "3.1.2" + "@sentry/cli" "2.41.1" + dotenv "^16.3.1" + find-up "^5.0.0" + glob "^9.3.2" + magic-string "0.30.8" + unplugin "1.0.1" + "@sentry/cli-darwin@2.39.1": version "2.39.1" resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.39.1.tgz#75c338a53834b4cf72f57599f4c72ffb36cf0781" @@ -6699,7 +6718,7 @@ "@sentry/cli-win32-i686" "2.39.1" "@sentry/cli-win32-x64" "2.39.1" -"@sentry/cli@^2.36.1", "@sentry/cli@^2.41.1": +"@sentry/cli@2.41.1", "@sentry/cli@^2.36.1", "@sentry/cli@^2.41.1": version "2.41.1" resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.41.1.tgz#a9467ca3ff4acfcdedec1565c9ff726b93758d29" integrity sha512-0GVmDiTV7R1492wkVY4bGcfC0fSmRmQjuxaaPI8CIV9B2VP9pBVCUizi1mevXaaE4I3fM60LI+XYrKFEneuVog== @@ -6743,6 +6762,15 @@ unplugin "1.0.1" uuid "^9.0.0" +"@sentry/webpack-plugin@3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-3.1.2.tgz#e7cf2b10b6d2fb2d6106e692469d02b6ab684bba" + integrity sha512-BTG1m+5c3PcuzjUphB7vQESo91VdT8FT+Ngzbf58OOTtiMDEJ35FtJX1ww36QE7G6vlSpdT/NyZKsY6t+mgJfg== + dependencies: + "@sentry/bundler-plugin-core" "3.1.2" + unplugin "1.0.1" + uuid "^9.0.0" + "@sigstore/protobuf-specs@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz#957cb64ea2f5ce527cc9cf02a096baeb0d2b99b4"