Skip to content

Commit b72c299

Browse files
committed
ref: rename debugLogging to removeDebugLogging for explicitness
1 parent bdb4885 commit b72c299

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export type SentryBuildWebpackOptions = {
111111
/**
112112
* Tree shakes Sentry SDK logger statements from the bundle. Note that this doesn't affect Sentry Logs.
113113
*/
114-
debugLogging?: boolean;
114+
removeDebugLogging?: boolean;
115115
};
116116

117117
/**
@@ -535,7 +535,7 @@ export type SentryBuildOptions = {
535535
/**
536536
* Tree shakes Sentry SDK logger statements from the bundle.
537537
*
538-
* @deprecated Use `webpack.treeshake.debugLogging` instead.
538+
* @deprecated Use `webpack.treeshake.removeDebugLogging` instead.
539539
*/
540540
disableLogger?: boolean;
541541

packages/nextjs/src/config/webpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ export function constructWebpackConfigFunction({
431431
}
432432
}
433433

434-
if (userSentryOptions.webpack?.treeshake?.debugLogging) {
434+
if (userSentryOptions.webpack?.treeshake?.removeDebugLogging) {
435435
newConfig.plugins = newConfig.plugins || [];
436436
newConfig.plugins.push(
437437
new buildContext.webpack.DefinePlugin({

packages/nextjs/src/config/withSentryConfig.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ function migrateDeprecatedWebpackOptions(userSentryOptions: SentryBuildOptions):
162162
deprecatedMessage('disableSentryWebpackConfig', 'webpack.disableSentryConfig'),
163163
);
164164

165-
// Handle treeshake.debugLogging specially since it's nested
165+
// Handle treeshake.removeDebugLogging specially since it's nested
166166
if (userSentryOptions.disableLogger !== undefined) {
167167
webpack.treeshake = webpack.treeshake || {};
168-
webpack.treeshake.debugLogging = withDeprecatedFallback(
169-
webpack.treeshake.debugLogging,
168+
webpack.treeshake.removeDebugLogging = withDeprecatedFallback(
169+
webpack.treeshake.removeDebugLogging,
170170
userSentryOptions.disableLogger,
171-
deprecatedMessage('disableLogger', 'webpack.treeshake.debugLogging'),
171+
deprecatedMessage('disableLogger', 'webpack.treeshake.removeDebugLogging'),
172172
);
173173
}
174174

packages/nextjs/test/config/withSentryConfig.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,14 @@ describe('withSentryConfig', () => {
334334
expect(finalConfig.webpack).toBe(originalWebpackFunction);
335335
});
336336

337-
it('merges webpack.treeshake.debugLogging with deprecated disableLogger', () => {
337+
it('merges webpack.treeshake.removeDebugLogging with deprecated disableLogger', () => {
338338
delete process.env.TURBOPACK;
339339

340-
// New webpack.treeshake.debugLogging should map to disableLogger internally
340+
// New webpack.treeshake.removeDebugLogging should map to disableLogger internally
341341
const sentryOptionsNew = {
342342
webpack: {
343343
treeshake: {
344-
debugLogging: true,
344+
removeDebugLogging: true,
345345
},
346346
},
347347
};
@@ -386,7 +386,7 @@ describe('withSentryConfig', () => {
386386
expect.stringContaining('[@sentry/nextjs] DEPRECATION WARNING: disableLogger is deprecated'),
387387
);
388388
expect(consoleWarnSpy).toHaveBeenCalledWith(
389-
expect.stringContaining('Use webpack.treeshake.debugLogging instead'),
389+
expect.stringContaining('Use webpack.treeshake.removeDebugLogging instead'),
390390
);
391391
});
392392

@@ -396,7 +396,7 @@ describe('withSentryConfig', () => {
396396
const sentryOptions = {
397397
webpack: {
398398
treeshake: {
399-
debugLogging: true,
399+
removeDebugLogging: true,
400400
},
401401
},
402402
};
@@ -413,7 +413,7 @@ describe('withSentryConfig', () => {
413413
disableLogger: true, // deprecated
414414
webpack: {
415415
treeshake: {
416-
debugLogging: false, // new path takes precedence
416+
removeDebugLogging: false, // new path takes precedence
417417
},
418418
},
419419
};

0 commit comments

Comments
 (0)