Skip to content

Commit 487810a

Browse files
authored
ref(nextjs): Move autoWrapDataFetchers option into experiments object (#5540)
This nests the new `autoWrapDataFetchers` option in `next.config.js` in an `experiments` object, to make it clear that it's not necessarily a stable option yet.
1 parent 29e0b33 commit 487810a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ export type UserSentryOptions = {
5050
// up uploading too many files, which is why this defaults to `false`.
5151
widenClientFileUpload?: boolean;
5252

53-
// Automatically wrap `getServerSideProps`, `getStaticProps`, and `getStaticPaths` in order to instrument them for
54-
// tracing.
55-
autoWrapDataFetchers?: boolean;
53+
experiments?: {
54+
// Automatically wrap `getServerSideProps`, `getStaticProps`, and `getStaticPaths` in order to instrument them for
55+
// tracing.
56+
autoWrapDataFetchers?: boolean;
57+
};
5658
};
5759

5860
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
@@ -77,7 +77,7 @@ export function constructWebpackConfigFunction(
7777
],
7878
};
7979

80-
if (userSentryOptions.autoWrapDataFetchers) {
80+
if (userSentryOptions.experiments?.autoWrapDataFetchers) {
8181
newConfig.module.rules.push({
8282
test: pageRegex,
8383
use: [

0 commit comments

Comments
 (0)