Skip to content

Commit 490cdf4

Browse files
chargomeclaude
andcommitted
test(react-router): Auto-wire orchestrion in react-router-8-framework 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>
1 parent 141cd74 commit 490cdf4

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

  • dev-packages/e2e-tests/test-applications/react-router-8-framework
  • packages/react-router/src/vite
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { reactRouter } from '@react-router/dev/vite';
2+
import { sentryReactRouter } from '@sentry/react-router';
23
import { defineConfig } from 'vite';
34

4-
export default defineConfig({
5-
plugins: [reactRouter()],
5+
export default defineConfig(config => {
6+
return {
7+
plugins: [reactRouter(), sentryReactRouter({ sourcemaps: { disable: true } }, config)],
8+
};
69
});

packages/react-router/src/vite/plugin.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ export async function sentryReactRouter(
2323
plugins.push(makeServerBuildCapturePlugin());
2424

2525
if (process.env.NODE_ENV !== 'development' && viteConfig.command === 'build' && viteConfig.mode !== 'development') {
26-
// Injects `diagnostics_channel` publishers into instrumented server-side deps (mysql, ioredis, …)
27-
// at build time. Only wired into the bundled server build: the plugin force-bundles CJS deps via
28-
// `ssr.noExternal`, which Vite's dev SSR server can't interop (`exports is not defined`), and there
29-
// is nothing to transform in dev anyway. `applyToEnvironment` further keeps it off client bundles.
30-
// TODO: Cloudflare/workerd targets need different wiring and are skipped for now — opt out there via
31-
// `buildTimeInstrumentation: false`.
26+
// Build-time `diagnostics_channel` injection for instrumented server deps (mysql, ioredis, …).
27+
// Build-only: `ssr.noExternal` force-bundles CJS deps, which Vite's dev SSR can't interop. Cloudflare/workerd out of scope — opt out via `buildTimeInstrumentation: false`.
3228
plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));
3329
plugins.push(makeEnableSourceMapsPlugin(options));
3430
plugins.push(...(await makeCustomSentryVitePlugins(options)));

0 commit comments

Comments
 (0)