Skip to content

refactor(bundlers): delegate wrappers to import-in-the-middle - #10262

Draft
BridgeAR wants to merge 1 commit into
masterfrom
BridgeAR/2026-09-08-iitm-bundler-api-v2
Draft

BridgeAR wants to merge 1 commit into
masterfrom
BridgeAR/2026-09-08-iitm-bundler-api-v2

Conversation

@BridgeAR

@BridgeAR BridgeAR commented Sep 9, 2026

Copy link
Copy Markdown
Member

Separate wrappers for Webpack, esbuild, and Turbopack duplicate export discovery, live-binding, and CommonJS replacement behavior. Their behavior can drift from import-in-the-middle and from each other.

This delegates those contracts to import-in-the-middle's experimental bundler API. dd-trace-js still owns bundler resolution, instrumentation metadata, source-map composition, and watch-file integration.

This draft depends on nodejs/import-in-the-middle#270.

@dd-octo-sts

dd-octo-sts Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.89 MB
Deduped: 9.94 MB
No deduping: 9.94 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.5.0 | 442.82 kB | 828.77 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.52%. Comparing base (1a21dd3) to head (0fd9965).

❗ There is a different number of reports uploaded between BASE (1a21dd3) and HEAD (0fd9965). Click for more details.

HEAD has 17 uploads less than BASE
Flag BASE (1a21dd3) HEAD (0fd9965)
master-coverage 12 0
platform 1 0
llmobs 1 0
appsec 1 0
apm-integrations 1 0
test-optimization 1 0
Additional details and impacted files
@@                                Coverage Diff                                 @@
##           BridgeAR/2026-08-28-turbopack-instrumentation   #10262       +/-   ##
==================================================================================
- Coverage                                          98.71%   69.52%   -29.19%     
==================================================================================
  Files                                               1013      986       -27     
  Lines                                             160794   152589     -8205     
  Branches                                              74       26       -48     
==================================================================================
- Hits                                              158728   106092    -52636     
- Misses                                              2066    46497    +44431     
Flag Coverage Δ
ai-guard 65.23% <71.60%> (+0.06%) ⬆️
apm-capabilities 63.74% <88.88%> (+0.03%) ⬆️
apm-integrations ?
appsec ?
debugger 69.91% <82.71%> (+0.08%) ⬆️
instrumentation 54.17% <100.00%> (-0.19%) ⬇️
llmobs ?
master-coverage ?
openfeature 66.47% <71.60%> (+0.06%) ⬆️
platform ?
profiling 66.82% <71.60%> (+0.06%) ⬆️
serverless 65.80% <100.00%> (+0.08%) ⬆️
test-optimization ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-prod-us1-3

This comment has been minimized.

@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-08-28-turbopack-instrumentation branch from 8e27ae6 to 710e3a4 Compare September 9, 2026 14:47
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-09-08-iitm-bundler-api-v2 branch from 862411d to 0fd9965 Compare September 9, 2026 19:37
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-08-28-turbopack-instrumentation branch 2 times, most recently from d899dbf to 8cd78ff Compare September 10, 2026 02:16
Separate bundler wrappers duplicated export discovery, live-binding, and CommonJS replacement semantics, allowing their behavior to drift from runtime instrumentation. Delegate those contracts to import-in-the-middle while retaining bundler-specific resolution, target selection, and source maps.
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-09-08-iitm-bundler-api-v2 branch from 0fd9965 to cbf1942 Compare September 11, 2026 18:26
@BridgeAR
BridgeAR changed the base branch from BridgeAR/2026-08-28-turbopack-instrumentation to master September 11, 2026 18:27
@pr-commenter

pr-commenter Bot commented Sep 11, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-11 18:44:24

Comparing candidate commit cbf1942 in PR branch BridgeAR/2026-09-08-iitm-bundler-api-v2 with baseline commit 1a27b21 in branch master.

📊 Benchmarking dashboard

Found 1 performance improvements and 0 performance regressions! Performance is the same for 2306 metrics, 6 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:startup-with-tracer-everything-esm-24

  • 🟩 max_rss_usage [-8.886MB; -4.541MB] or [-4.190%; -2.141%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-appsec-enabled-24

  • unstable max_rss_usage [-25.842MB; +9.376MB] or [-9.062%; +3.288%]

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-14.601MB; +30.614MB] or [-6.337%; +13.286%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-9.359MB; +6.864MB] or [-12.435%; +9.120%]

scenario:llmobs-encode-unicode-mixed-20

  • unstable max_rss_usage [-6.433MB; +9.931MB] or [-8.235%; +12.713%]

scenario:plugin-graphql-long-with-depth-off-26

  • unstable max_rss_usage [-24.253MB; +31.522MB] or [-11.812%; +15.352%]

scenario:plugin-graphql-long-with-depth-on-max-26

  • unstable max_rss_usage [-6.509MB; +40.533MB] or [-2.723%; +16.955%]

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