-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CP] [dart2wasm] Generate source maps #56239
Comments
If this gets accepted, flutter may want to cherry-pick flutter/flutter#151643 to flutter/flutter in their beta/stable. |
Summary: Dart2wasm currently lacks source map support, making stack traces in Flutter web development unreadable. This issue proposes cherry-picking source map support into the beta release to improve stack trace readability for developers. |
lgtm |
LGTM - we discussed this at the scrum meeting today and concluded to move forward with the CP (together with the flutter CP as well) |
@mkustermann cherry-pick approved, please merge. |
This implements generating source maps for the generated Wasm files. Copying dart2js's command line interface, a source map file with the name `<program name>.wasm.map` is generated unless `--no-source-maps` is passed. When a source map is generated, the generated .wasm file gets a new section `sourceMappingURL` with the contents `<program name>.wasm.map`. This section seems to be undocumented, but Chrome and binaryen recognize it as the URI to the source map file. Chrome is then loads it automatically in the DevTools. - `wasm_builder` package is updated with the new `source_map` library, which describes the source mapping entries. - `wasm_builder`'s `InstructionsBuilder` is updated with the new public members: - `startSourceMapping`: starts mapping the instructions generated to the given source code. - `stopSourceMapping`: stops mapping the instructions generated to a source code. These instructions won't have a mapping in the source map. - `CodeGenerator` sets the source file URI and location in the file when: - Starting compiling a new member - Compiling an expression and statement Bug: #55763 Change-Id: Ieb24796b4b17a735b846793617664a453f1061ce Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/370500 Cherry-pick-request: #56239 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/375660 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
Merged. |
Commit(s) to merge
We'd like the source map support for dart2wasm to be included in the next stable to be released (which current beta will be the base for I assume).
Target
beta
Prepared changelist for beta/stable
https://dart-review.googlesource.com/c/sdk/+/375660
Issue Description
Flutter web developers get only names in stack traces but no line numbers.
What is the fix
Cherry-pick the source map support.
Why cherry-pick
To make stack traces more readable in local development we'd like users of dart2wasm to get source map support. Due to infrequent releases of stable, we'd like to cherry-pick this into the beta (which I assume will become the upcoming stable)
Risk
Low
Issue link(s)
#55763
Extra Info
No response
The text was updated successfully, but these errors were encountered: