Skip to content

feat(nextjs): Bump Webpack Plugin to version 2 and rework config options #10978

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 22 commits into from
Mar 12, 2024

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Mar 8, 2024

Bumps the dependency of @sentry/webpack plugin to version 2. Because this is a major bump and we exported the plugin's options directly, this is a breaking change in the SDK.

We use this opportunity to merge the webpack plugin options argument with the SDK build-time options argument in withSentryConfig() (making things easier to set up) and additionally we overthink all the options we expose - intentionally not completely re-exporting the entire options of the plugin again.

Copy link
Contributor

github-actions bot commented Mar 8, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 76.98 KB (+0.02% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 68.23 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 72.12 KB (+0.03% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 61.79 KB (+0.01% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 32.43 KB (-0.04% 🔽)
@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped) 32.43 KB (-0.04% 🔽)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.36 KB (+0.01% 🔺)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.37 KB (+0.02% 🔺)
@sentry/browser - Webpack (gzipped) 22.55 KB (-0.05% 🔽)
@sentry/browser (incl. Tracing, Replay, Feedback) - CDN Bundle (gzipped) 75.08 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing, Replay) - CDN Bundle (gzipped) 66.69 KB (-0.03% 🔽)
@sentry/browser (incl. Tracing) - CDN Bundle (gzipped) 32.53 KB (-0.05% 🔽)
@sentry/browser - CDN Bundle (gzipped) 24 KB (-0.04% 🔽)
@sentry/browser (incl. Tracing, Replay) - CDN Bundle (minified & uncompressed) 209.02 KB (-0.02% 🔽)
@sentry/browser (incl. Tracing) - CDN Bundle (minified & uncompressed) 97.83 KB (-0.03% 🔽)
@sentry/browser - CDN Bundle (minified & uncompressed) 71.72 KB (-0.03% 🔽)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 68.43 KB (-0.02% 🔽)
@sentry/react - Webpack (gzipped) 22.58 KB (-0.08% 🔽)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 84.94 KB (-0.02% 🔽)
@sentry/nextjs Client - Webpack (gzipped) 49.34 KB (-0.01% 🔽)
@sentry-internal/feedback - Webpack (gzipped) 17.41 KB (0%)

@lforst lforst marked this pull request as ready for review March 8, 2024 14:00
@lforst lforst requested review from mydea, Lms24, AbhiPrasad and s1gr1d March 8, 2024 14:11
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice work!

Comment on lines +150 to +151
// TODO: Add this option
// deleteSourcemapsAfterUpload?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

IMHO it's probably also fine to just use the already available filesToDeleteAfterUpload option instead but feel free to implement this, too. I believe we had this option before in NextJS, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will probably think a bit harder about what to do here when I get to it. The reason why such a utility option may be nice is because the dist folder of Next.js projects is configurable.

});
});

it('returns the right `assets` and `ignore` values when run on the client', () => {
Copy link
Member

Choose a reason for hiding this comment

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

just to clarify, do you mean with "when run on the client" that client bundles are generated? Just wanna avoid confusion here 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, I'll update the wording!

lforst and others added 3 commits March 11, 2024 14:32
Co-authored-by: Lukas Stracke <[email protected]>
Co-authored-by: Lukas Stracke <[email protected]>
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