Skip to content
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

ref(nextjs): Stop setting redundant productionBrowserSourceMaps in config #3765

Merged

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Jun 29, 2021

Currently, withSentryConfig both sets productionBrowserSourceMaps to true in the main nextjs config and sets devtool to source-map in the webpack config.

It turns out, though, that the only thing the former change does is cause nextjs to make the latter change itself. (All other references to productionBrowserSourceMaps in the nextjs code are merely type annotations or instances of passing the value from one function to another. The linked code is the only place that value is actually used.) Therefore, since we're making the devtool config change ourselves, the productionBrowserSourceMaps config change is redundant, and can be removed.

(Of the two config changes, we want to remove this one and not the devtool one, since we want sourcemaps for both server and client builds. devtool affects both, whereas productionBrowserSourceMaps (as the name implies) only affects the client build.)

@github-actions
Copy link
Contributor

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 21.39 KB (-0.01% 🔽)
@sentry/browser - Webpack 22.4 KB (0%)
@sentry/react - Webpack 22.44 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.88 KB (-0.01% 🔽)

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

👍

@lobsterkatie lobsterkatie merged commit a732ae8 into master Jun 29, 2021
@lobsterkatie lobsterkatie deleted the kmclb-nextjs-remove-productionBrowserSourceMaps branch June 29, 2021 15:55
1999 added a commit to 1999/sentry-javascript that referenced this pull request Jun 30, 2021
…transport

* upstream/master:
  fix(tracing): Add check for document.scripts in metrics (getsentry#3766)
  ref(nextjs): Stop setting redundant `productionBrowserSourceMaps` in config (getsentry#3765)
  test: Ensure withScope and run bubble up exceptions (getsentry#3764)
  ref(gatsby): Default release to empty string (getsentry#3759)
  fix(nextjs): Make `withSentryConfig` return type match given config type (getsentry#3760)
  misc: Fix typos (getsentry#3763)
  fix(node): Enable autoSessionTracking correctly (getsentry#3758)
  release: 6.8.0
  meta: 6.8.0 changelog
  feat: Enable serialization of multiple DOM attributes for breadcrumbs. (getsentry#3755)
  ref: Leave only valid buffer implementation (getsentry#3744)
lobsterkatie added a commit to getsentry/sentry-docs that referenced this pull request Jul 6, 2021
Nothing major here, mostly just carryover from comments on #3677 which didn't get in before it was merged.

- Use `devtool` in all snippets so that sourcemaps are generated correctly
- Fix setting `devtool` in nextjs (set it on `config`)
- Remove stray `configureWebpack` wrapper in two snippets
- Remove `productionBrowserSourceMaps` from nextjs config since [we no longer use it](getsentry/sentry-javascript#3765)
- Remove `SentryWebpackPluginOptions` from nextjs snippet not using plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants