Closed Bug 1433373 Opened 3 years ago Closed 1 year ago

Jump to definition button in console does not handle sourcemap

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox60 wontfix, firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox60 --- wontfix
firefox71 --- fixed

People

(Reporter: nchevobbe, Assigned: wartmanm)

References

Details

Attachments

(1 file, 1 obsolete file)

Steps to reproduce:
1. Go to https://simple-webpack.glitch.me/
2. Open the console
3. See the "render()" function logged
4. Click on the "jump to definition" button


Expected results:

The app.jsx tab is open in the debugger

Actual results:

The bundle source is open in the debugger.
In this case the bundle is small and quite readable so it's not really an issue. In other configurations this might be a problem.
Also, if there's a sourcemap file, we should always try to use it and navigate the user to the original file.
Nicolas, am I right that this also fixes jumping to pretty-printed sources as mentioned in https://stackoverflow.com/q/48484273/432681? Or are pretty-printed sources handled differently to source-mapped files?

Sebastian
Flags: needinfo?(nchevobbe)
Second question: What's the bug the "jump to definition" button was implemented? I couldn't find it and wanted to mark it as dev-doc-needed.

Sebastian
This was implemented in Reps, which are in Github https://github.com/devtools-html/devtools-core/pull/812, and the hook in the webconsole was added in Bug 1419787.

For the pretty-printed source, I do think it is using sourcemap, but I'm not sure.
I'll check when this bug is fixed.
Flags: needinfo?(nchevobbe)
Product: Firefox → DevTools
Priority: -- → P2

Hi, is this bug available?

Hello Matthew, yes it is :) Are you interested working on it?

Yes, I'd like to work on it, please. I'm interested in making source maps more transparent in general.

Great, the bug is now yours :)

You can read through https://docs.firefox-dev.tools/getting-started/ to set up everything to work on devtools.

Then, this is the place where we create the jump to definition button devtools/client/debugger/packages/devtools-reps/src/reps/function.js#36-49

You can see that we execute onViewSourceInDebugger which we pass to the React component.
So we need to run the location through a sourcemap service, like we do in https://searchfox.org/mozilla-central/source/devtools/client/shared/components/SmartTrace.js.

You can join us on Slack if you want to discuss anything :)

Assignee: nobody → mattheww
Depends on: 901138

Bundle changes

Attachment #9095280 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Blocks: 1585407
Keywords: checkin-needed

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e92d0cd2aaf
Use source mapping for console jump to definition button r=nchevobbe

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
Regressions: 1589346

Mattheww, you indicated this bug regressed Bug 1589346, but I don't think it really did?

Flags: needinfo?(wartmanm)

You're right, I'm very sorry. It's the same issue but a different regression.

Flags: needinfo?(wartmanm)
Regressions: 1590824
No longer regressions: 1589346
QA Whiteboard: [qa-71b-p2]
You need to log in before you can comment on or make changes to this bug.