Skip to content

Commit de0f3e8

Browse files
author
Luca Forstner
authored
feat(nextjs): Promote option to automatically wrap data fetchers and API routes to non-experimental (#5793)
1 parent 1f3da81 commit de0f3e8

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ export type UserSentryOptions = {
5555
// up uploading too many files, which is why this defaults to `false`.
5656
widenClientFileUpload?: boolean;
5757

58-
experiments?: {
59-
// Automatically wrap `getInitialProps`, `getServerSideProps`, and `getStaticProps` in order to instrument them for tracing.
60-
autoWrapDataFetchers?: boolean;
61-
};
58+
// Automatically instrument Next.js data fetching methods and Next.js API routes
59+
autoInstrumentServerFunctions?: boolean;
6260
};
6361

6462
export type NextConfigFunction = (phase: string, defaults: { defaultConfig: NextConfigObject }) => NextConfigObject;

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function constructWebpackConfigFunction(
7979
],
8080
};
8181

82-
if (userSentryOptions.experiments?.autoWrapDataFetchers) {
82+
if (userSentryOptions.autoInstrumentServerFunctions) {
8383
const pagesDir = newConfig.resolve?.alias?.['private-next-pages'] as string;
8484

8585
newConfig.module.rules.push({

packages/nextjs/test/integration/next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const moduleExports = {
55
ignoreDuringBuilds: true,
66
},
77
sentry: {
8-
experiments: { autoWrapDataFetchers: true },
8+
autoInstrumentServerFunctions: true,
99
// Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts`
1010
// TODO (v8): This can come out in v8, because this option will get a default value
1111
hideSourceMaps: false,

packages/nextjs/test/integration/next10.config.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const moduleExports = {
66
webpack5: %RUN_WEBPACK_5%,
77
},
88
sentry: {
9-
experiments: { autoWrapDataFetchers: true },
9+
autoInstrumentServerFunctions: true,
1010
// Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts`
1111
// TODO (v8): This can come out in v8, because this option will get a default value
1212
hideSourceMaps: false,

packages/nextjs/test/integration/next11.config.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const moduleExports = {
77
ignoreDuringBuilds: true,
88
},
99
sentry: {
10-
experiments: { autoWrapDataFetchers: true },
10+
autoInstrumentServerFunctions: true,
1111
// Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts`
1212
// TODO (v8): This can come out in v8, because this option will get a default value
1313
hideSourceMaps: false,

0 commit comments

Comments
 (0)