Open
Conversation
Add a lightweight parallel rollup runner that processes config arrays concurrently using the rollup JS API. Use it for @sentry/browser's build:bundle which runs 93 rollup builds (31 entrypoints × 3 variants). This reduces the browser bundle build from ~175s to ~65s (~2.6x faster), which was the critical path for the full `yarn build`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8fd53b. Configure here.
chargome
approved these changes
Apr 16, 2026
Comment on lines
+199
to
+201
| return { | ||
| ...merged, | ||
| }; |
| let done = 0; | ||
|
|
||
| async function worker() { | ||
| while (queue.length > 0) { |
Member
There was a problem hiding this comment.
l: We could abort once a worker failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Previously, running
yarn build:bundlesfor the browser package is one of the biggest blocker for build time. This is because this builds ~90 bundles in series via rollup. This PR adds a small script to run multiple rollup builds in parallel, hopefully speeding this up significantly. Locally I saw an improvement from ~150s to ~70s.It turns out this is a bit harder than expected because we were kind of incorrectly relying on shared rollup plugin instances for our builds, which seems not to be recommended. So I (or cursor, actually) rewrote this to instead generate a standalone plugin instance for each build so they cannot conflict.
Summary
dev-packages/rollup-utils/rollupParallel.mjs— a ~30 line script that runs rollup config arrays concurrently using the rollup JS API (concurrency = CPU count)@sentry/browser'sbuild:bundle, which builds 93 rollup configs (31 entrypoints × 3 variants:.js,.min.js,.debug.min.js)Rollup processes config arrays sequentially. This was the critical path for
yarn build— the browser bundle step alone took ~175s. With parallel execution it completes in ~65s (~2.6x speedup).The other packages with
build:bundle(replay, feedback, replay-canvas, wasm) only have 3-6 configs each, so the overhead isn't worth it there.Test plan
yarn buildinpackages/browserproduces all 93 bundles + sourcemaps🤖 Generated with Claude Code