Closed Bug 1834725 Opened 1 years ago Closed 10 months ago

Report errors related to sourcemap somewhere in debugger UI

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox123 fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 3 open bugs, Regressed 1 open bug)

Details

Attachments

(4 files, 2 obsolete files)

For now, many errors related to source maps are only logged into the browser console.
If the sourcemap is still functional enough, you may be able to see some original sources and see some error message in CodeMirror. But in various cases, you won't be able to know that something went wrong.

We should find one or many placeholder where to display such errors.
We may have a first UI element where we display early errors, which doesn't related to any specific original source. Like unable to fetch the source map file, invalid source map file,...
And then a second UI element specific to each original source where we may should errors specific to a particular source.

Blocks: 1850024
  • a first toggle to enable/disable source-map entirely (you need to reload the page to see a difference)
  • a second one finally displaying the implicit "should select original source" boolean,
    which is equivalent of clicking on footer's link... but at least we have a clear UI state to
    explain if pause and links will show/open original sources or not.
  • a last one to hide generated sources from the sources tree.
    Not sure the other way around could be useful: only show generated? should rather disable source maps?
  • Accept exceptions from getOriginalURLS.
  • Avoid instantiating an editor for functional original sources.
    Solely for getting their friendlyName, whereas we could lazily compute it only when we need it.

Also re-throw the exception so that the debugger can start displaying source map errors.

I'm introducing a new dedicated method on SourceMapLoader so that we can:

  • ensure retrieving the resolved source map URL, even in case of errors
    so that we can easily open the source map file from the frontend.
  • pass all useful data in one worker call (ignore urls + sources + error + resolve source map url)

I'm also introducing a duplicate UI from the previous patches in the SourceTree to control SourceMaps
directly from the Footer. This is probably a better place to show Source Map errors?
And while displaying errors, it may be more relevant to also be able to control all source map settings?

Comment on attachment 9351841 [details]
Bug 1834725 - [devtools] Show various source-map settings in the Sources Tree.

Revision D187574 was moved to bug 1853897. Setting attachment 9351841 [details] to obsolete.

Attachment #9351841 - Attachment is obsolete: true

I'm introducing a new dedicated method on SourceMapLoader so that we can:

  • ensure retrieving the resolved source map URL, even in case of errors
    so that we can easily open the source map file from the frontend.
  • pass all useful data in one worker call (ignore urls + sources + error + resolve source map url)

Display the source map error in a new dedicated warning footer in the bottom of the editor pane.

Attachment #9351844 - Attachment description: Bug 1834725 - [devtools] Surface source map errors in Debugger frontend. → Bug 1834725 - [devtools] Introduce a new Menu Button dedicated to source maps.

Comment on attachment 9351844 [details]
Bug 1834725 - [devtools] Introduce a new Menu Button dedicated to source maps.

Revision D187577 was moved to bug 1853899. Setting attachment 9351844 [details] to obsolete.

Attachment #9351844 - Attachment is obsolete: true
See Also: → 1865062
Assignee: nobody → poirot.alex
Attachment #9351842 - Attachment description: Bug 1834725 - [devtools] Tweak original CSS handling. → Bug 1834725 - [devtools] Tweak original CSS handling in the Style Editor.
Status: NEW → ASSIGNED
Blocks: 1871087
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a920356b63eb [devtools] Tweak original CSS handling in the Style Editor. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/a56f42223377 [devtools] Log source map errors to the console directly from SourceMapLoader. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/4a8151163607 [devtools] Retrieve the resolved source map URL and source map error. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/0965e956200a [devtools] Surface source map errors in Debugger frontend. r=devtools-reviewers,nchevobbe

Backed out for causing failures on browser_styleeditor_loading_with_containers.js

task 2024-01-11T16:45:37.599Z] 16:45:37     INFO - TEST-PASS | devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js | The name '<inline style sheet #1>' is correct. - 
[task 2024-01-11T16:45:37.600Z] 16:45:37     INFO - Buffered messages finished
[task 2024-01-11T16:45:37.601Z] 16:45:37     INFO - TEST-UNEXPECTED-FAIL | devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js | the rule count is correct - Got +0, expected 3
[task 2024-01-11T16:45:37.601Z] 16:45:37     INFO - Stack trace:
[task 2024-01-11T16:45:37.601Z] 16:45:37     INFO - chrome://mochikit/content/browser-test.js:test_is:1619
[task 2024-01-11T16:45:37.601Z] 16:45:37     INFO - chrome://mochitests/content/browser/devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js:checkSheet:63
[task 2024-01-11T16:45:37.601Z] 16:45:37     INFO - chrome://mochitests/content/browser/devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js:null:33
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - chrome://mochikit/content/browser-test.js:handleTask:1138
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1210
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1352
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1127
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058
[task 2024-01-11T16:45:37.602Z] 16:45:37     INFO - TEST-PASS | devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js | The active status for this sheet is correct. - 
Flags: needinfo?(poirot.alex)
Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/85222078df86 [devtools] Tweak original CSS handling in the Style Editor. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/f7422af361da [devtools] Log source map errors to the console directly from SourceMapLoader. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/fb56c6d19143 [devtools] Retrieve the resolved source map URL and source map error. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/2db29de32bc8 [devtools] Surface source map errors in Debugger frontend. r=devtools-reviewers,nchevobbe
Regressions: 1875468
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: