-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Reliable JavaScript/SourceMap processing via DebugId
#81
Conversation
DebugId
Ad unresolved questions: I think the |
DebugId
DebugId
32e2939
to
0a6d0ca
Compare
Good work @Swatinem on the RFC, I am a bit confused by the cons of the |
text/0081-sourcemap-debugid.md
Outdated
|
||
**cons** | ||
|
||
- Might incur some async fetching / IO when capturing an Error. Though any `abs_path` in the stack trace should be cached already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't sound like a good idea to me. Mostly gut feeling but some other things come to mind:
- Resource could be large
- There might be delay in fetching the resource causing racing situations with navigations and so on
- (I'll add additional reasons here when they come to mind)
- It does however require parsing of the `Error.stack` at time of capturing the `Error`. | ||
|
||
An alternative implementation might use the [`import.meta.url`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) | ||
property. This would avoid capturing and post-processing an `Error.stack`, but does require usage of ECMAScript Modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but does require usage of ECMAScript Modules
IMO this is a deal breaker. At least while IE is still somewhat relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather build for the future, as when this spec become widespread the IE will be no more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an implementation detail anyhow so instead of building for the future I'd rather build for compatibility right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once this is being implemented as bundler plugins, its possible to also make this configurable, with appropriate defaults. For example, if a bundler is configured to output ESM, it might inject the more compact ESM snippet, falling back to the other one in case of CommonJS/UMD output.
Have we considered languages/frameworks that are transpiled to JS? Such as Flutter Web (Dart -> JS), you don't have much control over the transpilation and minification steps, nor you do have build hooks, not sure how the |
@marandaneto |
Yeah Flutter web spits out source maps, and our symbolication works except for a few optimizations on the Dart side (as of now not a problem at all). |
Could be also |
We want to make processing / SourceMap-ing of JavaScript stack traces more reliable. To achieve this, we want to uniquely identify a (minified / deployed) JavaScript file using a DebugId. The same DebugId also uniquely identifies the corresponding SourceMap. That way it should be possible to _reliably_ look up the SourceMap corresponding to a JavaScript file, which is necessary to have reliable SourceMap processing.
e88ea47
to
f9682c5
Compare
Don't know about this, since in some cases we don't have either There are ways to make the debug id deterministic, but I don't think we can or should enforce the "origin of determinism". |
Considering that our goal is to capture change as defined by any change in the non-minified source, the hash of the source map is our best bet. The only caveat I am thinking of is if there is the possibility that |
Auxiliary options with source hashes: Original Spec from Edge |
Do you know if the |
I think we generally want to merge this RFC with some minor edits, but we need to also document somewhere, what the changes to the artifact bundle are. I'm okay if this is not in the RFC as we already have it somewhere, but as it stands it's undocumented. |
We want to make processing / SourceMap-ing of JavaScript stack traces more reliable.
To achieve this, we want to uniquely identify a (minified / deployed) JavaScript file using a
DebugId
.The same
DebugId
also uniquely identifies the corresponding SourceMap.That way it should be possible to reliably look up the SourceMap corresponding to
a JavaScript file.
Rendered RFC