Skip to content

deps: Bump SDK to v8 alpha #9628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/changelog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Fragment, Suspense} from 'react';
import {type Category, type Changelog} from '@prisma/client';
import * as Sentry from '@sentry/nextjs';
import {GET as sessionHandler} from 'app/api/auth/[...nextauth]/route';
import type {Metadata, ResolvingMetadata} from 'next';
import {unstable_cache} from 'next/cache';
Expand Down Expand Up @@ -37,9 +36,6 @@ export async function generateMetadata(
openGraph: {
images: changelog?.image || (await parent).openGraph?.images,
},
other: {
'sentry-trace': `${Sentry.getActiveSpan()?.toTraceparent()}`,
},
};
}

Expand Down
4 changes: 0 additions & 4 deletions app/changelog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Fragment} from 'react';
import * as Sentry from '@sentry/nextjs';
import type {Metadata} from 'next';

import List from 'sentry-docs/components/changelog/list';
Expand Down Expand Up @@ -27,8 +26,5 @@ export function generateMetadata(): Metadata {
alternates: {
canonical: `https://sentry.io/changelog/`,
},
other: {
'sentry-trace': `${Sentry.getActiveSpan()?.toTraceparent()}`,
},
Comment on lines -30 to -32
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To add these back we need getsentry/sentry-javascript#11474 to land.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I generally don't like that we have this because it is bad dogfooding. Our users don't have this either.

};
}
56 changes: 22 additions & 34 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const createMDX = require('@next/mdx');
const remarkPrism = require('remark-prism');
const { codecovWebpackPlugin } = require('@codecov/webpack-plugin');
const {codecovWebpackPlugin} = require('@codecov/webpack-plugin');
const {withSentryConfig} = require('@sentry/nextjs');

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -22,7 +23,7 @@ const nextConfig = {
);

return config;
}
},
};

const withMDX = createMDX({
Expand All @@ -33,41 +34,28 @@ const withMDX = createMDX({

module.exports = withMDX(nextConfig);

// Injected content via Sentry wizard below

const { withSentryConfig } = require('@sentry/nextjs');
module.exports = withSentryConfig(module.exports, {
org: 'sentry',
project: 'docs',

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

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

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

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,
// Hides source maps from generated client bundles
hideSourceMaps: true,

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

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
);
// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry-internal/global-search": "^0.5.10",
"@sentry/nextjs": "^7.109.0",
"@sentry/nextjs": "^8.0.0-alpha.9",
"@types/mdx": "^2.0.9",
"bootstrap": "4.6.1",
"esbuild": "^0.19.8",
Expand Down
16 changes: 0 additions & 16 deletions sentry.edge.config.ts

This file was deleted.

17 changes: 0 additions & 17 deletions sentry.server.config.ts

This file was deleted.

22 changes: 22 additions & 0 deletions src/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import * as Sentry from '@sentry/nextjs';

export function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
Sentry.init({
dsn: 'https://[email protected]/1267915',
tracesSampleRate: 1,
debug: false,
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
spotlight: process.env.NODE_ENV === 'development',
});
}

if (process.env.NEXT_RUNTIME === 'edge') {
Sentry.init({
dsn: 'https://[email protected]/1267915',
tracesSampleRate: 1,
debug: false,
environment: process.env.NODE_ENV === 'development' ? 'development' : undefined,
});
}
}
11 changes: 0 additions & 11 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type {Transaction} from '@sentry/browser';
import qs from 'query-string';

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

export function getCurrentTransaction(): Transaction | undefined {
try {
// getCurrentScope() may not be defined yet, as we are using the Loader Script
// so we guard defensively against all of these existing.
return window.Sentry.getCurrentScope().getTransaction();
} catch {
return undefined;
}
}

export function captureException(exception: unknown): void {
try {
// Sentry may not be available, as we are using the Loader Script
Expand Down
Loading