feat(turbopack): instrument bundled dependencies - #10047
Conversation
Turbopack compiles dependency modules before runtime hooks can observe their exports. Build-time plans and live-binding proxies preserve instrumentation without adding discovery or source analysis to the request path.
Overall package sizeSelf size: 8.64 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | enhanced-resolve | 5.24.5 | 420.33 kB | 526.29 kB | | import-in-the-middle | 3.4.0 | 127.33 kB | 447.04 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 |
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 276c51f | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10047 +/- ##
==========================================
+ Coverage 98.60% 98.66% +0.06%
==========================================
Files 992 998 +6
Lines 149800 151984 +2184
Branches 12758 12777 +19
==========================================
+ Hits 147704 149953 +2249
+ Misses 2096 2031 -65
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-08-31 15:49:24 Comparing candidate commit 276c51f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2296 metrics, 14 unstable metrics.
|
1. Clean installs hoisted Babel 8's ESM parser into the CommonJS fake Next compiler because its Babel 7 inputs were only transitive dependencies. 2. Bun applied the root files allowlist to nested READMEs while npm included them automatically, so the package archives differed.
Backport CI widens the repository engine range to include Node 18 and 20. The test then loads ESLint 10 on unsupported runtimes, which fail while parsing its /v regular expressions.
Turbopack bundles server dependencies before runtime module hooks can observe them. This adds
withDatadogTurbopack, which creates a content-addressed build plan and adds Node-only loader rules.CommonJS targets publish replaceable exports through the existing bundler channel. ESM targets use generated live-binding proxies. The loader uses Turbopack resolution, so application aliases and conditions remain authoritative.
Source hashes prevent stale plans from instrumenting changed dependencies. Target discovery and source analysis stay outside the application request path.