Skip to content

fix(bundler-plugins): Integration with monorepo build#21479

Merged
isaacs merged 10 commits into
developfrom
fix/bundler-plugins-full-integration
Jun 19, 2026
Merged

fix(bundler-plugins): Integration with monorepo build#21479
isaacs merged 10 commits into
developfrom
fix/bundler-plugins-full-integration

Conversation

@isaacs

@isaacs isaacs commented Jun 11, 2026

Copy link
Copy Markdown
Member

Update the bundler-plugins so that integration tests run in CI, and the module follows the same patterns as the rest of sentry-javascript.

@isaacs

isaacs commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

If CI passes, this can be landed after the feat/merge-in-sentry-javascript-bundler-plugins lands.

Comment thread package.json Outdated
Comment thread dev-packages/bundler-plugin-integration-tests/setup.mjs
@isaacs isaacs marked this pull request as draft June 11, 2026 23:53
Comment thread yarn.lock Outdated
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.45 kB - -
@sentry/browser - with treeshaking flags 25.88 kB - -
@sentry/browser (incl. Tracing) 45.94 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.7 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.73 kB - -
@sentry/browser (incl. Tracing, Replay) 85.14 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.73 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.83 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.49 kB -0.01% -3 B 🔽
@sentry/browser (incl. Feedback) 44.62 kB -0.01% -2 B 🔽
@sentry/browser (incl. sendFeedback) 32.24 kB -0.03% -9 B 🔽
@sentry/browser (incl. FeedbackAsync) 37.38 kB -0.01% -3 B 🔽
@sentry/browser (incl. Metrics) 28.52 kB - -
@sentry/browser (incl. Logs) 28.76 kB - -
@sentry/browser (incl. Metrics & Logs) 29.45 kB - -
@sentry/react 29.25 kB - -
@sentry/react (incl. Tracing) 48.24 kB - -
@sentry/vue 32.61 kB - -
@sentry/vue (incl. Tracing) 47.8 kB - -
@sentry/svelte 27.48 kB - -
CDN Bundle 29.84 kB - -
CDN Bundle (incl. Tracing) 47.85 kB - -
CDN Bundle (incl. Logs, Metrics) 31.39 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.19 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.7 kB - -
CDN Bundle (incl. Tracing, Replay) 85.21 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.31 kB - -
CDN Bundle - uncompressed 88.8 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.5 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 148.81 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.33 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 263.7 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 267.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 277.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.35 kB - -
@sentry/nextjs (client) 50.63 kB - -
@sentry/sveltekit (client) 46.33 kB - -
@sentry/core/server 75.85 kB - -
@sentry/core/browser 63.01 kB - -
@sentry/node-core 61.63 kB - -
@sentry/node 123.89 kB -0.01% -1 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB -0.14% -95 B 🔽
@sentry/node/light 50.55 kB -0.01% -1 B 🔽
@sentry/node - without tracing 74.13 kB - -
@sentry/aws-serverless 85.23 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 172.9 kB - -
@sentry/cloudflare (withSentry) 432.48 kB - -

View base workflow run

@isaacs isaacs force-pushed the feat/merge-in-sentry-javascript-bundler-plugins branch 3 times, most recently from 8e03cf7 to 18f6ebe Compare June 12, 2026 21:55
@isaacs isaacs force-pushed the fix/bundler-plugins-full-integration branch 4 times, most recently from a8f4623 to b1938e8 Compare June 13, 2026 00:28
@isaacs isaacs marked this pull request as ready for review June 13, 2026 01:13
@isaacs isaacs requested a review from a team as a code owner June 13, 2026 01:13
@isaacs isaacs requested review from JPeer264 and mydea and removed request for a team June 13, 2026 01:13
Comment thread packages/bundler-plugins/rollup.npm.config.mjs
Comment thread packages/bundler-plugins/.gitignore
Comment thread packages/bundler-plugins/package.json Outdated
@github-actions

Copy link
Copy Markdown
Contributor

👋 @mydea, @JPeer264 — Please review this PR when you get a chance!

@isaacs isaacs force-pushed the feat/merge-in-sentry-javascript-bundler-plugins branch 3 times, most recently from 10c1285 to ce99389 Compare June 18, 2026 23:33
@isaacs isaacs force-pushed the fix/bundler-plugins-full-integration branch from b1938e8 to b1f7ccc Compare June 19, 2026 00:25
Comment thread packages/bundler-plugins/package.json
@isaacs isaacs requested a review from andreiborza June 19, 2026 00:57
@isaacs isaacs force-pushed the feat/merge-in-sentry-javascript-bundler-plugins branch from ce99389 to 2c13b32 Compare June 19, 2026 14:37
@isaacs isaacs force-pushed the fix/bundler-plugins-full-integration branch from aaa5a71 to 17930f5 Compare June 19, 2026 14:39
Comment thread dev-packages/bundler-plugin-integration-tests/package.json
Base automatically changed from feat/merge-in-sentry-javascript-bundler-plugins to develop June 19, 2026 16:02
@isaacs isaacs enabled auto-merge (squash) June 19, 2026 16:02
isaacs added 6 commits June 19, 2026 09:57
Update the bundler-plugins so that integration tests run in CI, and the
module follows the same patterns as the rest of sentry-javascript.
Issue found by sentry pr review bot:

> Potential issue: The fallback logic for the webpack plugin's component
> annotation loader is incorrect. In an ESM context, where `__dirname`
> is undefined, the code attempts to resolve a file with an `.mjs`
> extension. However, the new Rollup build configuration outputs `.js`
> files for both CJS and ESM formats. This discrepancy will cause a
> runtime crash when the plugin is used in a non-packaged environment
> (e.g., via `yarn link` or direct monorepo consumption), as the primary
> module resolution will fail, and the incorrect fallback path will be
> used.

Fix: since both formats emit .js, the extension is unconditional —
replaced the branch with a single component-annotation-transform.js
path. Verified the rebuilt ESM and CJS both now reference .js.

The unused __dirname conditional is gone; fileURLToPath/path imports are
still used.
Issue found by a code review agent:

> Potential issue: In the `uploadSourcemaps` function, the
> cleanup of a temporary directory is initiated using `void
> startSpan()`, which does not await the completion of the
> cleanup promise. This creates a race condition where the main
> function can return and the parent process can exit before the
> asynchronous file deletion (`fs.promises.rm`) is finished. In
> environments where processes terminate quickly after a task,
> such as in CI/CD pipelines, this can lead to the temporary
> directory (`sentry-bundler-plugin-upload-*`) being left behind.
> Over time, the accumulation of these orphaned directories can
> consume significant disk space, resulting in a resource leak.

Fixed by awaiting the cleanup function.
This isn't super significant, but it's a little simpler to just converge
on the same test framework used by the rest of the monorepo.
@isaacs isaacs force-pushed the fix/bundler-plugins-full-integration branch from 17930f5 to ac6140c Compare June 19, 2026 16:57
Comment thread packages/bundler-plugins/src/core/build-plugin-manager.ts Outdated

@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 1 potential issue.

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 8c15199. Configure here.

Comment thread packages/bundler-plugins/test/core/utils.test.ts
@isaacs isaacs merged commit 2ebced8 into develop Jun 19, 2026
551 of 554 checks passed
@isaacs isaacs deleted the fix/bundler-plugins-full-integration branch June 19, 2026 19:30
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