Skip to content

ref(server-utils): Remove unused public exports - #23382

Merged
mydea merged 7 commits into
developfrom
fn/remove-unused-server-utils-exports
Aug 13, 2026
Merged

ref(server-utils): Remove unused public exports#23382
mydea merged 7 commits into
developfrom
fn/remove-unused-server-utils-exports

Conversation

@mydea

@mydea mydea commented Aug 13, 2026

Copy link
Copy Markdown
Member

Trims 15 dead exports from @sentry/server-utils's two public barrels (src/index.ts and src/orchestrion/index.ts). Each removed export is imported by no other package — verified with an import-precise scan across the monorepo: no static import, no re-export, and no test imports them through the barrel (tests reach them via direct ../src/... paths). None are consumed by bundler-injected code, and none are re-imported through the barrel by another server-utils module.

Every underlying symbol stays defined and continues to be used internally via direct-path imports, so this only trims the public surface — no implementation is deleted, and no consumer changes.

Removed from index.ts: instrumentPrisma, defaultDbStatementSerializer, and the types PrismaInstrumentationConfig, PrismaOptions, RedisDiagnosticChannelsOptions, SentryTracingChannel, TracingChannelLifeCycleOptions, TracingChannelBindingHandle, GenAiOptions.

Removed from orchestrion/index.ts: the types KoaIntegrationOptions, IORedisChannelIntegrationOptions, IORedisResponseHook, PostgresJsIntegrationOptions, RedisChannelIntegrationOptions, RedisResponseHook.

Deliberately kept

Three exports look unused to a naive "no static importer" scan but are used somewhere, so they were left in place:

  • orchestrionModuleInjected and graphqlIntegration — consumed by bundler-injected code (require('@sentry/server-utils/orchestrion').<name>), keyed by the string exportName in the transform config. The references only real named exports of @sentry/server-utils/orchestrion unit test guards exactly this coupling.
  • CustomTransform — imported from the barrel by orchestrion/bundler/options.ts, so it is still consumed through the public entry.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.54 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.55 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.43 kB - -
@sentry/browser (incl. Tracing, Replay) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.32 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.36 kB - -
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB - -
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.73 kB - -
@sentry/vue 35.31 kB - -
@sentry/vue (incl. Tracing) 50.5 kB - -
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.87 kB - -
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.79 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB - -
CDN Bundle (incl. Tracing, Replay) 86.46 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.11 kB - -
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.72 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.08 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.34 kB - -
@sentry/nextjs (client) 53.26 kB - -
@sentry/sveltekit (client) 48.96 kB - -
@sentry/core/server 65.34 kB - -
@sentry/core/browser 51.69 kB - -
@sentry/node 117.67 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.06 kB +0.01% +1 B 🔺
@sentry/aws-serverless 91.47 kB - -
@sentry/cloudflare (withSentry) - minified 213.99 kB - -
@sentry/cloudflare (withSentry) 528.78 kB - -

View base workflow run

@mydea
mydea force-pushed the fn/remove-unused-server-utils-exports branch from 72b06ee to aba0dab Compare August 13, 2026 09:27
@mydea
mydea marked this pull request as ready for review August 13, 2026 11:19
@mydea
mydea requested review from a team as code owners August 13, 2026 11:19
@mydea
mydea requested review from JPeer264 and isaacs and removed request for a team August 13, 2026 11:19

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

LGTM. CI is failing and there are merge conflicts, but I guess overall the structure won't change

mydea and others added 7 commits August 13, 2026 14:43
Remove 15 exports from the `@sentry/server-utils` `index` and
`orchestrion/index` barrels that are imported by no other package and
not consumed via bundler injection or an internal barrel import. All
underlying symbols remain defined and internally used via direct-path
imports; only the redundant public re-exports are dropped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a `@sentry/server-utils` subsection under "Removed APIs" for the
exports that existed in the package's main entrypoint on v10 and were
removed. Orchestrion-only and post-v10 exports are intentionally omitted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
It documents internal-only exports, so it belongs below the user-facing
package entries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the fn/remove-unused-server-utils-exports branch from aba0dab to 2f5a8e3 Compare August 13, 2026 12:47
@mydea
mydea merged commit 0411432 into develop Aug 13, 2026
388 of 391 checks passed
@mydea
mydea deleted the fn/remove-unused-server-utils-exports branch August 13, 2026 13:10
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