From bd1e9b92fbbe41d6c8770bd59f2d510a867c2f94 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Tue, 4 Feb 2025 09:53:13 +0100 Subject: [PATCH 1/3] bump webpack plugin --- packages/nextjs/package.json | 2 +- yarn.lock | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index b662693e9682..27d4220a21b8 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -85,7 +85,7 @@ "@sentry/opentelemetry": "9.0.0-alpha.1", "@sentry/react": "9.0.0-alpha.1", "@sentry/vercel-edge": "9.0.0-alpha.1", - "@sentry/webpack-plugin": "2.22.7", + "@sentry/webpack-plugin": "3.1.1", "chalk": "3.0.0", "resolve": "1.22.8", "rollup": "3.29.5", diff --git a/yarn.lock b/yarn.lock index 83ff270a83f9..4dd43e6eb8c8 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.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-3.1.1.tgz#a10f63d642095ffabb42dd30898e3303e2c8c762" + integrity sha512-gp6lFDhrpuVQSQ+N7zKCMJOyYkYoUs4AQlNQctZMRCpp6URGy+eGj5YDPdMNCFylVs8M6t1C6gbBqzrd5sz9Pg== + "@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.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-3.1.1.tgz#330be53ac6e64b93b0d2e8f301612fc0cecb5b30" + integrity sha512-FlYucOSGyujmhA5e1eDhwk+OmuM2RO9yljoBMjEFxtX6gIRioolmPvVa+8FowBMEd594KHPt9MyjOuAwsVIXwg== + dependencies: + "@babel/core" "^7.18.5" + "@sentry/babel-plugin-component-annotate" "3.1.1" + "@sentry/cli" "2.39.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" @@ -6743,6 +6762,15 @@ unplugin "1.0.1" uuid "^9.0.0" +"@sentry/webpack-plugin@3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-3.1.1.tgz#f84ce1b2484f39568fcab2a007567efdca98b421" + integrity sha512-PsHM8q7PfLeToQgNwPwbkySRWCPY59ymuzvG0vE8wceduS6JM6kGbwBU8gRXHn6aOohwpdmwMJuBdBtXQhS6Jg== + dependencies: + "@sentry/bundler-plugin-core" "3.1.1" + 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" From 57062de702386316e44be0ed18f036282be37734 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 6 Feb 2025 12:35:40 +0100 Subject: [PATCH 2/3] bump to 3.1.2 --- packages/nextjs/package.json | 2 +- yarn.lock | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 27d4220a21b8..cb310973645b 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -85,7 +85,7 @@ "@sentry/opentelemetry": "9.0.0-alpha.1", "@sentry/react": "9.0.0-alpha.1", "@sentry/vercel-edge": "9.0.0-alpha.1", - "@sentry/webpack-plugin": "3.1.1", + "@sentry/webpack-plugin": "3.1.2", "chalk": "3.0.0", "resolve": "1.22.8", "rollup": "3.29.5", diff --git a/yarn.lock b/yarn.lock index 4dd43e6eb8c8..74495b18f457 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6582,10 +6582,10 @@ 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.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-3.1.1.tgz#a10f63d642095ffabb42dd30898e3303e2c8c762" - integrity sha512-gp6lFDhrpuVQSQ+N7zKCMJOyYkYoUs4AQlNQctZMRCpp6URGy+eGj5YDPdMNCFylVs8M6t1C6gbBqzrd5sz9Pg== +"@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" @@ -6615,14 +6615,14 @@ magic-string "0.30.8" unplugin "1.0.1" -"@sentry/bundler-plugin-core@3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-3.1.1.tgz#330be53ac6e64b93b0d2e8f301612fc0cecb5b30" - integrity sha512-FlYucOSGyujmhA5e1eDhwk+OmuM2RO9yljoBMjEFxtX6gIRioolmPvVa+8FowBMEd594KHPt9MyjOuAwsVIXwg== +"@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.1" - "@sentry/cli" "2.39.1" + "@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" @@ -6718,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== @@ -6762,12 +6762,12 @@ unplugin "1.0.1" uuid "^9.0.0" -"@sentry/webpack-plugin@3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-3.1.1.tgz#f84ce1b2484f39568fcab2a007567efdca98b421" - integrity sha512-PsHM8q7PfLeToQgNwPwbkySRWCPY59ymuzvG0vE8wceduS6JM6kGbwBU8gRXHn6aOohwpdmwMJuBdBtXQhS6Jg== +"@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.1" + "@sentry/bundler-plugin-core" "3.1.2" unplugin "1.0.1" uuid "^9.0.0" From 0b83a7cfc224a6e2fe970a16dbdc0ad85a542813 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 6 Feb 2025 12:42:34 +0100 Subject: [PATCH 3/3] forward ignoredComponents option for reactComponentAnnotation --- packages/nextjs/src/config/types.ts | 5 +++++ .../nextjs/test/config/webpack/webpackPluginOptions.test.ts | 3 +++ 2 files changed, 8 insertions(+) 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,