-
Notifications
You must be signed in to change notification settings - Fork 363
Use built-in URL #275
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
Comments
For node we need |
But maybe we could work around that in devtools-source-map. |
We'll also need to work around it for the bundle that's put in |
One problem the current approach causes is that library users can't pass a |
This problem came up again here: https://bugzilla.mozilla.org/show_bug.cgi?id=1451274 I wrote a quick patch to change this but I am not completely sure it is correct. E.g., it regresses this test:
and this one:
I can't recall offhand if these are part of the spec or not, will have to check. |
Hi! Is there anything we can do to help move this forwards? Several Mozilla web teams use webpack based workflows, so are potentially affected by sourcemap issues that come up (eg webpack-contrib/style-loader#303). It would be good to try and keep our own employees using Firefox for web development :-) |
Sure - take over the patch here: https://github.com/tromey/source-map/tree/use-real-url For the webpack-contrib issue you linked to, a further part would be to add tests for blob URLs. If you really want to do all this I can also tell you how to get everything landed. I'm not working on devtools any more, which is why I'm not doing this... but another option would be to contact someone in devtools to see if anyone there can do it. |
This bug is a priority. If we can land this branch master...tromey:use-real-url, here I'd be happy to cut a new release and land it in MC. Here is a link to the devtools-source-maps package. @tromey we moved it into the debugger.html repo so it can be updated when the debugger updates. |
I tried for some hours to implement correct sourcemaps for my dev environment with webpack and I just could not solve it. Just to find out it's a known issue and it's working perfectly on Chrome. I'm using the last build on Firefox Dev Edition(62.0b3) and the style loader on webpack 4 (4.12.1) |
Hey @heyflo @JigzPalillo I'd be happy to take a look next week when I'm back. Ping me in our slack. |
Hi, is there any movement on this yet? It's a bummer not to be able to use FF for development. Thanks for all your hard work! |
Hi there: I was brought here from webpack-contrib/style-loader#303, hoping I can do something to push things forward, but things are, for sure, more complex than I thought. TL;DR:
Hoping some one could show me some way I could provide some help. I managed to pick up @tromey 's work, in my fork, fixed the dependency problem on "URL", and confirmed that message "sourceMapUrl could not be parsed" did not appear. I also ran the test suits, and it passed, so I am not sure about whether the issues metioned in #275 (comment) are still there. (The followings are more about However, for devtools-html/debugger.html, it still uses The work of updating to 0.7.2 (firefox-devtools/debugger#5598) seems already halted. I copied firefox-devtools/devtools-core#995 to
My guess is firefox-devtools/devtools-core#995 has not taken care of all the breaking change between source-map 0.6.1 and 0.7. I just want to share things I stumbled on, and that it is really saddening that we can not use Firefox as the main developing environment. I will be very delighted if any one could give me some suggestion or any review, despite my awkward English. |
Thanks for all the help. This is on our Sprint for the week. Would you like
to pair with us to get it in?
…On Tue, Sep 25, 2018, 6:51 AM rein ***@***.***> wrote:
Hi there:
I was brought here from webpack-contrib/style-loader#303
<webpack-contrib/style-loader#303>, hoping I
can do something to push things forward, but thing are, for sure, more
complex than I thought.
TL;DR:
1. It seems that I solved the URL dependency issue, in my fork
<https://github.com/redeyes2015/source-map/tree/use-real-url>.
2. devtools-html/debugger.html
<https://github.com/devtools-html/devtools-core> still uses source-map
0.6.1, but 0.7 introduce the use of WebAssembly, so how to load the
.wasm file is still hanging, and the progress seems halted (
firefox-devtools/devtools-core#995
<firefox-devtools/devtools-core#995> and
firefox-devtools/debugger#5598
<firefox-devtools/debugger#5598>).
3. Even experimenting with firefox-devtools/devtools-core#995
<firefox-devtools/devtools-core#995>, there are
still some issue (please check the last part).
------------------------------
I managed to pick up @tromey <https://github.com/tromey> 's work, in my
fork <https://github.com/redeyes2015/source-map/tree/use-real-url>, fixed
the dependency problem on "URL", and confirmed that message "sourceMapUrl
could not be parsed" did not appear. I also ran the test suits, and it
passed, so I am not sure about whether the issues metioned in #275
(comment)
<#275 (comment)>
are still there.
(The followings are more about devtools-html/debugger.html, but it was
the main reason I got tangled, so please allow me to log things here)
However, for devtools-html/debugger.html
<https://github.com/devtools-html/devtools-core>, it still uses
***@***.***, fixing the url problem lead me to the issue of "where
to get lib/mapping.wasm" due to the breaking change introduced in
source-map 0.7.
The work of updating to 0.7.2 (firefox-devtools/debugger#5598
<firefox-devtools/debugger#5598>) seems
already halted. I copied firefox-devtools/devtools-core#995
<firefox-devtools/devtools-core#995> to debugger.html,
again in my fork
<https://github.com/redeyes2015/debugger.html/tree/update-source-map>,
since "package/dev-tools-source-map" got moved to a different repository,
it seemed worked, at least no message of "sourceMapUrl could not be parsed"
and "lib/mapping.wasm", but the file names were not the paths of original
CSS files, and I saw error messages on the terminal where I invoked Firefox:
console.error: "Error while calling actor 'cssUsage's method 'createEditorReportForSheet'" "stylesheetActor is null; can't access its \"rawSheet\" property"
console.error: ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.***://devtools/shared/base-loader.js -> ***@***.******@***.******@***.***://devtools/shared/base-loader.js -> ***@***.******@***.***://devtools/server/startup/frame.js:19:4\n"
console.error: "Protocol error (unknownError): stylesheetActor is null; can't access its \"rawSheet\" property"
My guess is firefox-devtools/devtools-core#995
<firefox-devtools/devtools-core#995> has not taken
care of all the breaking change between source-map 0.6.1 and 0.7.
I just want to share things I stumbled on, and that it is really saddening
that we can not use Firefox as the main developing environment. I will be
very delighted if any one could give me some suggestion or any review,
despite my awkward English.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#275 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPiYlLAOH40SNDkfXor-LH_DzjfYLNmks5uegrJgaJpZM4Pg5pX>
.
|
I'd love to join, but I am not familiar with the process. Where should I start? |
ping me here https://devtools-html-slack.herokuapp.com/ and we can jump into appear.in |
@redeyes2015 i would try in the simplest form possible here. We can figure out how to integrate it in the debugger :) |
After more experiments, I found that it is object url ( And for this particular case, this patch seems suffice: diff --git a/lib/util.js b/lib/util.js
index 35bd93d..15a37dd 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -526,7 +526,7 @@ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
// If the sources are not absolute URLs after prepending of the
// “sourceRoot”, the sources are resolved relative to the
// SourceMap (like resolving script src in a html document).
- if (sourceMapURL) {
+ if (sourceMapURL && !sourceMapURL.startsWith("blob:")) {
const parsed = urlParse(sourceMapURL);
if (!parsed) {
throw new Error("sourceMapURL could not be parsed"); As for using built-in
Maybe it needs a second thought. |
I don't really recall the details of the patch, but I thought the relative stuff was handled correctly at least. Ok, I see I'd commented on the |
Heya, I've been looking at your PR a bit too because I'm trying to get this landed for the DevTools.
I think at the end of the day, focusing on URL semantics is the way to go on this, so I'd favor protocol-relative there.
Could you clarify what you mean about this?
Since
If I'm understanding right, for this case, we can consider refactoring
we'd do
because Can you spot any issues with this? |
Looking at this again @redeyes2015, I think I'd prefer
so it would throw if |
I think it's fine, assuming Also beware of this though: https://github.com/devtools-html/debugger.html/blob/master/packages/devtools-source-map/src/utils/fetchSourceMap.js#L30. This should probably be expanded to recognize |
I pushed another version, and I added a unit test to replicate what I believe For As For I am a bit confused about May be I should just remove those two Another thing I hesitate about is this patch translate spaces in path into "%20", but the previous version does not. May I hope someone to assure me this would be OK?
I am so sorry I provided mis-information again 😢 . I thought Thanks for point out the |
@loganfsmyth I assume this can be closed? |
Edit: In my particular case (using style-loader) I now get a different error message. Previously I would get: ~~Will this fix be released in Firefox 67? ~~
|
@mbalaam This change landed in 65. I would recommend filing a bug in Bugzilla with reproduction steps, and we can go from there. |
Just updated to |
Still getting the blob url on 67.0b6 Dev edition, it fails to point to the right scss file, working well on chrome |
@alvaro-escalante It would be best to file an issue in Bugzilla so we can track the issue. |
blob url still not working on 67.0b9 |
The bug in bugzilla was closed as fixed (https://bugzilla.mozilla.org/show_bug.cgi?id=1607639), closing this issue. |
source-map implements its own URL parsing, but it seems to me that it would be better to just use the built-in
URL
.The text was updated successfully, but these errors were encountered: