Skip to content

Comments

Add initial bundler plugin#768

Open
timokoessler wants to merge 32 commits intomainfrom
bundler-support
Open

Add initial bundler plugin#768
timokoessler wants to merge 32 commits intomainfrom
bundler-support

Conversation

@timokoessler
Copy link
Member

@timokoessler timokoessler commented Sep 30, 2025

Todos

  • Add an agent mode during bundling that e.g. does not report to API
  • Fix SCA reporting of dependencies
  • Zen can not be disabled completely at runtime in bundling mode (?)
  • Write docs
  • Supported bundlers
    • Esbuild
    • Rolldown
  • Check on runtime if the same agent version is used
  • Do not require output dir if copy Files is false

Future Todos

  • Supported bundlers
    • Vite (e.g. Nuxt, Astro, Remix ...)
    • Webpack (e.g. old Next.js)
    • Rollup
    • ...
  • Sourcemaps?

Summary by Aikido

⚠️ Security Issues: 2 🔍 Quality Issues: 10 Resolved Issues: 0

🚀 New Features

  • Added initial bundler plugin with esbuild and rolldown support

⚡ Enhancements

  • Modified instrumentation transformer to inject bundling-specific helper calls
  • Added bundling mode flags to agent/hooks to skip runtime hooks during bundling
  • Updated ESM test script and package.json to include bundler dev dependencies

More info

@timokoessler timokoessler changed the base branch from main to new-instrumentation September 30, 2025 09:29
@codecov
Copy link

codecov bot commented Sep 30, 2025

Base automatically changed from new-instrumentation to main November 7, 2025 13:10
@timokoessler timokoessler changed the base branch from main to new-build-process November 13, 2025 13:56
@timokoessler timokoessler changed the base branch from new-build-process to main January 29, 2026 17:07
@timokoessler timokoessler changed the title Bundler support (POC) Add initial bundler plugin Jan 30, 2026
@timokoessler timokoessler marked this pull request as ready for review January 30, 2026 16:05
pkgVersion: string | undefined = undefined
) {
const moduleInfo = getModuleInfoFromPath(path);
moduleInfo ??= getModuleInfoFromPath(path);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reassigning function parameter 'moduleInfo' with 'moduleInfo ??= getModuleInfoFromPath(path)'. Use a new local variable or default parameter instead.

Details

✨ AI Reasoning
​The patch introduced nullish-coalescing assignments to function parameters inside the patched function. Reassigning incoming parameters can obscure the original argument values and confuse callers and maintainers. The changes specifically set defaults by mutating parameters rather than using local variables or default parameters. This harms clarity and maintainability and was introduced in this diff.

🔧 How do I fix it?
Create new local variables instead of reassigning parameters. Use different variable names to clearly distinguish between input and modified values.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

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.

1 participant