From 3bdfd86ebf8bbaeb1ae093e55802d278b4d0795c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:40:28 +0000 Subject: [PATCH 1/4] build(deps): bump @sentry/browser from 7.109.0 to 8.34.0 Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 7.109.0 to 8.34.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/8.34.0/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/7.109.0...8.34.0) --- updated-dependencies: - dependency-name: "@sentry/browser" dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/lib-classifier/package.json | 2 +- yarn.lock | 73 +++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/packages/lib-classifier/package.json b/packages/lib-classifier/package.json index d8dface543..ab2a97b2a5 100644 --- a/packages/lib-classifier/package.json +++ b/packages/lib-classifier/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@babel/runtime": "~7.25.6", - "@sentry/browser": "~7.109.0", + "@sentry/browser": "~8.34.0", "@visx/axis": "~3.10.1", "@visx/brush": "~3.6.1", "@visx/event": "~3.3.0", diff --git a/yarn.lock b/yarn.lock index 09c8e67fd7..48e6182084 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2867,6 +2867,15 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz#5f1b518ec5fa54437c0b7c4a821546c64fed6922" integrity sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA== +"@sentry-internal/browser-utils@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.34.0.tgz#36a50d503ad4ad51fce22e80670f8fd6fd195a27" + integrity sha512-4AcYOzPzD1tL5eSRQ/GpKv5enquZf4dMVUez99/Bh3va8qiJrNP55AcM7UzZ7WZLTqKygIYruJTU5Zu2SpEAPQ== + dependencies: + "@sentry/core" "8.34.0" + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + "@sentry-internal/feedback@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.109.0.tgz#4657d7f36a1de3be466f42735d295e212b7eca11" @@ -2876,6 +2885,15 @@ "@sentry/types" "7.109.0" "@sentry/utils" "7.109.0" +"@sentry-internal/feedback@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.34.0.tgz#ff0db65c36f13665db99e3e22f2032bfdda98731" + integrity sha512-aYSM2KPUs0FLPxxbJCFSwCYG70VMzlT04xepD1Y/tTlPPOja/02tSv2tyOdZbv8Uw7xslZs3/8Lhj74oYcTBxw== + dependencies: + "@sentry/core" "8.34.0" + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + "@sentry-internal/replay-canvas@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.109.0.tgz#9a00857994a9487428296feed4a9ddf2d62bab84" @@ -2886,6 +2904,26 @@ "@sentry/types" "7.109.0" "@sentry/utils" "7.109.0" +"@sentry-internal/replay-canvas@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.34.0.tgz#10acadaef74e982dee2b9842a3eb6fec73f032ed" + integrity sha512-x8KhZcCDpbKHqFOykYXiamX6x0LRxv6N1OJHoH+XCrMtiDBZr4Yo30d/MaS6rjmKGMtSRij30v+Uq+YWIgxUrg== + dependencies: + "@sentry-internal/replay" "8.34.0" + "@sentry/core" "8.34.0" + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + +"@sentry-internal/replay@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.34.0.tgz#b730919a174cc5ae8a77f79fb24a5ffb18e44db5" + integrity sha512-EoMh9NYljNewZK1quY23YILgtNdGgrkzJ9TPsj6jXUG0LZ0Q7N7eFWd0xOEDBvFxrmI3cSXF1i4d1sBb+eyKRw== + dependencies: + "@sentry-internal/browser-utils" "8.34.0" + "@sentry/core" "8.34.0" + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + "@sentry-internal/tracing@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.109.0.tgz#3effaa132c41a65378fa98146aea61228d528953" @@ -2895,7 +2933,7 @@ "@sentry/types" "7.109.0" "@sentry/utils" "7.109.0" -"@sentry/browser@7.109.0", "@sentry/browser@~7.109.0": +"@sentry/browser@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.109.0.tgz#13b2623f43047f292cf7d6070128a7501e008693" integrity sha512-yx+OFG+Ab9qUDDgV9ZDv8M9O9Mqr0fjKta/LMlWALYLjzkMvxsPlRPFj7oMBlHqOTVLDeg7lFYmsA8wyWQ8Z8g== @@ -2908,6 +2946,19 @@ "@sentry/types" "7.109.0" "@sentry/utils" "7.109.0" +"@sentry/browser@~8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.34.0.tgz#d2dfc2dbbfa9132d5c3e951f0a4b467805bc4c75" + integrity sha512-3HHG2NXxzHq1lVmDy2uRjYjGNf9NsJsTPlOC70vbQdOb+S49EdH/XMPy+J3ruIoyv6Cu0LwvA6bMOM6rHZOgNQ== + dependencies: + "@sentry-internal/browser-utils" "8.34.0" + "@sentry-internal/feedback" "8.34.0" + "@sentry-internal/replay" "8.34.0" + "@sentry-internal/replay-canvas" "8.34.0" + "@sentry/core" "8.34.0" + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + "@sentry/cli@^1.77.1": version "1.77.1" resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.77.1.tgz#ebcf884712ef6c3c75443f491ec16f6a22148aec" @@ -2928,6 +2979,14 @@ "@sentry/types" "7.109.0" "@sentry/utils" "7.109.0" +"@sentry/core@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.34.0.tgz#92efe1cc8ced843beee636c344e66086d8915563" + integrity sha512-adrXCTK/zsg5pJ67lgtZqdqHvyx6etMjQW3P82NgWdj83c8fb+zH+K79Z47pD4zQjX0ou2Ws5nwwi4wJbz4bfA== + dependencies: + "@sentry/types" "8.34.0" + "@sentry/utils" "8.34.0" + "@sentry/integrations@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.109.0.tgz#36f8233f55e6b0d4bdb7e7466714575a1d65f3cf" @@ -2993,6 +3052,11 @@ resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.109.0.tgz#d8778358114ed05be734661cc9e1e261f4494947" integrity sha512-egCBnDv3YpVFoNzRLdP0soVrxVLCQ+rovREKJ1sw3rA2/MFH9WJ+DZZexsX89yeAFzy1IFsCp7/dEqudusml6g== +"@sentry/types@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.34.0.tgz#b02da72d1be67df5246aa9a97ca661ee71569372" + integrity sha512-zLRc60CzohGCo6zNsNeQ9JF3SiEeRE4aDCP9fDDdIVCOKovS+mn1rtSip0qd0Vp2fidOu0+2yY0ALCz1A3PJSQ== + "@sentry/utils@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.109.0.tgz#7078e1400197abc1b0c436679bef980639500a86" @@ -3000,6 +3064,13 @@ dependencies: "@sentry/types" "7.109.0" +"@sentry/utils@8.34.0": + version "8.34.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.34.0.tgz#5ba543381a9de0ada1196df1fc5cde3b891de41e" + integrity sha512-W1KoRlFUjprlh3t86DZPFxLfM6mzjRzshVfMY7vRlJFymBelJsnJ3A1lPeBZM9nCraOSiw6GtOWu6k5BAkiGIg== + dependencies: + "@sentry/types" "8.34.0" + "@sentry/vercel-edge@7.109.0": version "7.109.0" resolved "https://registry.yarnpkg.com/@sentry/vercel-edge/-/vercel-edge-7.109.0.tgz#4e3e1fd5b05be3a59ddc6d6b40407dd929f75b3d" From afa09d28b48560ad02277f6abcec41292aa97d90 Mon Sep 17 00:00:00 2001 From: Delilah <23665803+goplayoutside3@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:31:31 -0500 Subject: [PATCH 2/4] migrate @sentry/nextjs to v8 --- packages/app-project/instrumentation.js | 9 + packages/app-project/next.config.js | 11 +- packages/app-project/package.json | 2 +- packages/app-project/pages/_document.js | 40 - packages/app-project/sentry.client.config.js | 2 +- packages/app-project/sentry.server.config.js | 1 - packages/app-project/server/server.js | 4 - yarn.lock | 1031 +++++++++++++++--- 8 files changed, 871 insertions(+), 229 deletions(-) create mode 100644 packages/app-project/instrumentation.js diff --git a/packages/app-project/instrumentation.js b/packages/app-project/instrumentation.js new file mode 100644 index 0000000000..5316f8eb27 --- /dev/null +++ b/packages/app-project/instrumentation.js @@ -0,0 +1,9 @@ +export async function register() { + if (process.env.NEXT_RUNTIME === 'nodejs') { + await import('./sentry.server.config') + } + + if (process.env.NEXT_RUNTIME === 'edge') { + await import('./sentry.edge.config') + } +} diff --git a/packages/app-project/next.config.js b/packages/app-project/next.config.js index f08d2f91e1..d047f5810b 100644 --- a/packages/app-project/next.config.js +++ b/packages/app-project/next.config.js @@ -57,6 +57,7 @@ const nextConfig = { experimental: { forceSwcTransforms: true, + instrumentationHook: true, optimizePackageImports: ['@zooniverse/react-components', 'grommet', 'grommet-icons'] }, @@ -96,10 +97,6 @@ const nextConfig = { ] }, - sentry: { - hideSourceMaps: true - }, - webpack: (config, options) => { config.resolve = { ...config.resolve, @@ -119,7 +116,11 @@ const nextConfig = { module.exports = million.next( withSentryConfig(nextConfig, { org: 'zooniverse-27', - project: 'fem-app-project' + project: 'fem-app-project', + sourcemaps: { + disable: true, + }, + telemetry: false }), { auto: true diff --git a/packages/app-project/package.json b/packages/app-project/package.json index 530f2e3b46..52d1b96b11 100644 --- a/packages/app-project/package.json +++ b/packages/app-project/package.json @@ -17,7 +17,7 @@ "build-storybook": "storybook build" }, "dependencies": { - "@sentry/nextjs": "~7.109.0", + "@sentry/nextjs": "8.34.0", "@sindresorhus/string-hash": "~1.2.0", "@visx/axis": "~3.10.1", "@visx/group": "~3.3.0", diff --git a/packages/app-project/pages/_document.js b/packages/app-project/pages/_document.js index b1def65955..ee079929ec 100644 --- a/packages/app-project/pages/_document.js +++ b/packages/app-project/pages/_document.js @@ -8,37 +8,6 @@ const GA_TRACKING_ID = 'GTM-WDW6V4' const GA_TRACKING_SCRIPT = ` (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${GA_TRACKING_ID}'); ` - -const ERROR_LOGGING_SCRIPT = ` - function setUpLogging() { - Sentry.init({ - dsn: '${process.env.SENTRY_PROJECT_DSN}', - environment: '${process.env.APP_ENV}', - release: '${process.env.COMMIT_ID}', - integrations: [new Sentry.BrowserTracing()], - tracesSampleRate: 1.0 - }); - console.log('Sentry init: ${process.env.SENTRY_PROJECT_DSN} ${process.env.APP_ENV}'); - } - - function onError(e) { - const error = new Error('External script failed to load'); - Sentry.withScope((scope) => { - scope.setTag('ScriptError', 'loadFailed'); - scope.setExtra('scriptSrc', e.srcElement.src); - Sentry.captureException(error); - }); - console.log('errored', e.srcElement.src); - }; - - const scripts = document.querySelectorAll('script'); - scripts.forEach(scriptNode => { - scriptNode.onload = e => console.log('loaded', e.srcElement.src); - scriptNode.onerror = onError; - }); - const sentryScript = document.querySelector('#sentryScript'); - sentryScript.onload = setUpLogging; -` const isProduction = process.env.NODE_ENV === 'production' process.on('unhandledRejection', logToSentry) @@ -77,14 +46,6 @@ export default class MyDocument extends Document { {isProduction && ( {isProduction && ( @@ -100,7 +61,6 @@ export default class MyDocument extends Document { )}
-