GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server-utils): Fix orchestrion source maps of instrumented modules by JPeer264 · Pull Request #25772 · getsentry/sentry-javascript

fix(server-utils): Fix orchestrion source maps of instrumented modules #25772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Lms24 merged 2 commits into develop from jp/orchestrion-transform-sourcemap-sources
Oct 29, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(server-utils): Fix orchestrion source maps of instrumented modules #25772

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
4cb3512
fix(server-utils): Fix orchestrion source maps of instrumented modules
JPeer264 Oct 27, 2026
01cce50
chore(server-runtime-injection): Bump @apm-js-collab/code-transformer…
Lms24 Oct 29, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

4 changes: 2 additions & 2 deletions 4 packages/server-runtime-injection/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@sentry/server-utils": "11.10.0"
},
"devDependencies": {
"@apm-js-collab/code-transformer": "^0.18.1",
"@apm-js-collab/tracing-hooks": "^0.13.3",
"@apm-js-collab/code-transformer": "^0.19.0",
"@apm-js-collab/tracing-hooks": "^0.14.0",
"@sentry-internal/rollup-utils": "11.10.0",
"@types/node": "^20.19.0",
"@vercel/nft": "^1.11.0",
Expand Down
2 changes: 1 addition & 1 deletion 2 packages/server-utils/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"@sentry/core": "11.10.0"
},
"devDependencies": {
"@apm-js-collab/code-transformer-bundler-plugins": "^0.7.4",
"@apm-js-collab/code-transformer-bundler-plugins": "^0.7.5",
"@neondatabase/serverless": "1.2.0",
"@sentry-internal/rollup-utils": "11.10.0",
"@types/node": "^20.19.0",
Expand Down
7 changes: 5 additions & 2 deletions 7 packages/server-utils/src/orchestrion/bundler/webpack.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTran

// Explicitly annotated with the vendored types so the emitted declaration doesn't reference
// `@apm-js-collab/code-transformer-bundler-plugins` — a bundled devDependency consumers don't have.
export const serializeInstrumentations: (configs: AnyInstrumentationConfig[]) => SerializableInstrumentationConfig[] =
serializeInstrumentationsImpl;
// Upstream also allows a function in `transform`. The vendored configs only allow a string there,
// and the serializer copies `transform` unchanged, so its output only contains strings too.
export const serializeInstrumentations = serializeInstrumentationsImpl as (
configs: AnyInstrumentationConfig[],
) => SerializableInstrumentationConfig[];
export type { SerializableInstrumentationConfig } from '../apmTypes';

export { getOrchestrionLoaderPath, resolveOrchestrionRuntimeRequest };
Expand Down
2 changes: 1 addition & 1 deletion 2 packages/server-utils/test/orchestrion/config.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { InstrumentationConfig } from '@apm-js-collab/code-transformer-bundler-plugins/core';
import type { InstrumentationConfig } from '../../src/orchestrion/apmTypes';
import { describe, expect, it } from 'vitest';
import {
getInstrumentedModuleNames,
Expand Down
59 changes: 59 additions & 0 deletions 59 packages/server-utils/test/orchestrion/sourcemap.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { build, type Plugin, type Rollup } from 'vite';
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import type { InstrumentationConfig } from '../../src/orchestrion/apmTypes';
import { sentryOrchestrionPlugin as sentryOrchestrionRollupPlugin } from '../../src/orchestrion/bundler/rollup';
import { sentryOrchestrionPlugin as sentryOrchestrionVitePlugin } from '../../src/orchestrion/bundler/vite';

const instrumentations: InstrumentationConfig[] = [
{
channelName: 'query',
module: { name: 'fake-db', versionRange: '>=1.0.0', filePath: 'index.js' },
functionQuery: { expressionName: 'query', kind: 'Sync' },
},
];

describe('orchestrion bundler plugins source maps', () => {
let root: string;

beforeAll(() => {
root = mkdtempSync(join(tmpdir(), 'orchestrion-sourcemap-'));
const packageDir = join(root, 'node_modules', 'fake-db');
mkdirSync(packageDir, { recursive: true });
writeFileSync(join(packageDir, 'package.json'), JSON.stringify({ name: 'fake-db', version: '1.0.0' }));
writeFileSync(join(packageDir, 'index.js'), 'exports.query = function query(sql) {\n return sql;\n};\n');
writeFileSync(
join(root, 'server.js'),
"import { query } from 'fake-db';\nexport const run = () => query('SELECT 1');\n",
);
});

afterAll(() => rmSync(root, { recursive: true, force: true }));

// https://github.com/getsentry/sentry-javascript/issues/25329
it.each([
['vite', () => sentryOrchestrionVitePlugin({ instrumentations })],
['rollup', () => sentryOrchestrionRollupPlugin({ instrumentations }) as Plugin],
])('maps the transformed module only to its file in node_modules (%s plugin)', async (_name, createPlugin) => {
const output = (await build({
root,
configFile: false,
logLevel: 'silent',
plugins: [createPlugin()],
ssr: { noExternal: ['fake-db'] },
build: {
ssr: 'server.js',
sourcemap: true,
write: false,
rollupOptions: { external: ['@sentry/server-utils'] },
},
})) as Rollup.RollupOutput;

const chunk = output.output[0];

expect(chunk.code).toContain('orchestrion:fake-db:query');
expect(chunk.map?.sources).toEqual(['../node_modules/fake-db/index.js', '../server.js']);
});
});
34 changes: 17 additions & 17 deletions 34 pnpm-lock.yaml
Show comments
View file
Open in desktop

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.