Skip to content

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

Open
isaacs wants to merge 6 commits into
feat/merge-in-sentry-javascript-bundler-pluginsfrom
fix/bundler-plugins-full-integration
Open

fix(bundler-plugins): Integration with monorepo build#21479
isaacs wants to merge 6 commits into
feat/merge-in-sentry-javascript-bundler-pluginsfrom
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.

@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 d665aad. Configure here.

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 added added
@sentry/browser - with treeshaking flags 25.88 kB added added
@sentry/browser (incl. Tracing) 45.91 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.16 kB added added
@sentry/browser (incl. Tracing, Profiling) 50.69 kB added added
@sentry/browser (incl. Tracing, Replay) 85.1 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.71 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 89.8 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 102.46 kB added added
@sentry/browser (incl. Feedback) 44.62 kB added added
@sentry/browser (incl. sendFeedback) 32.24 kB added added
@sentry/browser (incl. FeedbackAsync) 37.38 kB added added
@sentry/browser (incl. Metrics) 28.52 kB added added
@sentry/browser (incl. Logs) 28.76 kB added added
@sentry/browser (incl. Metrics & Logs) 29.45 kB added added
@sentry/react 29.25 kB added added
@sentry/react (incl. Tracing) 48.21 kB added added
@sentry/vue 32.58 kB added added
@sentry/vue (incl. Tracing) 47.78 kB added added
@sentry/svelte 27.48 kB added added
CDN Bundle 29.86 kB added added
CDN Bundle (incl. Tracing) 48.32 kB added added
CDN Bundle (incl. Logs, Metrics) 31.4 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.62 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 70.71 kB added added
CDN Bundle (incl. Tracing, Replay) 85.64 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.9 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 91.49 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.73 kB added added
CDN Bundle - uncompressed 88.8 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.13 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.5 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.1 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.33 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.99 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.95 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.69 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.64 kB added added
@sentry/nextjs (client) 50.61 kB added added
@sentry/sveltekit (client) 46.3 kB added added
@sentry/core/server 76.21 kB added added
@sentry/core/browser 63.34 kB added added
@sentry/node-core 61.9 kB added added
@sentry/node 124.68 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB added added
@sentry/node/light 50.97 kB added added
@sentry/node - without tracing 74.27 kB added added
@sentry/aws-serverless 85.37 kB added added
@sentry/cloudflare (withSentry) - minified 174.55 kB added added
@sentry/cloudflare (withSentry) 436.86 kB added added

@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
dist
build
*.tgz
src/core/version.ts

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: why is this gitignored?

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.

It's built by the prebuild script.

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 added 5 commits June 18, 2026 17:25
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 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
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