Skip to content

fix(v10/cloudflare): auto-instrument a re-exported default export - #25407

Draft
sentry-junior[bot] wants to merge 1 commit into
v10from
backport/v10-25345-cloudflare-default-reexport
Draft

sentry-junior[bot] wants to merge 1 commit into
v10from
backport/v10-25345-cloudflare-default-reexport

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Backport of: #25345

Differences to the original PR

  • packages/cloudflare/src/vite/transform.ts: v10 doesn't have wrapDefaultSpecifier (local export { handler as default } wrapping from fix(cloudflare): auto-instrument when wrangler main is a package #25343, which isn't on v10), and the specifier handler is still named wrapCrossModuleSpecifier. So the !kind branch only routes default re-exports with a from clause to wrapDefaultReexport; every other kind-less specifier still returns undefined as it did before on v10. wrapDefaultReexport itself is the same as on develop.
  • packages/cloudflare/test/vite/transform.test.ts: added only the three re-export tests from this PR (plus the same-worker RPC binding test). The local-specifier tests from fix(cloudflare): auto-instrument when wrangler main is a package #25343 that sit next to them on develop are left out, since that behavior isn't on v10.

via Junior system actor junior.

--

View Junior Session [Sentry]

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.24 kB added added
@sentry/browser - with treeshaking flags 26.68 kB added added
@sentry/browser (incl. Tracing) 47.21 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.01 kB added added
@sentry/browser (incl. Tracing, Profiling) 52 kB added added
@sentry/browser (incl. Tracing, Replay) 86.65 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.26 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 91.36 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 104 kB added added
@sentry/browser (incl. Feedback) 45.42 kB added added
@sentry/browser (incl. sendFeedback) 33.04 kB added added
@sentry/browser (incl. FeedbackAsync) 38.18 kB added added
@sentry/browser (incl. Metrics) 29.33 kB added added
@sentry/browser (incl. Logs) 29.56 kB added added
@sentry/browser (incl. Metrics & Logs) 30.24 kB added added
@sentry/react 30.05 kB added added
@sentry/react (incl. Tracing) 49.56 kB added added
@sentry/vue 34.11 kB added added
@sentry/vue (incl. Tracing) 49.62 kB added added
@sentry/svelte 28.26 kB added added
CDN Bundle 30.61 kB added added
CDN Bundle (incl. Tracing) 49.17 kB added added
CDN Bundle (incl. Logs, Metrics) 32.19 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 50.48 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.61 kB added added
CDN Bundle (incl. Tracing, Replay) 86.86 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.15 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 92.67 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.96 kB added added
CDN Bundle - uncompressed 90.99 kB added added
CDN Bundle (incl. Tracing) - uncompressed 148.25 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 95.7 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.23 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 221.05 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 268.07 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.04 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.77 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.73 kB added added
@sentry/nextjs (client) 52.12 kB added added
@sentry/sveltekit (client) 47.67 kB added added
@sentry/core/server 81.61 kB added added
@sentry/core/browser 67.69 kB added added
@sentry/node-core 64.01 kB added added
@sentry/node 127.21 kB added added
@sentry/node (incl. diagnostics channel injection) 171.4 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 52.05 kB added added
@sentry/node - without tracing 75.79 kB added added
@sentry/aws-serverless 84.96 kB added added
@sentry/cloudflare (withSentry) - minified 204.93 kB added added
@sentry/cloudflare (withSentry) 505.2 kB added added

nicohrubec added a commit that referenced this pull request Oct 16, 2026
#25430)

Backport of: #25343

## Differences to the original PR

- `packages/cloudflare/src/vite/transform.ts`: on v10, a local class
already wrapped by a named export keeps its binding (which now points at
the wrapped class), so `export { Foo as default }` stays as written
instead of being re-pointed at a wrapper name.
- `packages/cloudflare/src/vite/autoInstrument.ts`, tests and the
`cloudflare-autoinstrument-package-entry` e2e app: small adjustments to
fit v10's code layout.

Heads-up: this conflicts with #25407 (backport of #25345) in
`packages/cloudflare/src/vite/transform.ts` and its test. Whichever
lands second needs a rebase.

This branch was prepared by the v10 backport automation, which was
blocked at PR creation; it's opened manually now.

<!-- junior-request-attribution:start -->
via **Jan Peer Stöcklmair**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A83fc948beed4fb12a54d41cb -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A83fc948beed4fb12a54d41cb/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Nicolas Hrubec <nicolas.hrubec@outlook.com>

This branch has not been deployed

No deployments
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.

1 participant