Skip to content

Commit ba5dac1

Browse files
Luca ForstnerHazAT
andauthored
deps: Bump SDK to v8 alpha (#9628)
Co-authored-by: Daniel Griesser <[email protected]>
1 parent e28aa35 commit ba5dac1

File tree

10 files changed

+1192
-254
lines changed

10 files changed

+1192
-254
lines changed

app/changelog/[slug]/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {Fragment, Suspense} from 'react';
22
import {type Category, type Changelog} from '@prisma/client';
3-
import * as Sentry from '@sentry/nextjs';
43
import {GET as sessionHandler} from 'app/api/auth/[...nextauth]/route';
54
import type {Metadata, ResolvingMetadata} from 'next';
65
import {unstable_cache} from 'next/cache';
@@ -37,9 +36,6 @@ export async function generateMetadata(
3736
openGraph: {
3837
images: changelog?.image || (await parent).openGraph?.images,
3938
},
40-
other: {
41-
'sentry-trace': `${Sentry.getActiveSpan()?.toTraceparent()}`,
42-
},
4339
};
4440
}
4541

app/changelog/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Fragment} from 'react';
2-
import * as Sentry from '@sentry/nextjs';
32
import type {Metadata} from 'next';
43

54
import List from 'sentry-docs/components/changelog/list';
@@ -27,8 +26,5 @@ export function generateMetadata(): Metadata {
2726
alternates: {
2827
canonical: `https://sentry.io/changelog/`,
2928
},
30-
other: {
31-
'sentry-trace': `${Sentry.getActiveSpan()?.toTraceparent()}`,
32-
},
3329
};
3430
}

next.config.js

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const createMDX = require('@next/mdx');
22
const remarkPrism = require('remark-prism');
3-
const { codecovWebpackPlugin } = require('@codecov/webpack-plugin');
3+
const {codecovWebpackPlugin} = require('@codecov/webpack-plugin');
4+
const {withSentryConfig} = require('@sentry/nextjs');
45

56
/** @type {import('next').NextConfig} */
67
const nextConfig = {
@@ -22,7 +23,7 @@ const nextConfig = {
2223
);
2324

2425
return config;
25-
}
26+
},
2627
};
2728

2829
const withMDX = createMDX({
@@ -33,41 +34,28 @@ const withMDX = createMDX({
3334

3435
module.exports = withMDX(nextConfig);
3536

36-
// Injected content via Sentry wizard below
37-
38-
const { withSentryConfig } = require('@sentry/nextjs');
37+
module.exports = withSentryConfig(module.exports, {
38+
org: 'sentry',
39+
project: 'docs',
3940

40-
module.exports = withSentryConfig(
41-
module.exports,
42-
{
43-
// For all available options, see:
44-
// https://github.com/getsentry/sentry-webpack-plugin#options
41+
// Suppresses source map uploading logs during build
42+
silent: !process.env.CI,
4543

46-
// Suppresses source map uploading logs during build
47-
silent: true,
48-
org: 'sentry',
49-
project: 'docs',
50-
},
51-
{
52-
// For all available options, see:
53-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
44+
// Upload a larger set of source maps for prettier stack traces (increases build time)
45+
widenClientFileUpload: true,
5446

55-
// Upload a larger set of source maps for prettier stack traces (increases build time)
56-
widenClientFileUpload: true,
47+
// Transpiles SDK to be compatible with IE11 (increases bundle size)
48+
transpileClientSDK: true,
5749

58-
// Transpiles SDK to be compatible with IE11 (increases bundle size)
59-
transpileClientSDK: true,
50+
// Hides source maps from generated client bundles
51+
hideSourceMaps: true,
6052

61-
// Hides source maps from generated client bundles
62-
hideSourceMaps: true,
53+
// Automatically tree-shake Sentry logger statements to reduce bundle size
54+
disableLogger: true,
6355

64-
// Automatically tree-shake Sentry logger statements to reduce bundle size
65-
disableLogger: true,
66-
67-
// Enables automatic instrumentation of Vercel Cron Monitors.
68-
// See the following for more information:
69-
// https://docs.sentry.io/product/crons/
70-
// https://vercel.com/docs/cron-jobs
71-
automaticVercelMonitors: true,
72-
}
73-
);
56+
// Enables automatic instrumentation of Vercel Cron Monitors.
57+
// See the following for more information:
58+
// https://docs.sentry.io/product/crons/
59+
// https://vercel.com/docs/cron-jobs
60+
automaticVercelMonitors: true,
61+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@radix-ui/react-toolbar": "^1.0.4",
4242
"@radix-ui/themes": "^2.0.3",
4343
"@sentry-internal/global-search": "^0.5.10",
44-
"@sentry/nextjs": "^7.109.0",
44+
"@sentry/nextjs": "^8.0.0-alpha.9",
4545
"@types/mdx": "^2.0.9",
4646
"bootstrap": "4.6.1",
4747
"esbuild": "^0.19.8",

sentry.client.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as Sentry from '@sentry/nextjs';
66
import * as Spotlight from '@spotlightjs/spotlight';
77

88
Sentry.init({
9-
dsn: 'https://[email protected]/1267915',
9+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
1010

1111
// Adjust this value in production, or use tracesSampler for greater control
1212
tracesSampleRate: 1,

sentry.edge.config.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

sentry.server.config.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/instrumentation.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as Sentry from '@sentry/nextjs';
2+
3+
export function register() {
4+
if (process.env.NEXT_RUNTIME === 'nodejs') {
5+
Sentry.init({
6+
dsn: process.env.SENTRY_DSN,
7+
tracesSampleRate: 1,
8+
debug: false,
9+
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
10+
spotlight: process.env.NODE_ENV === 'development',
11+
});
12+
}
13+
14+
if (process.env.NEXT_RUNTIME === 'edge') {
15+
Sentry.init({
16+
dsn: process.env.SENTRY_DSN,
17+
tracesSampleRate: 1,
18+
debug: false,
19+
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
20+
});
21+
}
22+
}

src/utils.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type {Transaction} from '@sentry/browser';
21
import qs from 'query-string';
32

43
export function sortBy<A>(arr: A[], comp: (v: A) => number): A[] {
@@ -70,16 +69,6 @@ export const marketingUrlParams = (): URLQueryObject => {
7069
return marketingParams;
7170
};
7271

73-
export function getCurrentTransaction(): Transaction | undefined {
74-
try {
75-
// getCurrentScope() may not be defined yet, as we are using the Loader Script
76-
// so we guard defensively against all of these existing.
77-
return window.Sentry.getCurrentScope().getTransaction();
78-
} catch {
79-
return undefined;
80-
}
81-
}
82-
8372
export function captureException(exception: unknown): void {
8473
try {
8574
// Sentry may not be available, as we are using the Loader Script

0 commit comments

Comments
 (0)