sentry-javascript
sentry-javascript copied to clipboard
feat(nextjs): Use `runAfterProductionCompile` to upload sourcemaps and do release management
Ref https://github.com/vercel/next.js/pull/77345
Next.js is adding an runAfterProductionCompile hook that we can use to upload sourcemaps and manage release.
Unfortunately, because we need to support older Next.js versions, we still need to maintain our Webpack logic, so for now I opted to run the runAfterProductionCompile logic only if we never ran our webpack logic. That way we should never do duplicate work.
size-limit report 📦
| Path | Size | % Change | Change |
|---|---|---|---|
| @sentry/browser | 23.32 KB | - | - |
| @sentry/browser - with treeshaking flags | 23.13 KB | - | - |
| @sentry/browser (incl. Tracing) | 36.98 KB | - | - |
| @sentry/browser (incl. Tracing, Replay) | 74.15 KB | - | - |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags | 67.49 KB | - | - |
| @sentry/browser (incl. Tracing, Replay with Canvas) | 78.8 KB | - | - |
| @sentry/browser (incl. Tracing, Replay, Feedback) | 90.59 KB | - | - |
| @sentry/browser (incl. Feedback) | 39.71 KB | - | - |
| @sentry/browser (incl. sendFeedback) | 27.94 KB | - | - |
| @sentry/browser (incl. FeedbackAsync) | 32.7 KB | - | - |
| @sentry/react | 25.12 KB | - | - |
| @sentry/react (incl. Tracing) | 38.95 KB | - | - |
| @sentry/vue | 27.55 KB | - | - |
| @sentry/vue (incl. Tracing) | 38.73 KB | - | - |
| @sentry/svelte | 23.34 KB | - | - |
| CDN Bundle | 24.52 KB | - | - |
| CDN Bundle (incl. Tracing) | 36.99 KB | - | - |
| CDN Bundle (incl. Tracing, Replay) | 72.03 KB | - | - |
| CDN Bundle (incl. Tracing, Replay, Feedback) | 77.34 KB | - | - |
| CDN Bundle - uncompressed | 71.57 KB | - | - |
| CDN Bundle (incl. Tracing) - uncompressed | 109.41 KB | - | - |
| CDN Bundle (incl. Tracing, Replay) - uncompressed | 220.69 KB | - | - |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed | 233.22 KB | - | - |
| @sentry/nextjs (client) | 40.55 KB | - | - |
| @sentry/sveltekit (client) | 37.45 KB | - | - |
| @sentry/node | 143.45 KB | - | - |
| @sentry/node - without tracing | 96.54 KB | - | - |
| @sentry/aws-serverless | 120.86 KB | +0.01% | +1 B 🔺 |
This is still blocked until Next.js adds debug ID support. We could do name based sourcemap resolution but that takes us back to the dark ages 💀
Closing to get this PR out of my PR tab. Feel free to take the branch.
With Love Luca