Closed Bug 1056988 Opened 10 years ago Closed 7 years ago

Implement sourcemap sections

Categories

(DevTools :: Debugger, defect)

31 Branch
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1237593

People

(Reporter: davidsouther, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.143 Safari/537.36

Steps to reproduce:

Serve a concatenated file, that has a source map with a `sections` array of offsets and source maps. (See https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt)

To test, clone https://github.com/DavidSouther/stassets/commit/e6ecb9cd009d82a5f8ccec1ba12c25b4735563ba

Run `npm install` and `bower install angular bootstrap`
Start `node test/server/app.js`
Visit `http://localhost:8989/`
View the source maps


Actual results:

No source maps appeared.


Expected results:

Expect to see less files (for bootstrap), stylus (for css), and coffee (for JS code).
Component: Untriaged → Developer Tools: Debugger
mozilla/source-map doesn't support source maps of the sections form yet: https://github.com/mozilla/source-map/issues/16

Will keep this open until it does and we've merged that version that adds support into m-c.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: SourceMaps not loading `sections`. → Implement sourcemap sections
It seems to me that a big problem with supporting sections is that a lot our code assumes that there is a N:1 relationship between original sources and a generated source. Wouldn't source map sections break that invariant? If so, how are we planning to deal with that?
Flags: needinfo?(nfitzgerald)
(In reply to Eddy Bruel [:ejpbruel] from comment #2)
> It seems to me that a big problem with supporting sections is that a lot our
> code assumes that there is a N:1 relationship between original sources and a
> generated source. Wouldn't source map sections break that invariant? If so,
> how are we planning to deal with that?

Source map sections don't change any of that, its just for if you have, say, 3 files that are all generated and come with a source map, and want to concatenate them together and maintain your source mapping. Rather than recompute all the offsets and create one big composed source map, the sections source map form lets you just say "for this part of the file, use this source map, for that part of the file, use that source map, etc..".
Flags: needinfo?(nfitzgerald)
Closing this one as a dup because the other bug has slightly simpler STR, I think.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.