Skip to content

Commit 3bb3d6e

Browse files
committed
remove bun custom stuff
1 parent 3d42d2c commit 3bb3d6e

2 files changed

Lines changed: 1 addition & 165 deletions

File tree

‎packages/server-utils/src/orchestrion/bundler/bun.ts‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/bun';
22
import { instrumentedModuleNames, withoutInstrumentedExternals } from '../config';
3-
import { jscSafeConstructorTransform } from './jscSafeConstructor';
43
import { ORCHESTRION_BUNDLER_MARKER_BANNER } from './moduleInjectedTransform';
54
import type { PluginOptions } from './options';
65
import { orchestrionTransformOptions } from './options';
@@ -41,26 +40,11 @@ export function sentryOrchestrionPlugin(options: PluginOptions = {}): UnknownPlu
4140
// the transformer's own `injectDiagnostics` — Bun injects the marker banner via its native
4241
// `banner` config below (which, unlike the upstream path, needs no `outdir`).
4342
//
44-
// Override the built-in `traceSync` operator with the JSC-safe variant: Bun runs on
45-
// JavaScriptCore, which rejects the default constructor instrumentation for DERIVED classes (e.g.
46-
// `class Hono extends HonoBase`) because it reads `this` in a `finally` that doesn't lexically
47-
// enclose `super()`. The override relocates that capture; it is a no-op for everything else, and
48-
// is wired here (not in the shared options) because JSC is the only engine that needs it.
49-
//
50-
// This is ideally fixed upstream in the code transformer (so the default output is JSC-safe
51-
// everywhere). It also only works because Bun instrumentation is BUILD-time today: this transform
52-
// runs in the bundler. If/when Bun runtime instrumentation lands (see the class doc above — it
53-
// does not exist yet), that path would use the built-in `traceSync` and start crashing again, so
54-
// the upstream fix becomes necessary. For now, build-only Bun means this is sufficient.
55-
//
5643
// Typed upstream as an esbuild `Plugin`, but Bun passes its own `PluginBuilder` (which has the
5744
// `onLoad` the transform uses) to `setup`. Cast to the Bun-compatible shape so we can forward
5845
// Bun's builder to its `setup`.
5946
const transformer = codeTransformer(
60-
orchestrionTransformOptions(
61-
{ ...options, customTransforms: { ...options.customTransforms, traceSync: jscSafeConstructorTransform } },
62-
{ injectDiagnostics: false },
63-
),
47+
orchestrionTransformOptions(options, { injectDiagnostics: false }),
6448
) as unknown as {
6549
setup: (build: BunPluginBuilder) => void;
6650
};

‎packages/server-utils/src/orchestrion/bundler/jscSafeConstructor.ts‎

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)