-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trace output's source maps through input's source map #6494
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Ignored Deployments
|
✅ This change can build |
🟢 CI successful 🟢Thanks |
🟢 Turbopack Benchmark CI successful 🟢Thanks |
/// Confusingly, SWC's SourceMap is not a mapping of transformed locations | ||
/// to source locations. I don't know what it is, really, but it's not | ||
/// that. | ||
/// to source locations. It's a map of filesnames to file contents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
/// original tokens. Useful for cases like mapping tokens from a minified | ||
/// chunk back to its original sources. | ||
#[turbo_tasks::function] | ||
pub async fn trace(self: Vc<Self>, other: Vc<SourceMap>) -> Result<Vc<SourceMap>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need that for the next.js source map resolving from the error overlay?
let mut source_map = None; | ||
for map in self.source_maps { | ||
if let Some(map) = &*map.await? { | ||
source_map = Some(map.resolve().await?); | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we collecting multiple Source Maps, when we only use the first one?
And: Should be use the last one instead?
Linux Benchmark for 4f979f0Click to view benchmark
|
Linux Benchmark for f3d351fClick to view benchmark
|
### What? Update SWC crates ### Why? It's required to fix some next.js isssues ### How? Closes PACK-2174 Turbopack counterpart: vercel/turborepo#6843 --- # Turbopack * vercel/turborepo#6737 <!-- Nicholas Yang - feat: Nice errors for shim flag parsing --> * vercel/turborepo#6494 <!-- Justin Ridgewell - Trace output's source maps through input's source map --> * vercel/turborepo#6778 <!-- Will Binns-Smith - turbopack-css: fix rule duplication --> * vercel/turborepo#6807 <!-- Mehul Kar - fix: add missing dependency to cargo lockfile --> * vercel/turborepo#6809 <!-- Nicholas Yang - refactor: Remove bookkeeping abstraction from turbo config --> * vercel/turborepo#6838 <!-- Nicholas Yang - fix: Allow for long symlinks by using append_link --> * vercel/turborepo#6845 <!-- Donny/강동윤 - perf: Use `&'static str` instead of `String` if possible --> * vercel/turborepo#6843 <!-- Donny/강동윤 - Update `swc_core` to `v0.87.10` -->
### What? Update SWC crates ### Why? It's required to fix some next.js isssues ### How? Closes PACK-2174 Turbopack counterpart: vercel/turborepo#6843 --- # Turbopack * vercel/turborepo#6737 <!-- Nicholas Yang - feat: Nice errors for shim flag parsing --> * vercel/turborepo#6494 <!-- Justin Ridgewell - Trace output's source maps through input's source map --> * vercel/turborepo#6778 <!-- Will Binns-Smith - turbopack-css: fix rule duplication --> * vercel/turborepo#6807 <!-- Mehul Kar - fix: add missing dependency to cargo lockfile --> * vercel/turborepo#6809 <!-- Nicholas Yang - refactor: Remove bookkeeping abstraction from turbo config --> * vercel/turborepo#6838 <!-- Nicholas Yang - fix: Allow for long symlinks by using append_link --> * vercel/turborepo#6845 <!-- Donny/강동윤 - perf: Use `&'static str` instead of `String` if possible --> * vercel/turborepo#6843 <!-- Donny/강동윤 - Update `swc_core` to `v0.87.10` -->
…po#6494) ### Description This preserves an input file's original source map so that the transformed output source map can be traced through it. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-1980 Closes PACK-537 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
…po#6494) ### Description This preserves an input file's original source map so that the transformed output source map can be traced through it. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-1980 Closes PACK-537 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
…po#6494) ### Description This preserves an input file's original source map so that the transformed output source map can be traced through it. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-1980 Closes PACK-537 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
…po#6494) ### Description This preserves an input file's original source map so that the transformed output source map can be traced through it. ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-1980 Closes PACK-537 --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com> Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
Description
This preserves an input file's original source map so that the transformed output source map can be traced through it.
Testing Instructions
Closes PACK-1980
Closes PACK-537