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
List source map implementations #47
Comments
These would also be super helpful for understanding the systems to be tested. Here is an implementation from mozilla used in firefox |
I'll put forward the Scala.js compiler as generator. Some of our interpretations are:
In terms of implementation, perhaps one key aspect is that it is specialized for an incremental compilation pipeline. When changing part of a source program, the entire Scala compilation pipeline is incremental end-to-end, and that until re-pretting JS AST nodes and generating source maps. Source maps are actually a pain point here, since they must be regenerated from top to bottom every time. We have an intermediate data structure consisting of You can see our implementation here: |
There is also a fork of source-map — https://github.com/7rulnik/source-map-js |
This is our Rust library: https://crates.io/crates/sourcemap The most notable users of this library to the best of my knowledge are Sentry, SWC and Deno. It's pretty low level, we have higher level wrappers on top of that (js-source-scopes, symbolic, and symbolicator) for consumption. |
Here is Chrome DevTools implementation: https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/front_end/core/sdk/SourceMap.ts |
There is also https://www.npmjs.com/package/@jridgewell/source-map which is namely used in Terser. It tries to be compatible with Mozilla's source map library, but I have found some variance in the past. |
Will there be interesting differences between uses of the libraries when it comes to what we'd want to specify? E.g. will all users of mozilla/source-map generate "spec compliant source maps in all ways we care about" as soon as mozilla/source-map has been updated in accordance with a future hardened spec? If not, it may also be helpful to collect things like postcss which indirectly produce source maps. |
I maintain:
|
While trying to revive mozilla original source-map implementation, I went throught all major source map implementations I could easily find online and come up with this summary: |
https://github.com/webpack/webpack-sources has a SourceMap implementation here: https://github.com/webpack/webpack-sources/blob/main/lib/SourceMapSource.js |
SourceMap in Node.js: https://github.com/nodejs/node/tree/main/lib/internal/source_map |
https://github.com/parcel-bundler/source-map is used by Parcel and Lightning CSS |
If we're trying to harmonize source map implementations, it would be useful to list all of the implementations we can find, so that we can then compare them. This includes both generators and consumers.
The text was updated successfully, but these errors were encountered: