Skip to content

fix(auto-instrumentation): Upgrade @apm-js-collab/code-transformer to v0.11.0#1708

Open
Stephen Belanger (Qard) wants to merge 2 commits intomainfrom
upgrade-orchestrion-0.11
Open

fix(auto-instrumentation): Upgrade @apm-js-collab/code-transformer to v0.11.0#1708
Stephen Belanger (Qard) wants to merge 2 commits intomainfrom
upgrade-orchestrion-0.11

Conversation

@Qard
Copy link
Copy Markdown
Contributor

Summary

  • Upgrades @apm-js-collab/code-transformer from ^0.9.0 to ^0.11.0, picking up the v0.11.0 JS rewrite (replaces the previous WASM-based transformer)
  • Fixes the ESM loader hook to pass the correct module type (esm/cjs/unknown) based on Node.js loader format, instead of always passing "unknown" — this was causing CJS require() to be injected into ESM (.mjs) files
  • Removes tracePromise assertions from transformation tests (implementation detail of the old WASM output; the new JS transformer uses runStores instead)
  • Bumps dc-browser to v1.0.4, which adds a default export to match Node.js CJS-ESM interop behaviour required by the diagnostics_channel-based wrappers

Test plan

  • All unit tests pass (pnpm test in js/)
  • Transformation tests pass (esbuild, vite, webpack, rollup bundlers)
  • Loader hook integration tests pass (ESM + CJS)
  • End-to-end tests pass (Anthropic, OpenAI with mock fetch)

🤖 Generated with Claude Code

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 31, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

Stephen Belanger (Qard) and others added 2 commits April 1, 2026 01:48
…r v0.11.0 JS rewrite

- Bump version range to >=0.9.0 to pick up v0.11.0 when released
- Fix ESM loader hook to pass correct module type (esm/cjs/unknown) from
  Node.js loader format instead of always passing "unknown", which caused
  CJS require() to be injected into ESM files
- Remove tracePromise assertions from transformation tests (implementation
  detail of old WASM output; new JS version uses runStores instead)
- Clean up "WASM transformer" wording in comments

Tested against nodejs/orchestrion-js main branch. The browser-mode tests
(dc-browser) require apm-js-collab/dc-browser#3 to be merged and released
first, since dc-browser was missing a default export to match
node:diagnostics_channel's CJS-ESM interop behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.0.4 adds a default export to match Node.js CJS-ESM interop
behaviour, which is required for the diagnostics_channel-based
wrappers to work correctly in mixed ESM/CJS projects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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