Skip to content

Commit e35c691

Browse files
authored
feat(nextjs): Deprecate typedef for hideSourceMaps (#14594)
1 parent c696aac commit e35c691

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

docs/migration/draft-v9-migration-guide.md

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115
- Deprecated `wrapUseRoutes`. Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
116116
- Deprecated `wrapCreateBrowserRouter`. Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
117117

118+
## `@sentry/nextjs`
119+
120+
- Deprecated `hideSourceMaps`. No replacements. The SDK emits hidden sourcemaps by default.
121+
118122
## `@sentry/opentelemetry`
119123

120124
- Deprecated `generateSpanContextForPropagationContext` in favor of doing this manually - we do not need this export anymore.

packages/nextjs/src/config/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ export type SentryBuildOptions = {
376376
/**
377377
* Use `hidden-source-map` for webpack `devtool` option, which strips the `sourceMappingURL` from the bottom of built
378378
* JS files.
379+
*
380+
* @deprecated This is deprecated. The SDK emits chunks without `sourceMappingURL` for client bundles by default.
379381
*/
382+
// TODO(v9): Remove option
380383
hideSourceMaps?: boolean;
381384

382385
/**

packages/nextjs/test/config/webpack/constructWebpackConfig.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ describe('constructWebpackConfigFunction()', () => {
6868
expect(finalWebpackConfig?.devtool).not.toEqual('source-map');
6969
});
7070

71-
it('allows for the use of `hidden-source-map` as `devtool` value for client-side builds', async () => {
71+
it('uses `hidden-source-map` as `devtool` value for client-side builds', async () => {
7272
const finalClientWebpackConfig = await materializeFinalWebpackConfig({
7373
exportedNextConfig: exportedNextConfig,
7474
incomingWebpackConfig: clientWebpackConfig,
7575
incomingWebpackBuildContext: clientBuildContext,
76-
sentryBuildTimeOptions: { hideSourceMaps: true },
76+
sentryBuildTimeOptions: {},
7777
});
7878

7979
const finalServerWebpackConfig = await materializeFinalWebpackConfig({
8080
exportedNextConfig: exportedNextConfig,
8181
incomingWebpackConfig: serverWebpackConfig,
8282
incomingWebpackBuildContext: serverBuildContext,
83-
sentryBuildTimeOptions: { hideSourceMaps: true },
83+
sentryBuildTimeOptions: {},
8484
});
8585

8686
expect(finalClientWebpackConfig.devtool).toEqual('hidden-source-map');

packages/nextjs/test/types/next.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { NextConfig } from 'next';
33
import { withSentryConfig } from '../../src/config/withSentryConfig';
44

55
const config: NextConfig = {
6-
hideSourceMaps: true,
76
webpack: config => ({
87
...config,
98
module: {

0 commit comments

Comments
 (0)