-
Notifications
You must be signed in to change notification settings - Fork 17
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
Goals for evolving source maps #22
Comments
In the "harden the spec" area, would it be possible to also make the semantics of name mapping more precise? In particular,
For speed, the Scala.js compiler only puts them on the definition of variables and properties, but not their usages. On the speed aspect, would it be possible to take source map generation speed into account, and in particular to the incremental generation thereof? In the Scala.js linking pipeline, which is incremental end-to-end, source map generation is one of the most expensive steps! And that's despite recent optimizations in that area (commits of Feb-Mar 2023 here, if you're interested). The main difficulty, compared to the rest of our pipeline, is that we cannot make it fully incremental, due to the very nature of the encoding. We can make it incremental up to the generation of so-called By comparison, incrementally generating the .js files is mostly a matter of sending pre-computed byte blobs directly to the target files, and is basically instantaneous. I would love if we could have a solution for that. Perhaps a "development-mode" version of source maps, more amenable to incremental re-generation to the detriment of raw size? |
Yes, it is meaningful on property names, and I would suggest to create such a Related to hardening of "identifier" tokens with a It would be very good to clearly specify where the boundary of such mappings should be in terms of whitespace. I have seem As each token does not have an explicit end, but is rather implicitly bounded by the following token or the EOF, I would argue that tools already account for trailing whitespace or unrelated characters at the end of a token. However, we did run into problems with leading whitespace, as in the example |
Can I propose that we open individual issues for hardening the spec? Otherwise all these proposals are likely to die out in large discussions. |
I would also add:
|
Some notes on
We should also revisit the "Multi-level Mapping Notes" section of the spec - "multiple levels of mapping" are not supported by any tool I know of and I do not really see how it could be supported (we do not want to parse arbitrary intermediate representations). Perhaps the section should say that code transformers (compilers, bundlers, etc.) are responsible for composing source maps if their inputs come with source maps. The consumers of source maps (debuggers, post-mortem tools) should only deal with one level of source mapping. |
If were stipulating 0-based columns, should we also define lines? Everything I've used has 1-based (it's super confusing). And what counts as a line terminator? |
I prefer to have a new binary format. It can solve many problems. You can see a similar trend in HTTP to HTTP2. Source map will be used in the future for many years, if we can make it better (easy to generate/parse/small), it will benefit a lot to the whole ecosystem more than avoiding the temporary compatibility pain. |
I have trouble seeing significant benefit to a binary format to make it part of our initial goals. I'd prefer that we first focus on evolving source maps as they are. We can consider a binary encoding if it has well-demonstrated performance improvements, but initial goals are around improving accuracy, rather than performance. |
In the TC39 tools call in April 2023, a number of stakeholders discussed problems with sourcemaps. I'd summarize the goals from that as:
The text was updated successfully, but these errors were encountered: