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

feat(nextjs): Upgrade Sentry Webpack Plugin to 1.18.7 #4635

Closed
wants to merge 1 commit into from

Conversation

AbhiPrasad
Copy link
Member

This upgrades @sentry/webpack-plugin to https://github.com/getsentry/sentry-webpack-plugin/releases/tag/v1.18.7

This includes the changes from getsentry/sentry-webpack-plugin#354, which means we can get rid of the webpack peer dep from the NextJS package.

fixes #4632
supercedes #4634
ref #4576

@AbhiPrasad AbhiPrasad requested review from a team, Lms24 and lobsterkatie and removed request for a team February 24, 2022 17:54
@github-actions
Copy link
Contributor

size-limit report

Path Base Size (21ae9f7) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.7 KB 19.7 KB 0%
@sentry/browser - ES5 CDN Bundle (minified) 63.31 KB 63.31 KB 0%
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.37 KB 18.37 KB -0.02% 🔽
@sentry/browser - ES6 CDN Bundle (minified) 56.48 KB 56.48 KB 0%
@sentry/browser - Webpack (gzipped + minified) 22.16 KB 22.16 KB 0%
@sentry/browser - Webpack (minified) 76.18 KB 76.18 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.19 KB 22.19 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 46.33 KB 46.33 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.15 KB 27.15 KB -0.01% 🔽

@AbhiPrasad
Copy link
Member Author

Oh hmm maybe we can't do this because we import webpack types in packages/nextjs/src/config/types.ts

import { WebpackPluginInstance } from 'webpack';

Is there any way we can get rid of the type? If we can't, I guess we have to proceed with #4634 and make it an optional peer dep (but that has it's own problems as illustrated with getsentry/sentry-webpack-plugin#343)

@lobsterkatie
Copy link
Member

lobsterkatie commented Feb 24, 2022

Yeah, this is a perennial problem, and I've never managed to figure out a good solution. What we need is peer dev dependencies.

It's almost like we'd need to have @sentry/xxxxx-runtime and @sentry/xxxxx-dev, for the SDKs which use the webpack plugin, and have people add both. But then I guess you'd end up with issues like #3750.

We can't possibly be the first people to have this problem. Unfortunately, googling to see how/if it's been solved elsewhere just gets me a million articles on the difference between peer deps and dev deps...

All in all I honestly don't know what the best solution is here. @kamilogorek, do you have any thoughts about this?

@belgattitude
Copy link
Contributor

What we need is peer dev dependencies

Yep

and make it an optional peer dep

I haven't tested myself all possible scenarios, but I've let a comment here: getsentry/sentry-webpack-plugin#354 (comment). My feeling is that without peerDependenciesMeta, there's not so much options. But happy to find one if there is cause it's a bit frustrating.

@kamilogorek
Copy link
Contributor

kamilogorek commented Feb 25, 2022

Let's release getsentry/sentry-webpack-plugin#356 first and upgrade to this version, as it includes important cli changes.

All in all I honestly don't know what the best solution is here. @kamilogorek, do you have any thoughts about this?

I feel like we already tried it all with no clear winner... Even peerDepMeta wasn't too helpful really - getsentry/sentry-webpack-plugin#354

As for the getsentry/sentry-webpack-plugin#354 (comment) there will always be a tradeoffs, and every option we choose, there will be people that needs it reverted, as you said, ping-ping.
Fwiw, webpack plugin is written in JS, and TS are optional, so we could even remove them, and ship as a separate types package, so I'll go inline with what JS repo does here with next.js.

@AbhiPrasad
Copy link
Member Author

Ok let's roll with @belgattitude change's in #4634 for now - especially since the peer dep is already there.

If more people come back with issues, we can re-visit this topic in more detail

@AbhiPrasad AbhiPrasad closed this Feb 25, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-webpack-peer-dep branch February 25, 2022 15:43
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.

sentry/nextjs warning on install about missing webpack
4 participants