-
Notifications
You must be signed in to change notification settings - Fork 358
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
Wrong sourceRoot handling? #62
Comments
Just want to note, I am at Front Trends this week, and am taking the following week off, so it might be a little while until I look into this. |
Sorry I forgot about this. Doing a quick glance, it looks like you are correct that we aren't following the spec, but I think this is a case where we should change the spec. I think that users expect that if their |
I think that the spec should say that each source should be resolved against the sourceRoot. Since #93, |
Ah, this is very related: https://bugzilla.mozilla.org/show_bug.cgi?id=977463 |
@lydell: No, you're forgetting that you resolve the result of prepending |
@lydell is correct because the prefix see RFC3986
|
Ah, I was thinking normalisation would happen first, but that makes sense. I guess that pretty much decides the concatenation issue, then. If paths are joined by |
Note that my examples do use plain old string concatenation. I still think that the spec should be changed to say that each source should be resolved by doing |
However, I don’t think that the source root should be able to point to a file: |
See https://bugzilla.mozilla.org/show_bug.cgi?id=977463#c10. What Chrome does is:
I tend to think this library should do this as well. Also, it seems to me that it would be good for |
The source-map library has long implemented sourceRoot resolution using URL resolution. However, the source map specification is reasonably clear that concatenation is to be used instead. There is more information in these bugs: mozilla#62 https://bugzilla.mozilla.org/show_bug.cgi?id=977463 This patch changes the resolution to match what Chrome does. This is an incompatible change; but, I believe, better for interoperability. This patch also adds an optional sourceMapURL parameter to the SourceMapConsumer constructor. This allows us to implement the full source URL resolution algorithm in the source-map library. Fixes mozilla#62
If you're still following this issue, I encourage you to look at the PR. |
The source-map library has long implemented sourceRoot resolution using URL resolution. However, the source map specification is reasonably clear that concatenation is to be used instead. There is more information in these bugs: mozilla#62 https://bugzilla.mozilla.org/show_bug.cgi?id=977463 This patch changes the resolution to match what Chrome does. This is an incompatible change; but, I believe, better for interoperability. This patch also adds an optional sourceMapURL parameter to the SourceMapConsumer constructor. This allows us to implement the full source URL resolution algorithm in the source-map library. Fixes mozilla#62
Well, that PR didn't work out. It tried to cut a corner but that can't work. It's possible not to cut corners, and implement what the spec says. However this affects the API quite a bit. My first idea was to only keep absolute source URLs. But, there are tests that indicate that users of the API expect to be able to look up relative URLs; for example the test for issue #64. Maybe a more complicated idea is possible: keep the storage as-is, and absolutize URLs when handing them out -- but then |
The source-map library has long implemented sourceRoot resolution using URL resolution. However, the source map specification is reasonably clear that concatenation is to be used instead. There is more information in these bugs: mozilla#62 https://bugzilla.mozilla.org/show_bug.cgi?id=977463 This patch changes the resolution to match what Chrome does. This is an incompatible change; but, I believe, better for interoperability. This patch also adds an optional sourceMapURL parameter to the SourceMapConsumer constructor. This allows us to implement the full source URL resolution algorithm in the source-map library. Fixes mozilla#62
The source-map library has long implemented sourceRoot resolution using URL resolution. However, the source map specification is reasonably clear that concatenation is to be used instead. There is more information in these bugs: mozilla#62 https://bugzilla.mozilla.org/show_bug.cgi?id=977463 This patch changes the resolution to match what Chrome does. This is an incompatible change; but, I believe, better for interoperability. This patch also adds an optional sourceMapURL parameter to the SourceMapConsumer constructor. This allows us to implement the full source URL resolution algorithm in the source-map library. Fixes mozilla#62
The source-map library has long implemented sourceRoot resolution using URL resolution. However, the source map specification is reasonably clear that concatenation is to be used instead. There is more information in these bugs: mozilla#62 https://bugzilla.mozilla.org/show_bug.cgi?id=977463 This patch changes the resolution to match what Chrome does. This is an incompatible change; but, I believe, better for interoperability. This patch also adds an optional sourceMapURL parameter to the SourceMapConsumer constructor. This allows us to implement the full source URL resolution algorithm in the source-map library. Fixes mozilla#62
From the spec:
The spec say that the
sourceRoot
is prepended, but mozilla/source-map concat it with an additional slash/
.The text was updated successfully, but these errors were encountered: