Repository navigation
ref(server-utils): Add shared isBun, isDeno and isCloudflareWorkers helpers - #26111
Merged
Merged
Conversation
mydea
marked this pull request as ready for review
November 4, 2026 16:15
mydea
requested review from
andreiborza,
chargome,
isaacs and
s1gr1d
and removed request for
a team
November 4, 2026 16:15
Contributor
size-limit report 📦Compared: d219172 (PR test merge using develop at 726e947) Against: 726e947 (develop) · base run #65449 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 8 not successful, 47 successful. See the run.
Successful checks
|
chargome
approved these changes
Nov 5, 2026
…elpers Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
…ogen build Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
Co-Authored-By: Francesco Gringl-Novy <francesco.novy@sentry.io>
sentry-junior
Bot
force-pushed
the
feat/server-utils-runtime-helpers
branch
from
November 10, 2026 08:09
893b402 to
ac00c0b
Compare
mydea
enabled auto-merge (squash)
November 10, 2026 08:13
51 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Bun/Deno/Cloudflare detection was hand-rolled in several places with slightly different checks (
typeof Bun,process.versions.bun, inlineuserAgent === 'Cloudflare-Workers'). This addsisBun(),isDeno()andisCloudflareWorkers()to@sentry/server-utils(exported from the sharedexports.ts, so they are also available from/no-diagnostic-channels) and uses them in server-utils, bun and astro.They are functions rather than module-level consts so unused ones tree-shake cleanly and the check runs when called, not at import. Hono's runtime is now resolved per call instead of at module load.
How to review: Start with
server-utils/src/utils/runtime.ts; the rest are mechanical call-site swaps.Unsure about: Intentionally left alone:
remix(isCloudflareEnv): importing from server-utils, even/no-diagnostic-channels, pullsnode:async_hooksinto the Hydrogen build and broke theremix-hydrogenE2E, so remix keeps its local checkelysia(no server-utils dependency, didn't want to add one)nextjsresponseEnd.ts(nextjs doesn't import the server-utils barrel at runtime today)server-runtime-injection/register.ts(runs at--importtime and only pulls theorchestrion/configsubpath, importing the main barrel there seemed risky)bun/src/sdk.ts(typeof Bunis needed to narrow forBun.version)Build-time/static detection (export conditions or a
defineflag for Cloudflare) is a possible follow-up, not part of this PR.Bun's own test suite wasn't run locally (no Bun binary in my environment); the change there is
process.versions.bun→isBun().--
View Session [Sentry]