Skip to content

chore: Switch to rolldown - #20775

Merged
logaretm merged 1 commit into
developfrom
tim/awad/use-rolldown
Nov 11, 2026
Merged

logaretm merged 1 commit into
developfrom
tim/awad/use-rolldown

Conversation

@logaretm

@logaretm logaretm commented May 8, 2026 •

Copy link
Copy Markdown
Member

Refreshed what we had in #18156 with the latest rolldown and let's see if we can get this one out.

Benchmarks

Individual SDKs

Clean build times on my machine, averaged over 3 runs, develop vs this branch:

Package rollup 4.60.3 rolldown 1.2.14 Speedup
@sentry/browser (incl. CDN bundles) 41.60s 5.79s 7.2x
@sentry/replay-internal (incl. CDN bundles) 4.04s 1.37s 2.9x
@sentry/node 1.49s 0.72s 2.1x
@sentry/core 1.28s 0.69s 1.9x
@sentry/nextjs* 1.76s 1.40s 1.3x
  • NextJS SDK still uses rolldown to rebundle some files as part of the SDK buildtime configuration. This will need a separate PR.

Full Build

Full monorepo build on my machine (clean, --skip-nx-cache), median of 4 runs, develop vs this branch on the same base.

rollup 4.60.3 rolldown 1.2.15 Speedup
Full build (transpile + types + bundles) 63.1s 20.4s 3.1x
Transpile + bundles only 59.1s 16.9s 3.5x
  • No CI comparison due to cache state skew, but estimation put it at ~2min faster.

@github-actions

github-actions Bot commented May 9, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 538d6e6 (PR test merge using develop at edae47f)

Against: edae47f (develop) · base run #65716

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 29.88 kB -0.33% -97 B 🔽
@sentry/browser - with treeshaking flags 28.08 kB -0.19% -53 B 🔽
@sentry/browser - with treeshaking flags tracing without tracing 27.98 kB -0.15% -41 B 🔽
@sentry/browser (incl. Tracing) 52.15 kB -0.4% -207 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 52.15 kB -0.4% -206 B 🔽
@sentry/browser (incl. Tracing, Profiling) 55.11 kB -0.4% -220 B 🔽
@sentry/browser (incl. Tracing, Replay) 92.71 kB -0.06% -49 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.46 kB +0.06% +46 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 97.06 kB -0.44% -425 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 110.48 kB +0.01% +6 B 🔺
@sentry/browser (incl. Feedback) 47.51 kB -0.14% -66 B 🔽
@sentry/browser (incl. sendFeedback) 30.46 kB -13.15% -4.61 kB 🔽
@sentry/browser (incl. FeedbackAsync) 35.47 kB -11.71% -4.7 kB 🔽
@sentry/browser (incl. Metrics) 31.19 kB -1.11% -348 B 🔽
@sentry/browser (incl. Logs) 31.47 kB -1.14% -361 B 🔽
@sentry/browser (incl. Metrics & Logs) 32.13 kB -1.18% -382 B 🔽
@sentry/react 31.88 kB +0.12% +37 B 🔺
@sentry/react (incl. Tracing) 54.79 kB -0.03% -15 B 🔽
@sentry/vue 38.12 kB -0.7% -266 B 🔽
@sentry/vue (incl. Tracing) 55.06 kB -0.58% -316 B 🔽
@sentry/svelte 29.91 kB -0.29% -85 B 🔽
@sentry/remix (Remix 3 client bundle) 57.88 kB -0.15% -86 B 🔽
CDN Bundle 31.64 kB -0.43% -135 B 🔽
CDN Bundle (incl. Tracing) 52.49 kB -0.85% -449 B 🔽
CDN Bundle (incl. Logs, Metrics) 34.41 kB -0.49% -167 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 55.05 kB -0.72% -398 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 75.57 kB -0.63% -473 B 🔽
CDN Bundle (incl. Tracing, Replay) 90.56 kB -0.74% -667 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.17 kB -0.64% -593 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 95.95 kB -1.43% -1.38 kB 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.56 kB -1.38% -1.37 kB 🔽
CDN Bundle - uncompressed 92.22 kB -0.72% -667 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 154.94 kB -0.78% -1.2 kB 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.56 kB -0.85% -853 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 162.57 kB -0.83% -1.35 kB 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 230.9 kB -1.04% -2.41 kB 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.09 kB -1.11% -3.08 kB 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 282.72 kB -1.13% -3.21 kB 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 286.88 kB -1.71% -4.99 kB 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 294.5 kB -1.71% -5.12 kB 🔽
@sentry/nextjs (client) 58.18 kB +0.77% +440 B 🔺
@sentry/sveltekit (client) 53.15 kB +0.51% +268 B 🔺
@sentry/core/server 44.52 kB +0.05% +19 B 🔺
@sentry/core/browser 13.99 kB -0.23% -32 B 🔽
@sentry/node 149.19 kB -5.46% -8.61 kB 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.16 kB +1.04% +853 B 🔺
@sentry/node - without tracing 88.26 kB -9.23% -8.96 kB 🔽
@sentry/node - without channel injection 138.17 kB +0.04% +50 B 🔺
@sentry/aws-serverless 96.91 kB -8.64% -9.16 kB 🔽
@sentry/cloudflare (withSentry) - minified 204.16 kB -0.15% -293 B 🔽
@sentry/cloudflare (withSentry) 473.86 kB -6.74% -34.25 kB 🔽
@sentry/nextjs/cloudflare (withSentry) - minified 229.47 kB +0.01% +6 B 🔺

View base workflow run

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch 6 times, most recently from 64ea470 to bf6f465 Compare May 12, 2026 16:20
@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch 9 times, most recently from 1f4024d to 7d12000 Compare May 28, 2026 16:20
@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch 3 times, most recently from e3dab2d to 5104f9a Compare June 4, 2026 20:07
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you apply the label PR: no-auto-close I will leave it alone ... forever!

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch 7 times, most recently from 7e9a9c6 to c823474 Compare August 25, 2026 19:35
@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch 4 times, most recently from 7dc52cf to 9270688 Compare November 9, 2026 15:48
@logaretm
logaretm marked this pull request as ready for review November 9, 2026 15:48
@logaretm
logaretm requested review from a team as code owners November 9, 2026 15:48
@logaretm
logaretm requested review from andreiborza, chargome, msonnb, mydea and nicohrubec and removed request for a team November 9, 2026 15:48

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just a few small questions/comments nothing blocking from my side, very nice work

Comment thread packages/browser-utils/package.json Outdated
"build:watch": "run-p build:transpile:watch",
"build:dev:watch": "run-p build:transpile:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:watch": "run-p build:transpile:watch build:types:watch",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q/l: in a lot of the packages we add build:types:watch but don't add it to build:watch as we do here, seems inconsistent is that intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wasn't intentional, probably forgot to revert it before we migrated to ts 7.0

Comment thread pnpm-workspace.yaml Resolved
@@ -0,0 +1,5 @@
// Called from a served script so the synthetic stacktrace keeps a frame with a URL. Frames from

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: all the tests you added are regressions against stuff that was fixed upstream at some point?

@logaretm logaretm Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope, so these specifically are breaking our assertions due to a side effect on the output shape. This specifically affects webkit:

// rollup: anonymous function, no name in the stack
t.captureMessage=function(t,e){...;return Xt().captureMessage(t,n,r)}

// rolldown: named function
function captureMessage(e,t){...;return F().captureMessage(e,n,r)}

So what happens is our assertions use stripSentryFramesAndReverse to strip out sentry frames, in rollup one frame survives because it is anonymous, in rolldown that will get stripped so it is a fix to Safari actually, it just passed our assertions accidentally.

Firefox and Chrome infer the anonymous function name from the assignment so they didn't have this side effect.

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch from 9270688 to 3908c8e Compare November 11, 2026 13:03
@logaretm
logaretm requested a review from a team November 11, 2026 13:03

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

Comment on lines -23 to -24
gaugeSpy = spyOn(metrics, 'gauge').mockImplementation(() => undefined);
countSpy = spyOn(metrics, 'count').mockImplementation(() => undefined);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i guess this means users also won't be able to do vi.spyOn(Sentry.metrics, 'count') and similar? clanker suggested that we could export an object literal instead of export * as metrics from './metrics/public-api' and export * as logger from './logger/public-api. wdyt?

@logaretm logaretm Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, on one hand i don't expect users to mock our APIs during testing, also this has been always true for ESM so this case only affects CJS. So I was hesitant to address this.

But since you raised it, we are shipping this in a minor, so might as well do it to avoid subtle changes. Thanks!

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch from 3908c8e to 2cfcf6c Compare November 11, 2026 13:54

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch from 2cfcf6c to 3c4cb5d Compare November 11, 2026 14:06

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3c4cb5d. Configure here.

@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch from 3c4cb5d to 3573ba6 Compare November 11, 2026 14:19
@logaretm
logaretm force-pushed the tim/awad/use-rolldown branch from 3573ba6 to 9bf6182 Compare November 11, 2026 14:23
@logaretm
logaretm merged commit fc01bd9 into develop Nov 11, 2026
4907 of 4947 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants