Skip to content

ref: Remove the framework tunnel hooks - #26001

Merged
logaretm merged 3 commits into
awad/runtime-tunnel-lambdafrom
awad/runtime-tunnel-drop-framework-hooks
Nov 6, 2026
Merged

logaretm merged 3 commits into
awad/runtime-tunnel-lambdafrom
awad/runtime-tunnel-drop-framework-hooks

Conversation

@logaretm

@logaretm logaretm commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

At this point, we handle the runtimes we support, so the previous framework-specific wiring is no longer needed.

This PR adjusts a couple of wiring for some safety around double inits in serverless environments, and cleans up most of the old code introduced in 11.10.

Note for reviewers: if you are lacking context on this PR, check #25997

@logaretm
logaretm added this pull request to stack #26002 November 2, 2026 19:44
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: 9eab265 (PR test merge using develop at 8719ead)

Against: 03492d2 (develop) · base run #65336

⚠️ Baseline mismatch: 54 develop commit(s) in the PR build are missing from the baseline; 2 develop commit(s) in the baseline are missing from the PR build. Their size changes also affect this comparison. Compare commits. Rebase your PR onto the latest develop to compare against an up-to-date baseline.

Path Size % Change Change
@sentry/browser 29.92 kB - -
@sentry/browser - with treeshaking flags 28.08 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.97 kB - -
@sentry/browser (incl. Tracing) 52.2 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.18 kB - -
@sentry/browser (incl. Tracing, Replay) 92.52 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.2 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.25 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.25 kB - -
@sentry/browser (incl. Feedback) 47.52 kB - -
@sentry/browser (incl. sendFeedback) 35.02 kB - -
@sentry/browser (incl. FeedbackAsync) 40.13 kB - -
@sentry/browser (incl. Metrics) 31.48 kB - -
@sentry/browser (incl. Logs) 31.77 kB - -
@sentry/browser (incl. Metrics & Logs) 32.45 kB - -
@sentry/react 31.78 kB - -
@sentry/react (incl. Tracing) 54.62 kB - -
@sentry/vue 38.24 kB - -
@sentry/vue (incl. Tracing) 55.24 kB - -
@sentry/svelte 29.95 kB - -
@sentry/remix (Remix 3 client bundle) 57.83 kB - -
CDN Bundle 31.72 kB - -
CDN Bundle (incl. Tracing) 52.81 kB - -
CDN Bundle (incl. Logs, Metrics) 34.52 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.32 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.9 kB - -
CDN Bundle (incl. Tracing, Replay) 90.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.11 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.71 kB - -
CDN Bundle - uncompressed 92.76 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.85 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.46 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.92 kB - -
@sentry/nextjs (client) 57.64 kB - -
@sentry/sveltekit (client) 52.73 kB - -
@sentry/core/server 44.19 kB +0.85% +371 B 🔺
@sentry/core/browser 13.93 kB - -
@sentry/node 157.07 kB +0.22% +343 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.28 kB - -
@sentry/node - without tracing 96.92 kB +0.34% +324 B 🔺
@sentry/node - without channel injection 137.36 kB +0.24% +317 B 🔺
@sentry/aws-serverless 105.5 kB +0.23% +238 B 🔺
@sentry/cloudflare (withSentry) - minified 201.54 kB +0.73% +1.45 kB 🔺
@sentry/cloudflare (withSentry) 500.19 kB +0.63% +3.1 kB 🔺
@sentry/nextjs/cloudflare (withSentry) - minified 223.4 kB +0.66% +1.45 kB 🔺

View base workflow run

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

All optional checks were successful. 13 successful. See the run.

Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 2 times, most recently from 80937ea to 05739c4 Compare November 2, 2026 21:29
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 2 times, most recently from 8290699 to 5070a1e Compare November 3, 2026 04:10
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 2 times, most recently from 2df929e to 37ff5cc Compare November 3, 2026 04:28
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 37ff5cc to d4ee2c6 Compare November 3, 2026 04:42
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from d4ee2c6 to df4b1de Compare November 3, 2026 04:45
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 4 times, most recently from f0a9f77 to e9a696a Compare November 3, 2026 05:17
@logaretm
logaretm marked this pull request as ready for review November 3, 2026 05:19
@logaretm
logaretm requested review from a team as code owners November 3, 2026 05:19
@logaretm
logaretm requested review from nicohrubec and s1gr1d and removed request for a team November 3, 2026 05:19
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 2 times, most recently from 0fd8b56 to 8afd0fe Compare November 5, 2026 21:58
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 8afd0fe to 38a15ca Compare November 6, 2026 01:56
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 38a15ca to b2ef19c Compare November 6, 2026 02:01
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check.

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from b2ef19c to 2219517 Compare November 6, 2026 03:42

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

Stale Bugbot comment from a previous run.

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 2219517 to 6737894 Compare November 6, 2026 16:16

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction is right. One place per runtime is simpler than one per framework, and the CI results show that the runtime hooks fully replace the framework hooks on Node, Bun, Deno and Cloudflare, in dev and in production. The removed code was a source of edge cases (h3 layer order, route rule headers, React Router's lazy route paths, TanStack's entry cloning), and dropping it is a real gain.

The cost is coverage. The framework hooks also served the tunnel on platforms where the SDK has no runtime hook: Vercel Edge for certain, and most likely Netlify, Nitro serverless presets, and maybe Vercel Node functions. 11.10 users on those platforms would lose a working tunnel in a minor release, and no test would notice. I'd keep the cheap framework hooks (SvelteKit handle, Astro middleware, Nitro fetch wrapper, React Router routes) as a fallback that only runs when no runtime hook answered first. I'd remove only the parts that cost something. Then I'd clean up the names that no longer describe their behavior, and test the new Astro entry injection.

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 2 times, most recently from ad545e3 to 2dab884 Compare November 6, 2026 20:04

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

Stale Bugbot comment from a previous run.

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 02bfd30 to 53c1064 Compare November 6, 2026 21:10

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 53c1064. Configure here.

import { DEBUG_BUILD } from '../common/debug-build';

// Never matches a request, for when the managed tunnel is off.
const DISABLED_TUNNEL_PATH = '/__sentry-tunnel-disabled__';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tunnel missing on serverless adapters

High Severity

These frameworks now only call setTunnelDefaults and no longer intercept the request. Runtime hooks cover node:http, Bun.serve, Deno.serve, Cloudflare withSentry, and Lambda preload. Vercel and Netlify serverless adapters export a fetch handler, so managed tunnel POSTs fall through to the app. SvelteKit, Astro, and Remix still have a cheap fallback; React Router, TanStack Start, and Nitro-based apps do not.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 53c1064. Configure here.

export { createSentryHandleError, type SentryHandleErrorOptions } from './createSentryHandleError';
export { getMetaTagTransformer } from './getMetaTagTransformer';
export { createSentryTunnelRoutes } from './tunnelRoute';
export { setTunnelBasePath as _INTERNAL_setTunnelBasePath } from './tunnelRoute';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public tunnel route helper removed

Medium Severity

createSentryTunnelRoutes was a named export from @sentry/react-router and @sentry/react-router/cloudflare. This change deletes that public function and replaces it with _INTERNAL_setTunnelBasePath, with no deprecation and no changelog note. Flagged because the review rules require deprecation or a migration callout before removing a publicly exported function.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 53c1064. Configure here.

@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch 3 times, most recently from 31cb2bd to 0b6fa6b Compare November 6, 2026 21:44
The runtimes answer managed tunnel requests before any framework sees them, so the per-framework hooks in
Astro, Nitro, Nuxt, React Router, Remix, SolidStart, SvelteKit and TanStack Start go. The frameworks only set
the tunnel's base path. Astro now initializes the server SDK from the server entry in builds, which the late
init in its middleware used to cover.
…what they do now

`createSentryTunnelRoutes` created no routes and `wrapServerEntryWithSentryTunnel` wrapped nothing since the runtime answers tunnel requests. They're now `_INTERNAL_setTunnelBasePath` and `_INTERNAL_setTunnelRoute`, which the generated code calls for their side effect.
…'s own request hook

Where no runtime hook answers tunnel requests, like on Vercel Edge, the request hook these SDKs already run is the only place left to answer them. It's one call, and where a runtime hook exists it answers first.
@logaretm
logaretm force-pushed the awad/runtime-tunnel-drop-framework-hooks branch from 0b6fa6b to e1272c3 Compare November 6, 2026 22:29
@logaretm
logaretm merged commit 5b78f8e into develop Nov 6, 2026
135 of 167 checks passed
@logaretm
logaretm deleted the awad/runtime-tunnel-drop-framework-hooks branch November 6, 2026 22:46
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.

2 participants