Skip to content

feat(server-utils): initial module scaffolding#21200

Open
isaacs wants to merge 1 commit into
developfrom
isaacs/sentry-internal-server-utils
Open

feat(server-utils): initial module scaffolding#21200
isaacs wants to merge 1 commit into
developfrom
isaacs/sentry-internal-server-utils

Conversation

@isaacs
Copy link
Copy Markdown
Member

@isaacs isaacs commented May 27, 2026

This is phase 1 of the plan to move all server utils into a single reusable package that can be shared across SSJS SDKs.

Right now it does not do much, just houses the diagnostics_channel redis integrations. In subsequent steps:

  1. Code will not be moved out of @sentry/core/server into @sentry-internal/server-utils, in v10.
  2. Some or all code in @sentry/core/server may be moved into @sentry-internal/server-utils in v11, as this would be breaking change. (Redis channel integration was not, because it hasn't yet shipped in a release. Other high-level portable components may move over later, if justified.)
  3. No components will ever live in both places, because server-utils depends on core, and that would create a type dependency cycle.

@sentry/core/server will live on for at least v10, possibly into v11. New server components will be placed in @sentry-internal/server-utils.

fix: #21222
fix: JS-2631

@isaacs isaacs requested review from JPeer264 and Lms24 May 27, 2026 19:43
@isaacs isaacs marked this pull request as draft May 27, 2026 20:21
@isaacs
Copy link
Copy Markdown
Member Author

isaacs commented May 27, 2026

Actually it looks like this might not be possible without a breaking change, because the cycles will end up confounding TSC when it builds our code, as core and server-utils would depend on one another for types. The only option would be to shim everything, which gets pretty gross.

@JPeer264
Copy link
Copy Markdown
Member

because the cycles will end up confounding TSC when it builds our code, as core and server-utils would depend on one another for types

Couldn't we just prepare to move them in a separate folder right now and in v11 we just move the folder into its own package?

@isaacs
Copy link
Copy Markdown
Member Author

isaacs commented May 29, 2026

Couldn't we just prepare to move them in a separate folder right now and in v11 we just move the folder into its own package?

Right, so that would kind of be the combination of the (3) and (1) options I discussed in #21222. (That is, put everything in @sentry/core/server for v10 (option 3), then move the entire @sentry/core/server into @sentry-internal/server-utils in v11 as a breaking change, (option 1).)

But, there's not much hazard in creating the server-utils package now, but not removing anything from core (only putting stuff in server-utils in v10 that is net new), and migrating exisitng @sentry/core/server things over to it as we decide we want to in v11 as a breaking change (options 2 and 3). That lets us prove the concept a bit better right away, I think.

isaacs added a commit that referenced this pull request May 29, 2026
This is phase 1 of the plan to move all server utils into a single
reusable package that can be shared across SSJS SDKs.

Right now it does not do much, just houses the `diagnostics_channel`
redis integrations. In subsequent steps:

1. Code will *not* be moved out of `@sentry/core/server` into
   `@sentry-internal/server-utils`, in v10.
2. Some or all code in `@sentry/core/server` may be moved into
   `@sentry-internal/server-utils` in v11, as this would be breaking
   change. (Redis channel integration was not, because it hasn't yet
   shipped in a release. Other high-level portable components may move
   over later, if justified.)
3. No components will ever live in *both* places, because `server-utils`
   depends on `core`, and that would create a type dependency cycle.

`@sentry/core/server` will live on for at least v10, possibly
into v11. New server components will be placed in
`@sentry-internal/server-utils`.
@isaacs isaacs force-pushed the isaacs/sentry-internal-server-utils branch from 4aee846 to 67a409f Compare May 29, 2026 21:19
@isaacs isaacs changed the title feat(server-utils): initial module scaffolding feat(server-utils): initial module scaffolding (#21200) May 29, 2026
@isaacs isaacs changed the title feat(server-utils): initial module scaffolding (#21200) feat(server-utils): initial module scaffolding May 29, 2026
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 29, 2026

JS-2631

isaacs added a commit that referenced this pull request May 29, 2026
This is phase 1 of the plan to move all server utils into a single
reusable package that can be shared across SSJS SDKs.

Right now it does not do much, just houses the `diagnostics_channel`
redis integrations. In subsequent steps:

1. Code will *not* be moved out of `@sentry/core/server` into
   `@sentry-internal/server-utils`, in v10.
2. Some or all code in `@sentry/core/server` may be moved into
   `@sentry-internal/server-utils` in v11, as this would be breaking
   change. (Redis channel integration was not, because it hasn't yet
   shipped in a release. Other high-level portable components may move
   over later, if justified.)
3. No components will ever live in *both* places, because `server-utils`
   depends on `core`, and that would create a type dependency cycle.

`@sentry/core/server` will live on for at least v10, possibly into v11.
New server components will be placed in `@sentry-internal/server-utils`.

fix: #21222
fix: JS-2631
@isaacs isaacs force-pushed the isaacs/sentry-internal-server-utils branch from 67a409f to b332298 Compare May 29, 2026 21:23
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.17 kB - -
@sentry/browser - with treeshaking flags 25.62 kB - -
@sentry/browser (incl. Tracing) 45.25 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.47 kB - -
@sentry/browser (incl. Tracing, Profiling) 50.22 kB - -
@sentry/browser (incl. Tracing, Replay) 84.83 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.39 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 89.53 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.15 kB - -
@sentry/browser (incl. Feedback) 44.34 kB - -
@sentry/browser (incl. sendFeedback) 31.98 kB - -
@sentry/browser (incl. FeedbackAsync) 37.08 kB - -
@sentry/browser (incl. Metrics) 28.25 kB - -
@sentry/browser (incl. Logs) 28.48 kB - -
@sentry/browser (incl. Metrics & Logs) 29.19 kB - -
@sentry/react 28.99 kB - -
@sentry/react (incl. Tracing) 47.51 kB - -
@sentry/vue 32.2 kB - -
@sentry/vue (incl. Tracing) 47.16 kB - -
@sentry/svelte 27.19 kB - -
CDN Bundle 29.55 kB - -
CDN Bundle (incl. Tracing) 47.81 kB - -
CDN Bundle (incl. Logs, Metrics) 31.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.04 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.31 kB - -
CDN Bundle (incl. Tracing, Replay) 85.18 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.35 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.05 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.21 kB - -
CDN Bundle - uncompressed 87.59 kB - -
CDN Bundle (incl. Tracing) - uncompressed 144.09 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.08 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.85 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 216.81 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.87 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.3 kB - -
@sentry/nextjs (client) 50.03 kB - -
@sentry/sveltekit (client) 45.68 kB - -
@sentry/core/server 75.93 kB -0.83% -628 B 🔽
@sentry/core/browser 63.09 kB - -
@sentry/node-core 61.68 kB -0.01% -1 B 🔽
@sentry/node 130.54 kB +0.03% +28 B 🔺
@sentry/node - without tracing 74.09 kB - -
@sentry/aws-serverless 86.29 kB - -
@sentry/cloudflare (withSentry) - minified 171.64 kB - -
@sentry/cloudflare (withSentry) 429.7 kB - -

View base workflow run

@isaacs isaacs marked this pull request as ready for review May 29, 2026 21:44
@isaacs isaacs requested a review from a team as a code owner May 29, 2026 21:44
@isaacs isaacs requested review from andreiborza and removed request for a team May 29, 2026 21:44
This is phase 1 of the plan to move all server utils into a single
reusable package that can be shared across SSJS SDKs.

Right now it does not do much, just houses the `diagnostics_channel`
redis integrations. In subsequent steps:

1. Code will *not* be moved out of `@sentry/core/server` into
   `@sentry-internal/server-utils`, in v10.
2. Some or all code in `@sentry/core/server` may be moved into
   `@sentry-internal/server-utils` in v11, as this would be breaking
   change. (Redis channel integration was not, because it hasn't yet
   shipped in a release. Other high-level portable components may move
   over later, if justified.)
3. No components will ever live in *both* places, because `server-utils`
   depends on `core`, and that would create a type dependency cycle.

`@sentry/core/server` will live on for at least v10, possibly into v11.
New server components will be placed in `@sentry-internal/server-utils`.

fix: #21222
fix: JS-2631
@isaacs isaacs force-pushed the isaacs/sentry-internal-server-utils branch from 1e2b91f to 39f2781 Compare May 30, 2026 02: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.

Create @sentry-internal/server-utils to house server-specific SDK components

2 participants