-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
sentry
field in Next.js config as a means of configuration
MIGRATION.md
Outdated
{ | ||
// Your Sentry Webpack Plugin Options... | ||
}, | ||
{ | ||
// Your Sentry SDK options... | ||
}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Regardless of my comment btw, I think this is a change into the right direction. Much better than before! |
size-limit report 📦
|
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this deprecated in v7?
We should put this under this section: https://github.com/getsentry/sentry-javascript/blob/8e0d24369f96145ad78a4983aab31583fbf8f358/MIGRATION.md#nextjs-sdk
There was a problem hiding this comment.
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!
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.