Turbopack server HMR: inline source maps for evaled modules#90561
Turbopack server HMR: inline source maps for evaled modules#90561wbinnssmith wants to merge 1 commit intoserver-hmr-default-implement-clearfrom
evaled modules#90561Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Tests Passed |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **400 kB** → **400 kB** ✅ -13 B80 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (2 files)Files with changes:
View diffspages-api-tu..time.prod.jsDiff too large to display pages-turbo...time.prod.jsDiff too large to display 📎 Tarball URL |
Merging this PR will not alter performance
Comparing Footnotes
|
8cd12ca to
3c19fa8
Compare
evaled modules
This adds and calls \`maybeInlineSourcemap()\` to the Turbopack Node.js HMR runtime that appends \`//# sourceURL\` and \`//# sourceMappingURL\` (base64-encoded) to each `eval`ed module entry Test Plan: CI for #90389
3c19fa8 to
65345c7
Compare
| let code = entry.code + '\n\n//# sourceURL=' + sourceURL | ||
| if (entry.map) { | ||
| code += | ||
| '\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,' + | ||
| Buffer.from(entry.map).toString('base64') |
There was a problem hiding this comment.
do we have to inline it? can we use a file reference here? sourceMappingUrl=file://...
this will slow down eval times (and hmr times) since our sourcemaps can contain source content already
There was a problem hiding this comment.
oic, entry.map is just the literal contents...
this thread implies you can just append the contents directly: https://issues.chromium.org/issues/41177554
but this is fine
|
We need a test case for this |
|
Here's some prior research about HMR sourcemaps: parcel-bundler/parcel#8034 |

Previously, we lost stack frame information when server hmr code was applied through
eval.This adds and calls `maybeInlineSourcemap()` to the Turbopack Node.js HMR runtime that appends `//# sourceURL` and `//# sourceMappingURL` (base64-encoded) to each
evaled module entry.Test Plan: CI for #90389