-
Notifications
You must be signed in to change notification settings - Fork 100
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
[WIP] feat: Add native SourceMap support #819
base: main
Are you sure you want to change the base?
Conversation
Splitting out a simplification from #819.
99706b1
to
333c579
Compare
This commit deprecates `SourceMapGetter` trait, `JsRuntime::source_map_getter` option and updates `ModuleLoader` trait to have the same methods as `SourceMapGetter`. In real usage it's always implementor of `ModuleLoader` that also implements `SourceMapGetter`. It makes little sense to keep these two trait separate. This will open up doors for native source map support that is being developed in #819. `SourceMapGetter` is scheduled to be removed in 0.297.0.
I think I'm gonna change
|
I think we have that in Preact. We've gotten reports for a while that the source maps don't load (outside of Deno) and this could explain why. I didn't know that the paths were expected to begin with |
I don't think it's expected to being with |
if !file_name.trim_start_matches('[').starts_with("ext:") { | ||
source_line = source_mapper.get_source_line(file_name, line_number); | ||
source_line_frame_index = Some(i); | ||
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.
Verify this in a separate PR. We support source maps for ext:
modules so most likely this is not needed
core/source_map.rs
Outdated
let source_map = if let Some(b64) = | ||
source_map_string.strip_prefix("data:application/json;base64,") | ||
{ | ||
let decoded_b64 = BASE64_STANDARD.decode(b64).ok()?; |
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.
This code is duplicated in CLI, maybe we can have a common helper shared between the two?
Ref denoland/deno#4499
Ref denoland/deno#21988