Skip to content
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

Hardening: Remove or at least warn about sections.url #29

Closed
jkrems opened this issue Apr 11, 2023 · 7 comments · Fixed by tc39/source-map-spec#7
Closed

Hardening: Remove or at least warn about sections.url #29

jkrems opened this issue Apr 11, 2023 · 7 comments · Fixed by tc39/source-map-spec#7

Comments

@jkrems
Copy link
Contributor

jkrems commented Apr 11, 2023

Index maps in the spec support putting each section into a separate resource, linking via the url field. In practice, few (if any) tools actually support this. If that's the case, it may be less confusing to remove it from the spec.

@mitsuhiko
Copy link
Contributor

I would go even further and advocate against the use of indexed source maps. It's not much harder for a tool to rewrite source maps properly today.

@littledan
Copy link
Member

littledan commented Apr 11, 2023

Do any tools support this [edit: specifically, the url field]? Do browsers support it?

If this feature doesn't match implementations, we should remove it.

@jkrems
Copy link
Contributor Author

jkrems commented Apr 11, 2023

@mitsuhiko We're actively using index maps in general (no sections[].url though) and it would be non-trivial to replace them. We assemble JS in production dynamically and do the same for the source maps for those responses. Parsing and merging the source map fragments would be fairly (and very likely too) expensive.

@littledan
Copy link
Member

@mitsuhiko Let's break out the discussion about indexed source maps into a separate issue then?

Here, let's focus on the url field. Does anyone have information compiled about the implementation reality?

@bmeurer
Copy link

bmeurer commented Apr 12, 2023

Chromium DevTools supports index maps (and has always supported them), but does not support the url field in the sections.

Regarding tools: @sokra recently filed an issue regarding performance of index maps in Chrome DevTools, which might indicate that webpack and/or turbopack might be using them as well soon(ish)? 😄

@mitsuhiko
Copy link
Contributor

I separated out the wider discussion about the index maps.

@bomsy
Copy link
Collaborator

bomsy commented Apr 13, 2023

I can confirm the same for https://github.com/mozilla/source-map which is used by Firefor DevTools ( and maybe used by other tools) that indexed sourcemaps are supported but not the url field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants