Skip to content

feat(react-router): Auto-wire orchestrion build-time instrumentation - #22809

Merged
chargome merged 6 commits into
developfrom
charlygomez/js-3182-react-router-auto-wire-orchestrion-bundler-plugin
Jul 31, 2026
Merged

feat(react-router): Auto-wire orchestrion build-time instrumentation#22809
chargome merged 6 commits into
developfrom
charlygomez/js-3182-react-router-auto-wire-orchestrion-bundler-plugin

Conversation

@chargome

@chargome chargome commented Jul 29, 2026

Copy link
Copy Markdown
Member

sentryReactRouter() now adds the orchestrion bundler plugin automatically, so bundled SSR builds get diagnostics_channel publishers injected with no manual plugin setup.

Also merges the two RR-8 e2e tests as it makes no sense to test orchestrion in isolation here.

Postponing dev server investigation to #22857

closes #22682

@chargome chargome self-assigned this Jul 29, 2026
@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

JS-3182

@chargome

chargome commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

bugbottler 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 6b044e0. Configure here.

chargome and others added 3 commits July 30, 2026 11:28
`sentryReactRouter()` now adds the orchestrion bundler plugin
(`@sentry/server-utils/orchestrion/vite`) automatically, so bundled SSR builds get
`diagnostics_channel` publishers injected into instrumented server-side deps (mysql,
ioredis, …) with no manual plugin setup.

The plugin is gated on the production server build (`command === 'build'`): it
force-bundles CJS deps via `ssr.noExternal`, which Vite's dev SSR server can't interop,
and there is nothing to transform in dev. Cloudflare/workerd targets are out of scope
for now — opt out there via the shared `buildTimeInstrumentation: false`.

Migrate the orchestrion e2e coverage into `react-router-7-framework-instrumentation`
and drop the standalone `react-router-8-orchestrion` app. Since bundled orchestrion is
now the default, the app initializes Sentry inside the bundle (via `entry.server.tsx`)
instead of a `--import` hook, so the channel subscribers land in the same bundle as the
injected publishers.

Fixes #22682

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…2-react-router-auto-wire-orchestrion-bundler-plugin

# Conflicts:
#	dev-packages/e2e-tests/test-applications/react-router-7-framework-instrumentation/tests/performance/redis.server.test.ts
#	dev-packages/e2e-tests/test-applications/react-router-8-orchestrion/tests/db.test.ts
… e2e app

Add `sentryReactRouter()` to the react-router-8-framework e2e app so the orchestrion
build-time transform is exercised on React Router 8 (it previously only ran `reactRouter()`).
Keeps ioredis on latest (5.11.1), where redis is instrumented via its native diagnostics
channels; the existing redis `db.query` assertions still hold.

Also shorten the orchestrion comment in the react-router vite plugin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chargome
chargome marked this pull request as ready for review July 30, 2026 12:53
@chargome
chargome requested a review from a team as a code owner July 30, 2026 12:53
@chargome
chargome requested review from nicohrubec and s1gr1d and removed request for a team July 30, 2026 12:53
Comment thread packages/react-router/src/vite/plugin.ts Outdated
Comment thread packages/react-router/src/vite/plugin.ts
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.93 kB - -
@sentry/browser - with treeshaking flags 28.13 kB - -
@sentry/browser (incl. Tracing) 47.19 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.2 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.93 kB - -
@sentry/browser (incl. Tracing, Replay) 86.51 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.94 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.23 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.87 kB - -
@sentry/browser (incl. Feedback) 47.24 kB - -
@sentry/browser (incl. sendFeedback) 34.77 kB - -
@sentry/browser (incl. FeedbackAsync) 39.87 kB - -
@sentry/browser (incl. Metrics) 31 kB - -
@sentry/browser (incl. Logs) 31.24 kB - -
@sentry/browser (incl. Metrics & Logs) 31.91 kB - -
@sentry/react 31.72 kB - -
@sentry/react (incl. Tracing) 49.44 kB - -
@sentry/vue 34.86 kB - -
@sentry/vue (incl. Tracing) 49.16 kB - -
@sentry/svelte 29.96 kB - -
CDN Bundle 31.97 kB - -
CDN Bundle (incl. Tracing) 47.57 kB - -
CDN Bundle (incl. Logs, Metrics) 33.52 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.93 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.88 kB - -
CDN Bundle (incl. Tracing, Replay) 85.19 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.97 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.28 kB - -
CDN Bundle - uncompressed 95.45 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.68 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.16 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.92 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.9 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.64 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.59 kB - -
@sentry/nextjs (client) 52.03 kB - -
@sentry/sveltekit (client) 47.63 kB - -
@sentry/core/server 79.88 kB - -
@sentry/core/browser 51.82 kB - -
@sentry/node 121.5 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 85.05 kB -0.01% -1 B 🔽
@sentry/aws-serverless 93.33 kB - -
@sentry/cloudflare (withSentry) - minified 198.67 kB - -
@sentry/cloudflare (withSentry) 488.83 kB - -

View base workflow run

@chargome
chargome merged commit 8f4f24d into develop Jul 31, 2026
266 checks passed
@chargome
chargome deleted the charlygomez/js-3182-react-router-auto-wire-orchestrion-bundler-plugin branch July 31, 2026 15:48
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.

React Router: auto-wire orchestrion bundler plugin

3 participants