Skip to content

test(e2e): Add Bun, Deno and Cloudflare variants to react-router-8-framework - #24598

Draft
JPeer264 wants to merge 2 commits into
developfrom
jp/e2e-runtime-variants-poc
Draft

JPeer264 wants to merge 2 commits into
developfrom
jp/e2e-runtime-variants-poc

Conversation

@JPeer264

Copy link
Copy Markdown
Member

POC for running one framework e2e app on several server runtimes, instead of one app per runtime (Linear project P-JS-2537). react-router-8-framework now has optional variants for Bun, Deno and Cloudflare (local workerd) that run the same Playwright suite as the Node job.

A variant sets RUNTIME in a named script, and playwright.config.mjs picks the start command from it. Bun and Deno reuse the Node build and only change the start command. Cloudflare has its own vite.cloudflare.config.ts with @cloudflare/vite-plugin and sentryCloudflareVitePlugin, and the variant builds with --config. React Router has no option to pick a server entry, so the new runtimeEntryPlugin from @sentry-internal/test-utils/vite loads entry.server.cloudflare.tsx in its place. A new runtime matrix key (bun | deno) makes CI install that runtime, so new variants need no change to build.yml (the optional job had no Bun step at all). The convention is in the e2e README.

The variants are optional because they are not green yet. Locally: Node 22/22, Deno 22/22, Bun 14/22, Cloudflare 11/22. The failures are mostly SDK gaps that will get their own tickets:

  • Bun does not publish http.server.request.start, so @sentry/react-router gets no http.server spans and no request data on errors.
  • In workerd, routes that import @sentry/react-router get index.client.js (browser comes before worker in the exports map), so Sentry.flush and Sentry.startSpan are undefined.
  • sentryReactRouter and sentryCloudflareVitePlugin together inject the orchestrion snippet twice and the build fails. The app turns off buildTimeInstrumentation in sentryReactRouter for now.
  • On Cloudflare, prerendered HTML contains a baked-in sentry-trace meta tag, and the /__manifest filter does not apply.

Two changes to the app are needed on every runtime: the Redis client is now made in the loader (workerd does not allow a socket connect at module scope), and the Cloudflare server entry is a separate file.

🤖 Generated with Claude Code

…amework

Runs the same Playwright suite on Bun, Deno and Cloudflare (local workerd)
as optional variants of the existing app, instead of one app per runtime.

A variant can set a `runtime` matrix key (`bun` or `deno`), and CI installs
that runtime for the job. The Cloudflare build uses its own Vite config with
`@cloudflare/vite-plugin` and `sentryCloudflareVitePlugin`, and swaps in a
workerd server entry with the new `runtimeEntryPlugin` from
`@sentry-internal/test-utils/vite`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.16 kB - -
@sentry/browser - with treeshaking flags 27.42 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.33 kB - -
@sentry/browser (incl. Tracing) 50.7 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.71 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.71 kB - -
@sentry/browser (incl. Tracing, Replay) 90.28 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.4 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.97 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.93 kB - -
@sentry/browser (incl. Feedback) 46.69 kB - -
@sentry/browser (incl. sendFeedback) 34.22 kB - -
@sentry/browser (incl. FeedbackAsync) 39.32 kB - -
@sentry/browser (incl. Metrics) 30.18 kB - -
@sentry/browser (incl. Logs) 30.43 kB - -
@sentry/browser (incl. Metrics & Logs) 31.09 kB - -
@sentry/react 30.91 kB - -
@sentry/react (incl. Tracing) 53 kB - -
@sentry/vue 36.52 kB - -
@sentry/vue (incl. Tracing) 53.1 kB - -
@sentry/svelte 29.18 kB - -
CDN Bundle 30.86 kB - -
CDN Bundle (incl. Tracing) 51.18 kB - -
CDN Bundle (incl. Logs, Metrics) 33.12 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.18 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.84 kB - -
CDN Bundle (incl. Tracing, Replay) 88.77 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.84 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.86 kB - -
CDN Bundle - uncompressed 91.25 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.8 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.76 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.39 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.53 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 278.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 286.24 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 292.16 kB - -
@sentry/nextjs (client) 55.33 kB - -
@sentry/sveltekit (client) 51.12 kB - -
@sentry/core/server 39.92 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.59 kB +0.02% +17 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.4 kB - -
@sentry/node - without tracing 90.15 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 112.11 kB +0.02% +12 B 🔺
@sentry/aws-serverless 98.41 kB +0.03% +22 B 🔺
@sentry/cloudflare (withSentry) - minified 205.05 kB - -
@sentry/cloudflare (withSentry) 510.66 kB - -

View base workflow run

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