Closed Bug 1390768 Opened 7 years ago Closed 6 years ago

Use debugger stacktrace component in the Console

Categories

(DevTools :: Console, enhancement, P1)

enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
Firefox 65
Tracking Status
firefox65 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: dev-doc-needed, Whiteboard: [boogaloo-mvp])

User Story

The debugger implemented really nice ideas to have better, more understandable stacktraces (see https://hacks.mozilla.org/2017/05/debugger-html-call-stack-improvements/).
One of them is to collapse multiple subsequent frames that belong to the same library (React, Vue, Angular, …) and display the logo of the library when possible.
It would be really nice to have the same thing in the console so console.trace calls, logged errors or exception are less verbose and more helpful for the user.

Since the debugger and the console are both written in React, it should be possible for the Console to use the already defined debugger component.

Attachments

(3 files)

The debugger implemented really nice ideas to have better, more understandable stacktraces (see https://hacks.mozilla.org/2017/05/debugger-html-call-stack-improvements/).
One of them is to collapse multiple subsequent frames that belong to the same library (React, Vue, Angular, …) and display the logo of the library when possible.
It would be really nice to have the same thing in the console so console.trace calls, logged errors or exception are less verbose and more helpful for the user.


---

This would be very nice to ship that as the same time as the new debugger so we have a consistent way of dealing with stacktrace.
Priority: -- → P3
Whiteboard: [console-html][triage]
Flags: qe-verify?
Whiteboard: [console-html][triage] → [reserve-console-html]
Is there a shared component / utility we can use to collapse and render the logo for stack traces?
Flags: needinfo?(jlaster)
The logic for collapsing is only in the debugger (https://github.com/devtools-html/debugger.html/blob/ef9a689766a6a48334cee9a26cde774d491f92aa/src/utils/frame.js#L246-L284).

We could move some of this, along with library logos to devtools-core and share some code and assets.
I am planning to import the Stacktrace and Frame component into devtools-core, from m-c, so we can use it in Error object to have a proper stacktrace. Then we could share even more code.
I'd be happy to share the logic. Perhaps the icons are moved to a separate devtools-frameworks package? We can move the logic for collapsing frames into a reps util that we pull in for the call stack.

There might be other nice things we want to share as well, for instance the context menu. jump to the frame in the editor...
Flags: needinfo?(jlaster)
Priority: P3 → P4
Flags: qe-verify?
Priority: P4 → P2
Whiteboard: [reserve-console-html] → [newconsole-mvp]
Severity: normal → enhancement
Priority: P2 → P3
Whiteboard: [newconsole-mvp] → [newconsole-reserve]
Product: Firefox → DevTools
User Story: (updated)
Summary: Add debugger-like framework stacktrace-collapse → Use debugger stacktrace component in the Console
Whiteboard: [newconsole-reserve] → [boogaloo-mvp]
Priority: P3 → P2
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Priority: P2 → P1
Blocks: 1500963
No longer blocks: 1500963
Blocks: 1486870
This will allow the "copy message" context menu
entry to work as expected for console messages
with a stacktrace (exception, error message, console.trace, …)
The component is wrapping the `Frames` component from the debugger
in order to have access to frames grouping.
It also handles sourcemaps, since the debugger component
does not by itself.
Tests are added to ensure the component behaves as expected.

Depends on D11602
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/677553f9d910
Insert tab and new line chars in Frame component; r=Honza.
https://hg.mozilla.org/integration/autoland/rev/c22c5074ba48
Create a new React component to render stacktraces; r=Honza.
https://hg.mozilla.org/integration/autoland/rev/22834ab21180
Use new SmartTrace component in webconsole; r=Honza.
https://hg.mozilla.org/mozilla-central/rev/677553f9d910
https://hg.mozilla.org/mozilla-central/rev/c22c5074ba48
https://hg.mozilla.org/mozilla-central/rev/22834ab21180
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Depends on: 1508587
Depends on: 1508589
No longer depends on: 1508589
Regressions: 1592969
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: