Skip to content

ref(core)!: Remove orphaned deprecated Express patch APIs - #23827

Merged
mydea merged 1 commit into
developfrom
fn/remove-orphaned-express-from-core
Sep 7, 2026
Merged

ref(core)!: Remove orphaned deprecated Express patch APIs#23827
mydea merged 1 commit into
developfrom
fn/remove-orphaned-express-from-core

Conversation

@mydea

@mydea mydea commented Sep 1, 2026

Copy link
Copy Markdown
Member

Removes the deprecated, unused Express patch APIs from @sentry/core/server:

  • the patchExpressModule helper and the whole integrations/express/* module tree
  • the ExpressIntegrationOptions, ExpressMiddleware, and ExpressErrorMiddleware types

These were kept behind a "deprecated, kept until the next major" comment, but nothing actually uses them: there is no runtime caller of patchExpressModule anywhere in the repo, and @sentry/server-utils ships its own Express integration (expressIntegration) with its own local copies of the middleware types. The only references left were core's own unit tests, which are removed alongside the source.

Marked with ! because these were exported symbols on the public @sentry/core/server entrypoint, even though they were deprecated and unused.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 28.8 kB - -
@sentry/browser - with treeshaking flags 27.11 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27 kB - -
@sentry/browser (incl. Tracing) 49.22 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.12 kB - -
@sentry/browser (incl. Tracing, Replay) 88.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.95 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.44 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.37 kB - -
@sentry/browser (incl. Feedback) 46.3 kB - -
@sentry/browser (incl. sendFeedback) 33.86 kB - -
@sentry/browser (incl. FeedbackAsync) 38.97 kB - -
@sentry/browser (incl. Metrics) 29.82 kB - -
@sentry/browser (incl. Logs) 30.09 kB - -
@sentry/browser (incl. Metrics & Logs) 30.75 kB - -
@sentry/react 30.55 kB - -
@sentry/react (incl. Tracing) 51.42 kB - -
@sentry/vue 36.05 kB - -
@sentry/vue (incl. Tracing) 51.48 kB - -
@sentry/svelte 28.83 kB - -
CDN Bundle 30.55 kB - -
CDN Bundle (incl. Tracing) 49.74 kB - -
CDN Bundle (incl. Logs, Metrics) 32.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.7 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.48 kB - -
CDN Bundle (incl. Tracing, Replay) 87.29 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.21 kB - -
CDN Bundle - uncompressed 90.46 kB - -
CDN Bundle (incl. Tracing) - uncompressed 148.17 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.03 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 154.14 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 226.29 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.76 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 287.4 kB - -
@sentry/nextjs (client) 54.03 kB - -
@sentry/sveltekit (client) 49.65 kB - -
@sentry/core/server 36.99 kB -4.25% -1.64 kB 🔽
@sentry/core/browser 13.55 kB - -
@sentry/node 127.63 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.58 kB - -
@sentry/node - without tracing 88.71 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 106.9 kB +0.02% +18 B 🔺
@sentry/aws-serverless 97.1 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 201.91 kB - -
@sentry/cloudflare (withSentry) 502.4 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review September 1, 2026 11:58
@mydea
mydea force-pushed the fn/remove-orphaned-express-from-core branch from 64795c2 to 5b38842 Compare September 2, 2026 12:22

@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 1 potential issue.

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 5b38842. Configure here.

export { flushIfServerless } from './utils/flushIfServerless';
export { callFrameToStackFrame, watchdogTimer } from './utils/anr';
export { safeUnref as _INTERNAL_safeUnref } from './utils/timer';
/* oxlint-disable typescript/no-deprecated -- deprecated Express exports, kept until the next major */

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 APIs removed without migration notes

Medium Severity

This change drops the public patchExpressModule, ExpressMiddleware, and ExpressErrorMiddleware exports from @sentry/core/server without a changelog or migration callout. This was flagged because the review rules treat public API removals and undocumented breaking changes as critical. MIGRATION.md still calls patchExpressModule deprecated and tells users to keep using it.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

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

Removes the `patchExpressModule` helper, the `integrations/express/*` modules and
the `ExpressIntegrationOptions` / `ExpressMiddleware` / `ExpressErrorMiddleware`
types from `@sentry/core/server`.

These were kept around behind a deprecation comment but are entirely unused:
nothing in the codebase calls `patchExpressModule`, and `@sentry/server-utils`
ships its own Express integration with its own local types. The only remaining
references were core's own tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the fn/remove-orphaned-express-from-core branch from 5b38842 to 253af56 Compare September 7, 2026 12:30
@mydea
mydea enabled auto-merge (squash) September 7, 2026 12:31
@mydea
mydea merged commit d12e188 into develop Sep 7, 2026
303 of 305 checks passed
@mydea
mydea deleted the fn/remove-orphaned-express-from-core branch September 7, 2026 12:44
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