Skip to content

ref(nextjs): Remove sentry field in Next.js config as a means of configuration #10839

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

Merged
merged 6 commits into from
Mar 5, 2024

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Feb 28, 2024

As outlined in the migration guide changes withn this PR, we hope to decrease confusion by removing the sentry field on the Next.js config as a means to configuration.

It is replaced by passing an explicit configuration argument to withSentryConfig. This benefits from TS types.

@lforst lforst closed this Feb 28, 2024
@lforst lforst reopened this Feb 28, 2024
@lforst lforst changed the title fix(node): Include falsey variables in local variables integration ref(nextjs): Remove sentry field in Next.js config as a means of configuration Feb 28, 2024
@lforst lforst marked this pull request as ready for review February 28, 2024 13:07
MIGRATION.md Outdated
Comment on lines 169 to 174
{
// Your Sentry Webpack Plugin Options...
},
{
// Your Sentry SDK options...
},
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we keep these two objects separately? Have you thought about moving the webpack plugin options into a sub field of the sentry SDK options? The reasons I'm bringing this up:

  • To me (as an avg SDK user), I probably don't understand what the Sentry webpack plugin does, vs. the SDK.
  • In SvelteKit (granted the situation is different in the sense that we directly initialize a vite plugin), we don't have the separation but the Vite plugin options are contained in a sourcemapsUploadOptions field within the plugin factory function options

i don't have a super strong opinion here, so feel free to disregard but I'm not sure if the separation makes sense. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, eventually I would like to merge the two and I am probably gonna do that within v8 even. I just wanted to get rid of the sentry property as a first step. This will obviously require me to update the migration guide afterwards again, but I think it is gonna be fine.

The naming is gonna be a bit tricky because in the future (and even now) the webpack plugin can do more than just source maps: release management, commits, component-name injections, ... I am likely gonna expose multiple different options that all map to the plugin's options internally somehow.

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, thx! Agree on the naming being tricky b/c of the multiple things.

@Lms24
Copy link
Member

Lms24 commented Feb 28, 2024

Regardless of my comment btw, I think this is a change into the right direction. Much better than before!

Copy link
Contributor

github-actions bot commented Mar 4, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 77.15 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.38 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.31 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 61.93 KB (0%)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.65 KB (0%)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 32.65 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.01 KB (0%)
@sentry/browser - Webpack (gzipped) 22.25 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.3 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 66.95 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 32.83 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 23.82 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 210.15 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 99.01 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 71.02 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 35.92 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.66 KB (0%)
@sentry/react - Webpack (gzipped) 22.28 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 85.11 KB (0%)
@sentry/nextjs Client - Webpack (gzipped) 49.51 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 17.1 KB (0%)

MIGRATION.md Outdated
@@ -620,6 +579,47 @@ The SDK no longer filters out health check transactions by default. Instead, the
by the Sentry backend by default. You can disable dropping them in your Sentry project settings. If you still want to
drop specific transactions within the SDK you can either use the `ignoreTransactions` SDK option.

## Next.js SDK Changes

### Removal of the `sentry` property in your Next.js options
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not strictly deprecated but we haven't been recommending this way of setting up the SDK for longer than a year.

I moved the section! Thanks!

@lforst lforst requested review from AbhiPrasad and Lms24 March 5, 2024 13:47
@lforst lforst merged commit a818271 into develop Mar 5, 2024
@lforst lforst deleted the lforst-rm-sentry-nextjs-prop branch March 5, 2024 16:16
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.

3 participants