4 ms·
I think the motivation of the original design was probably efficiently. Google ships many very large JS bundles, Gmail, Calendar, G+, etc. I think Gmail may be
by cromwellian 13y ago
I think the motivation of the original design was probably efficiently. Google ships many very large JS bundles, Gmail, Calendar, G+, etc. I think Gmail may be on the order of 4Mb obfuscated. Loading up large maps would hog tons of memory and be slow.
SourceMaps originally came out of a need for better stack trace deobfuscation I think, use inside of debuggers came way later.
I am totally onboard with fixing the deficiencies of the current format to make debugging better. Now that neither Firefox nor Chrome support the JSVM hooks we needed to make GWT DevMode work, we are stuck with sourcemaps for debugging, and Java programmers are not pleased with having to look at mangled symbol names in their scopes and watches.
I don't really care what the format of the file is, as long as it preserves a number of features:
1) can still ship and debug 'stripped' binaries, doing deobfuscation offline on the server
2) memory and network efficient. Don't make my JS debugger freeze loading these things in, or each up hundreds of megabytes
3) supports cascading and merging. We have hybrid apps at Google, that is, apps that are compiled with multiple transpilers and linked together. We 'merge' sourcemaps from these together in a unified sourcemap. So whatever the future format is, it should support efficient composition.
- kevingadd 13y agoYeah, I think they did a decent job of optimizing for constraints, other than the use of JSON and VLQ (Honestly, protobufs would have been a universally better encoding for this, since they provide fixed-size records you can seek through and already offer a superior variable-length encoding.) I think extending what we already have instead of reinventing the format is smart. All of your concerns listed at the end are things I care about too.