Skip to content

feat(react-router)!: Enable orchestrion instrumentation on Cloudflare - #23063

Open
chargome wants to merge 3 commits into
developfrom
feat/react-router-cloudflare-orchestrion
Open

feat(react-router)!: Enable orchestrion instrumentation on Cloudflare#23063
chargome wants to merge 3 commits into
developfrom
feat/react-router-cloudflare-orchestrion

Conversation

@chargome

@chargome chargome commented Aug 5, 2026

Copy link
Copy Markdown
Member

sentryReactRouter() now enables orchestrion's channel-subscriber injection when building for Cloudflare, so bundled workers get orchestrion spans with no manual setup.

Unlike the other meta-framework SDKs, React Router exposes no adapter or preset to branch on, and sentryReactRouter only receives Vite's ConfigEnv. We try to detect a wrangler config instead: a worker can't deploy without one, it covers both the Workers scaffold and Shopify Oxygen, and no Node app has one.

Also adds a new react-router-8-cloudflare e2e app.

ref: #22632

`sentryReactRouter()` now enables orchestrion's channel-subscriber injection
when building for Cloudflare, so bundled workers get `db` spans with no manual
setup.

Unlike the other meta-framework SDKs, React Router exposes no adapter or preset
to branch on, and `sentryReactRouter` only receives Vite's `ConfigEnv`.
Detection probes for a wrangler config instead: a worker can't deploy without
one, it covers both the Workers scaffold and Shopify Oxygen, and no Node app has
one.

Ref: #22632

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome chargome self-assigned this Aug 5, 2026
@chargome

chargome commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5fd138c. Configure here.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.12 kB - -
@sentry/browser - with treeshaking flags 28.32 kB - -
@sentry/browser (incl. Tracing) 47.53 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.54 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.29 kB - -
@sentry/browser (incl. Tracing, Replay) 86.91 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.33 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.6 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.25 kB - -
@sentry/browser (incl. Feedback) 47.45 kB - -
@sentry/browser (incl. sendFeedback) 34.96 kB - -
@sentry/browser (incl. FeedbackAsync) 40.1 kB - -
@sentry/browser (incl. Metrics) 31.2 kB - -
@sentry/browser (incl. Logs) 31.41 kB - -
@sentry/browser (incl. Metrics & Logs) 32.11 kB - -
@sentry/react 31.93 kB - -
@sentry/react (incl. Tracing) 49.79 kB - -
@sentry/vue 35.2 kB - -
@sentry/vue (incl. Tracing) 49.51 kB - -
@sentry/svelte 30.14 kB - -
CDN Bundle 32.13 kB - -
CDN Bundle (incl. Tracing) 47.81 kB - -
CDN Bundle (incl. Logs, Metrics) 33.67 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.19 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.02 kB - -
CDN Bundle (incl. Tracing, Replay) 85.45 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.27 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.59 kB - -
CDN Bundle - uncompressed 95.27 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.78 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.9 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.75 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.6 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.03 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.74 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.69 kB - -
@sentry/nextjs (client) 52.36 kB - -
@sentry/sveltekit (client) 47.99 kB - -
@sentry/core/server 65.54 kB - -
@sentry/core/browser 51.82 kB - -
@sentry/node 120.44 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 84.09 kB -0.01% -1 B 🔽
@sentry/aws-serverless 92.59 kB -0.01% -1 B 🔽
@sentry/cloudflare (withSentry) - minified 217.81 kB - -
@sentry/cloudflare (withSentry) 537.06 kB - -

View base workflow run

chargome and others added 2 commits August 6, 2026 11:58
…ntry

React Router 8 replaced v7's augmentable `AppLoadContext` with
`RouterContextProvider`, so the `{ cloudflare: { env, ctx } }` shape from
Cloudflare's framework guide no longer typechecks. Nothing in the app reads the
bindings from a loader — the DSN comes from the `withSentry` env argument — so
the handler takes the request alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cut the explanatory comments back to the non-obvious reasoning, dropping the
parts that restate the code or re-describe the transform pipeline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chargome
chargome marked this pull request as ready for review August 6, 2026 11:41
@chargome
chargome requested a review from a team as a code owner August 6, 2026 11:41
@chargome
chargome requested review from JPeer264, nicohrubec and s1gr1d and removed request for a team and s1gr1d August 6, 2026 11:41
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